Redirect Url Smart Button
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hello,
I would like to redirect users to a pdf file after the payment. This is the url of pdf file: https://pxritaly.com/wp-content/uploads/2021/05/Crypto-tips.pdf
How can I add this functionality to this Smart Button code?
<div id="smart-button-container">
<div style="text-align: center;">
<div id="paypal-button-container"></div>
</div>
</div>
<script src="https://www.paypal.com/sdk/js?client-id=sb&currency=EUR" data-sdk-integration-source="button-factory"></script>
<script>
function initPayPalButton() {
paypal.Buttons({
style: {
shape: 'rect',
color: 'blue',
layout: 'vertical',
label: 'buynow',
},
createOrder: function(data, actions) {
return actions.order.create({
purchase_units: [{"description":"Guida PXR Italy","amount":{"currency_code":"EUR","value":0.99}}]
});
},
onApprove: function(data, actions) {
return actions.order.capture().then(function(details) {
alert('Transaction completed by ' + details.payer.name.given_name + '!');
});
},
onError: function(err) {
console.log(err);
}
}).render('#paypal-button-container');
}
initPayPalButton();
</script>
Thank you for you support
- Labels:
-
Payments Pro
-
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.
- smart button in Merchant Products and Services Archives
- Smart button appears for half a second and then disappears in Merchant Products and Services Archives
- Payment modal closes if I'm logged in another tab in Merchant Products and Services Archives
- (not so) Smart Buttons and how to make them live on prod environment in Merchant Products and Services Archives
- My PayPal smart button isn't working on my wordpress website in Merchant Products and Services Archives