我目前正在使用PHP Simple Order Api REST 客户端 https://github.com/Cyber Source/cybersource-rest-client-php
两个开发者指南都在
- https://developer.cybersource.com/api/developer-guides/dita-payments/CreatingOnlineAuth/CreatingAuthReqGooglePay.html
- http://apps.cybersource.com/library/documentation/dev_guides/Google_Pay_SO_API/html/wwhelp/wwhimpl/js/html/wwhelp.htm#href=ch_encryptedData.html#1123566
描述格式化通过google pay获得的数据的相同方式。然而,它们描述了格式化请求的不同方式。
1) Set the encryptedPayment_data field to the value of the
encryptedMessage field that was returned in the Full Wallet
response.
2) Set the paymentSolution field to 012.
和
2) In the authorization request under the paymentInformation
object, set the key field under the fluidData object to the
Base64-encoded value obtained from the Google Pay blob.
3) Under the processingInformation object, set the
paymentSolution field to 012.
我正在使用我尝试过的fluidData方式,因为我在Simple Order API中找不到encryptedPayment字段引用的引用,但它不起作用。
要求
{
"clientReferenceInformation": {
"code": "testcode"
},
"processingInformation": {
"paymentSolution": "012"
},
"paymentInformation": {
"fluidData": {
"key":"<Google Pay Blob>"
}
},
"orderInformation": {
"amountDetails": {
"totalAmount": "100.00",
"currency": "USD"
},
"billTo": {
"firstName": "John",
"lastName": "Doe",
"company": "ABC Company",
"address1": "1 Market St",
"locality": "san francisco",
"administrativeArea": "CA",
"postalCode": "94105",
"country": "US",
"email": "test@cybs.com",
"phoneNumber": "4158880000"
}
}
}
回复
[body] => stdClass Object
(
[submitTimeUtc] => 2019-04-10T16:05:39Z
[status] => INVALID_REQUEST
[reason] => MISSING_FIELD
[message] => Declined - The request is missing one or more fields
[details] => Array
(
[0] => stdClass Object
(
[field] => recipientInformation.card.number
[reason] => MISSING_FIELD
)
)
)
[message] => [400] Error connecting to the API (https://apitest.cybersource.com/pts/v2/payments/)