Mangopay / mangopay2-nodejs-sdk

Node.js SDK for MANGOPAY
https://www.npmjs.com/package/mangopay2-nodejs-sdk
MIT License
51 stars 38 forks source link

The CreationDate property is missing in the Cards model #332

Closed shengdaliu closed 1 year ago

shengdaliu commented 2 years ago

HTTP API endpoint results in comparison :

Screenshot 2022-08-29 at 14 42 43

https://github.com/Mangopay/mangopay2-nodejs-sdk/blob/af159a907515b1b0760879a837da551888549f33/lib/models/Card.js#L4

fredericdelordm commented 2 years ago

Hello @shengdaliu,

Thanks for the PR. We are looking into it

iulian03 commented 1 year ago

Hello, @shengdaliu . The CreationDate is already present in the parent entity - EntityBase

shengdaliu commented 1 year ago

Hello @iulian03

I tried on both release 1.30.0 (My current version on production) and 1.31.1

The mangopay.Cards.get() method doesn't retrieve correctly the CreationDate. Shall I use another endpoint to do that ? It seems a bit redundant to make two API calls to get one object instance.

Screenshot 2022-10-20 at 13 54 23

iulian03 commented 1 year ago

@shengdaliu I've tried reproducing your issue on both JS and TS, but the CreationDate is always returned:

JS:

image image

TS:

image image
shengdaliu commented 1 year ago

OK, it's all good, I was using console.log('%j', card) and logger.info('%j', card) from Winston. Both formatter %j filtered out the CreationDate field.

Thank you.