Redirect Url Smart Button

Mattiia
Contributor
Contributor

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&amp;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

Login to Me Too
0 REPLIES 0

Haven't Found your Answer?

It happens. Hit the "Login to Ask the community" button to create a question for the PayPal community.