cancel
Showing results for 
Search instead for 
Did you mean: 

Smart Payment Buttons and Multiple purchase_units

Options
JT7777
New Community Member
Posted on

I'm seeing contradictory behavior when using the Smart Buttons and trying send multiple payment_units.

 

The Orders API clearly states that "payment_units" is an array and implies that multiple items are allowed: "An array of purchase units. Each purchase unit establishes".

 

Further adding to the confusion, when I send multiple payment_unit_request objects in the array, the PayPal payment UI displays the total amount for all of the payment_unit_request amounts.

 

The scenario only fails when the payer clicks the pay button. At this point, the capture API call returns a 400 response indicating that "The requested action could not be performed, semantically incorrect, or failed business validation."

 

Here is the full response object:

{
"ack": "contingency",
"contingency": "UNPROCESSABLE_ENTITY",
"data": {
"name": "UNPROCESSABLE_ENTITY",
"details": [
{
"field": "/purchase_units/@reference_id==4dbc6c54-1111-41ab-94db-3f3d493819b7",
"issue": "PAYER_INVALID_FOR_PAYMENT",
"description": "Mismatch between request payer account number and session"
},
{
"field": "/purchase_units/@reference_id==4dbc6c54-2222-41ab-94db-3f3d493819b7",
"issue": "PAYER_INVALID_FOR_PAYMENT",
"description": "Mismatch between request payer account number and session"
}
],
"message": "The requested action could not be performed, semantically incorrect, or failed business validation.",
"debug_id": "614f4d6613c4c",
"links": [
{
"href": "https://developer.paypal.com/docs/api/orders/v2/#error-PAYER_INVALID_FOR_PAYMENT",
"rel": "information_link",
"method": "GET"
}
]
},
"meta": {
"calc": "614f4d6613c4c",
"rlog": "rZJvnqaaQhLn%2FnmWT8cSUueWscmrtUHe5Y1Bd%2FeqyvyOTq66rSXAcoHt23K4aX7r7RV0T%2BAtZVLHG%2FvY24WQLtP8HscVD18wRlJBrCCC7%2BE_176fc4daa02"
},
"server": "20-vV5gRvwbVJCitHScvK0IsJLy1aejD25H9pAU97CPyG3rmMtCIdkuzRZFsKzrdD1QPvQfhjgPYGeSc2PkxzzT62xVYQhnp2ZDIbobrsOJKDn3yXD_5MMebxS6FxlH9d7uH0UYpP-IsESzqThCLB4-qXH58qXSDP4XlqkwUxILEYHC4UOGmzqF95eejxEJlTdk_1pPAyTj9JSbKpua1DomqFUAPAXEfJSvSmogXlQqEe4wJQ8bjrURYveML_LUDDfVQt5gQuPk4VMm4W7MZ3m"
}

 

 

 

 

 

Haven't Found your Answer?

It happens. Hit the "Login to Ask the community" button to create a question for the PayPal community.