Setting the Item Name and Donate type with Smart Buttons
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I am attempting to upgrade our PayPal donations page, which uses code that predates both V1 and V2. We are a membership organization, and with that code the email which goes out to our members when they purchase a membership looks like this:
Description | Unit price | Qty | Amount |
Item Name: Membership Item# | $65.00 USD | 1 | $65.00 USD |
I have I have successfully managed to vary the Unit price (above) according to the membership level selected using radio buttons. And I got the PayPal buttons working with the sandbox using the following code:
paypal.Buttons({
createOrder: function(data, actions) {
var ele = document.getElementsByName('amount');
for(var i = 0; i < ele.length; i++) {
if(ele[i].checked) {
var described = 'Membership';
var camount = ele[i].value; // Standard membership donation.
var eleid = ele[i].id;
if (eleid == "5") {
var spec = document.getElementsByName('Samount'); // Special donation amount
camount = spec[0].value;
described = 'Special donation';
}
}
}
return actions.order.create({
purchase_units: [{ // I can't figure out how to set the item name.
amount: {
value: camount // this is how I inserted the amount from the radio buttons
}
}]
});
},
onApprove: function(data, actions) {
return actions.order.capture().then(function(details) {
alert('Thank you for your contribution, ' + details.payer.name.given_name);
});
}
}).render('#paypal-button-container'); // Display payment options on your web page
But I cannot figure out where to set the item name. And also, our old interface used to use the "Donate" button option, and I cannot find that option in the new code. I have tried to set up purchase_units copying the syntax in the documentation using this code:
purchase_units: [{
description: 'Membership',
amount: {
value: '0.01'
}
}]
However, whenever I include the "description:" line, the buttons fail to appear. Remove that line and it works just fine.
Finally, I have not been able to log into my business sandbox account using the credentials automatically generated for me by PayPal. So, I can't even look at the transactions to see if they work (if/when they work).
So, I'm looking for help or suggestions for these issues:
1. Donate instead of purchase button process (even if the button design doesn't change; I don't want to deal with shipping);
2. Setting the Item Name;
3. Logging into the supplied business sandbox account which was automatically created;
Any help would be appreciated. Thanks in advance.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I resolved the problem with logging into my sandbox business account. Somehow, the password got corrupted.
After logging in, I was able to look at my transactions. Here is an example:
Haven't Found your Answer?
It happens. Hit the "Login to Ask the community" button to create a question for the PayPal community.
- How to prompt a "thank you" after using donate button on a website in PayPal Payments Standard
- the make custom button does not display the memo field even though i added one in PayPal Payments Standard
- Add Venmo button to PayPal Donation setup in PayPal Payments Standard
- Paypal Buttons get an overlayed blank popup-window in PayPal Payments Standard
- Need help setting up my PayPal smart button for my online shop. in PayPal Payments Standard