Get order sandbox test with null payment_details
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Using my sandbox I set up an order and go through the PayPal payment portal, pay, read the orderId and then fetch the order info using the orderId and the accessToken. But the payment_details always come up null.
Here is the client side script which works fine. I can fetch the order with the returned ID but it only has a few fields populated. I also set the 'Prefer' header to "return=representation" to try and coax it to fill out the returned order data. I've tried using both V1 and V2 API. ("sandbox_url_here/v2/checkout/orders/id_here"). Does anyone know what I am missing?
paypal.Buttons(
{
createOrder: function(data, actions)
{
// Set up the transaction
return actions.order.create(
{
purchase_units: [
{
amount:
{
currency_id: 'CAD',
value: '20.00'
},
reference_id: '999'
}]
});
},
onApprove: function (data, actions)
{
return actions.order.capture().then(function (details)
{
//alert('Transaction completed by ' + details.payer.name.given_name);
// Call your server to save the transaction
return fetch('/pp_transaction_result.aspx',
{
method: 'post',
headers: { 'content-type': 'application/json' },
body: JSON.stringify({ orderID: data.orderID, })
});
});
}
}).render('#paypal-button-container');
Haven't Found your Answer?
It happens. Hit the "Login to Ask the community" button to create a question for the PayPal community.
- IPN works in sandbox but not live in Sandbox Environment
- Change the button from Sandbox to Production in REST APIs
- Issue with Rendering Trustly Payment Button via PayPal JavaScript SDK in SDKs
- PAYER_ACTION_REQUIRED returned for Capture intent when calling v2 checkout orders in Sandbox Environment
- API TRANSACTION_REFUSED in Sandbox when Capturing Payment in REST APIs