cancel
Showing results for 
Search instead for 
Did you mean: 

Pass a reference to the order with Smart Payment Buttons

SOLVED
Highlighted
Contributor

Pass a reference to the order with Smart Payment Buttons

Don't know why I can't seem to find this in the docs.. I have two simple Smart Payment Buttons on a page for people to send donations and I want to pass in a reference of each button so both the user and more importantly the site owner know which button was used as they are for different donation types.

 

I was expecting step 4 of this page https://developer.paypal.com/docs/checkout/integrate/ to have an option to pass in a reference during the createOrder process, is something like that not possible?

1 ACCEPTED SOLUTION

Accepted Solutions
Highlighted
PayPal Employee

Re: Pass a reference to the order with Smart Payment Buttons

Hi @joshunwin 

If you refer to the API Reference you can see that there is a purchase_units object. In this object you can pass a description, an invoice ID, a custom ID, or even an array of items that have names and descriptions.

 

In your case, it seems as though you would do best passing an item with a description, or just a Description in the purchase_units object that could look like:

 

"purchase_units": [
     { "description": "Donation Type 1" }
]

 

 This should be visible to both the user and the merchant when seeing the transaction in the account.

 

I hope this was helpful for you and happy testing!

-Aaron

View solution in original post

2 REPLIES 2
Highlighted
PayPal Employee

Re: Pass a reference to the order with Smart Payment Buttons

Hi @joshunwin 

If you refer to the API Reference you can see that there is a purchase_units object. In this object you can pass a description, an invoice ID, a custom ID, or even an array of items that have names and descriptions.

 

In your case, it seems as though you would do best passing an item with a description, or just a Description in the purchase_units object that could look like:

 

"purchase_units": [
     { "description": "Donation Type 1" }
]

 

 This should be visible to both the user and the merchant when seeing the transaction in the account.

 

I hope this was helpful for you and happy testing!

-Aaron

View solution in original post

Highlighted
Contributor

Re: Pass a reference to the order with Smart Payment Buttons

Doh! Thanks Aaron, I didn't realise you could pass additional fields to that object. Perfect!