-
Notifications
You must be signed in to change notification settings - Fork 28
Description
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
- Create payment instrument of type SEPA
- Try to get it via
Instruments.GetSDK method - Expected
GetSepaInstrumentResponseproperty 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
*stringorstringinstead of*time.Time -
Add custom
UnmarshalJSONwhere 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.