Object parameters changing format based on token


It appears the object parameters in the return of create order are changing with the token. When I use ‘cnon:card-nonce-ok’ the object looks like this:

id: 'HxLKedsQ4SybvaCnBynvl8YjsGSZY',
createdAt: '2023-01-26T18:07:56.275Z',
updatedAt: '2023-01-26T18:07:56.537Z',
amountMoney: { amount: 1000n, currency: 'USD' },
totalMoney: { amount: 1000n, currency: 'USD' },
approvedMoney: { amount: 1000n, currency: 'USD' },

when i use ‘cnon:card-nonce-rejected-postalcode’, the object looks like this:

id: '16Iyv8RjHYS1CL23i2hINPbiTAUZY',
created_at: '2023-01-26T18:04:06.016Z',
updated_at: '2023-01-26T18:04:06.126Z',
amount_money: { amount: 1000, currency: 'USD' },
total_money: { amount: 1000, currency: 'USD' },
approved_money: { amount: 0, currency: 'USD' },

note the difference in camel case and snake case. Is this intended behavior? Do i need to code for both?

Hello! I haven’t been able to reproduce this. Do you mind providing your application ID and some steps to reproduce? I would expect snake case to be used in all responses.


My app id id sandbox-sq0idb-tAIEvMrAywtfUgSx3nui8Q

I’m using paymnetApi.createPaymnet() from the square npm package. I am just printing out the result. I could whip up an example app and attach it it that would help

I guess it would be important to mention that I am attempting payments on behalf of a connected oAuth account

Thanks @josh_InvoiceMaker! Looks like the difference here is with the Node SDK, as the API response I’m actually seeing in your logs is correct. I’ll check in with the team about this.

Any idea’s if when an update could be released? We would like to release our square implementation in the next few days if possible

We’re still digging into this one, but it may take some time to get a fix out. I don’t have a timeline at the moment. I’ll update as we learn more!

Hey @josh_InvoiceMaker, we looked into this further and the root cause is not something that can be quickly or easily changed. We’re having further discussions on the topic, but for now I recommend writing your code to handle both casing behaviors.

The is for the update. Can you please notify me when an update is available?


To be transparent, this is not something that I would expect to change in the near future — but I’ve made a note to update this thread in the event that it does! You can also reference our Release Notes to keep track of changes.

The is for the update. Can you please notify me when an update is available?