Skip to content

Time parse error on get payment instrument #157

@rustik666

Description

@rustik666

Environment

  • Checkout SDK version: 1.5.0
  • Platform and version: Checkout.com sandbox
  • Operating System and version: MacOS

Description

The issue was encountered during getting of SEPA type payment instrument.

Expected behavior

Time is parsed without error.

Current behavior

During payment instrument unmarshalling of type SEPA, the next error is detected on this line: https://github.com/checkout/checkout-sdk-go/blob/master/instruments/nas/get.go#L132

(*time.ParseError)(0x14000598ff0)(parsing time "2025-03-21" as "2006-01-02T15:04:05Z07:00": cannot parse "" as "T")

Steps to reproduce

  1. Create payment instrument of type SEPA
  2. Try to get it via Instruments.Get SDK method
  3. Expected GetSepaInstrumentResponse property of the response is nil.

Possible solution

As far as I understand, issue is related to date_of_signature field:

DateOfSignature *time.Time `json:"date_of_signature,omitempty"`

As far as I know there is not simple way to fix it to keep *time.Time type of the field for such a format "2025-03-21". I see next options:

  • Negotiate with checkout.com team to change format of the date to make it as a full date-time field

  • Make this field as *string or string instead of *time.Time

  • Add custom UnmarshalJSON where this field will be properly parsed with another layout of date

  • I may be able to implement this bug fix

Additional information

Please let me know if this issue was already found and tracked. Also, don't hesitate to let me know if the best and fastest way to resolve it to make the bugfix by myself.

Metadata

Metadata

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions