Reputation: 951
We use paypal's SOAP API to process payments, sandbox payment processing is working fine but failing in production with the following response. I am not understanding transactions.amount.details field
Request:
{"transactions": [
{
"description": "",
"amount": {
"total": "1.00",
"currency": "USD",
"details": null
}
}
],
"payer": {
"payment_method": "credit_card",
"funding_instruments": [
{
"credit_card": {
"type": "visa",
"last_name": "xxxxx",
"first_name": "xxxx",
"expire_year": "xxxx",
"expire_month": "xx",
"cvv2": "701",
"number": "xxxxxxxxxxxxxxx",
"billing_address": {
"state": "CA",
"postal_code": "94704",
"phone": null,
"line2": null,
"line1": "xxxxxxxxxxx",
"country_code": "xx",
"city": "xxxxxxxx"
}
}
}
]
},
"intent": "sale"}
Response:
"status": 400,
"duration_time": 113,
"body": {
"message": "Invalid request - see details",
"information_link": "https://developer.paypal.com/docs/api/#VALIDATION_ERROR",
"details": [
{
"field": "transactions.amount.details",
"issue": "This field name is not defined for this resource type"
}
],
"name": "VALIDATION_ERROR",
"debug_id": "251e5ad7494cf"
},
"additional_properties": {},
"header": {
"Content-Length": "289",
"Content-Language": "*",
"CORRELATION-ID": "251e5ad7494cf",
"Date": "Tue, 20 Sep 2016 09:25:17 GMT",
"Connection": "close",
"Paypal-Debug-Id": "251e5ad7494cf",
"PROXY_SERVER_INFO": "host=dcg12javapapi9720.dcg12.slc.paypalinc.com;threadId=329",
"Content-Type": "application/json"
}
Upvotes: 0
Views: 301
Reputation: 40084
It expects an object itemizing the amount into subtotal, shipping etc as outlined here.
Example:
"amount": {
"total": "7.47",
"currency": "USD",
"details": {
"subtotal": "7.41",
"tax": "0.03",
"shipping": "0.03"
}
}
Upvotes: 1