Hi Wix,
I implemented a feature base on the pay-API. I according to the documentation the returned object is
type PaymentResult = {
payment: Payment
status: string
transactionId: string
}
and this
type Payment = {
id: string
amount: number
currency: string
items: Array<PaymentItem>
userInfo: PaymentUserInfo
}
and create my code base on those.
But I realised in PRODUCTION that the actual response is
{
"payment":{
"id":"5***0**0-****-****-****-d363fa7***f2",
"amount":70,
"currency":"USD",
"items":[
{ }
]
},
"userInfo":{
"firstName":"Margaret",
"lastName":"****",
"email":"**@***.net",
"phone":"###-###-####",
"country":"USA"
},
"status":"Successful",
"transactionId":"ed****b1-****-4****-80**-ca****e2***8"
}
As you can see the userInfo has been moved from payment into the object’s root.
I’ve got to say my client and I are really pissed! There is no way to test the pay-API and the only thing we can rely on is the doc and we can’t trust it! That’s a business-critical feature (registering payment and notify the customer by email) that went down.
Please fix that and be more careful with your updates.
I keep on seeing those small errors & inconsistency in the doc that make us lose time & money.
In this case, It made my client lose money and it affects my business reputation!