Allowing customer to enter a custom amount
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Is there a way to allow the customer to enter a custom amount for the invoice using the standard PayPal script below? I would like to allow the customer to be able to pay with PayPal or a credit card, but also would like them to be able to enter the amount for the payment. thanks
<div id="paypal-button-container"></div>
<script src="https://www.paypal.com/sdk/js?client-id=sb¤cy=USD" data-sdk-integration-source="button-factory"></script>
<script>
paypal.Buttons({
style: {
shape: 'rect',
color: 'gold',
layout: 'vertical',
label: 'pay',
},
createOrder: function(data, actions) {
return actions.order.create({
purchase_units: [{
amount: {
value: '1'
}
}]
});
},
onApprove: function(data, actions) {
return actions.order.capture().then(function(details) {
alert('Transaction completed by ' + details.payer.name.given_name + '!');
});
}
}).render('#paypal-button-container');
</script>
- Labels:
-
PayPal Buttons
Haven't Found your Answer?
It happens. Hit the "Login to Ask the community" button to create a question for the PayPal community.
- Credit payments are not working properly in Merchant Products and Services Archives
- on my cart page problem coming in Merchant Products and Services Archives
- Transaction Report Details in Reporting Archives
- Resolution Center dispute in Managing Risk and Fraud Archives
- Unable to vary qty of a subscription with REST API in Merchant Products and Services Archives