paynl / nodejs-sdk

Pay.nl nodejs sdk
6 stars 7 forks source link

Error in types #19

Open JFGHT opened 3 years ago

JFGHT commented 3 years ago

When using Paynl.Transaction.get(order_id) and then reading info from paymentDetails, you cannot use paymentDetails.paidCurrency because its paymentDetails.paidCurreny instead.

Similar things happens in the docs:

https://docs.pay.nl/developers?language=en#transaction

"paidCurrenyAmount": "100", Shouldn't it be paidCurrencyAmmount?

Edit:

paymentDetails.state is number in the types but it's a string.

tim-vandenbosch commented 3 years ago

Hello @JFGHT,

I haven't replied on issues in a while so bear with me;

PaymentDetails initializes with paidCurrenyAmount & paidCurreny 'cause of the API-response of Pay. . This, however, should be corrected during initialising. https://github.com/paynl/nodejs-sdk/blob/543279d0e9657a9de9079c4344970dd599a6cce8/src/result/transaction.ts#L173-L177 We'll have to wait on the API to patch this 😄

paymentDetails.state is indeed a number. I saw multiple "state"s declared throughout the sdk, as string. So that might be causing the "problem"?

Hope this helps