cancel
Showing results for 
Search instead for 
Did you mean: 

Smart Payment Buttons - How to set return url

Options
Imengine
Contributor
Posted on

Hi All,

is there a way to set a return url with Smart Payment Buttons?

It's really unclear for the user that the thank you page is the same of the order page.

 

Thank you,

Luca

3 REPLIES 3

Smart Payment Buttons - How to set return url

Options
Gabriel_PP
PayPal Employee

Hi @Imengine 

 

Thanks for reaching out to us,

 

Here, you can find an example of how to do this on Smart Buttons.

 

There is an object called: redirect_urls 

 

   return actions.payment.create({
       payment: {
               transactions: [{
                  amount: {
                         total: '0.01',
                        currency: 'USD'
                              }
                  }],
                            redirect_urls: {
                                   return_url: 'https://example.com',
                                   cancel_url: 'https://example.com'
                              }
                  }
         });
       },

 

You could also set up a "cancel" URL.

 

I hope this helps,

Thanks,

Smart Payment Buttons - How to set return url

Options
Imengine
Contributor

Thank you.

It works also with Subscriptions?

 

This is my script

 

<script>
paypal.Buttons({
createSubscription: function(data, actions) {
return actions.subscription.create({
'plan_id': '<?=$paypal_plan_id;?>'
});
},
onApprove: function(data, actions) {}
}).render('#paypal-button-container');
</script>

 

Best,

Luca

Smart Payment Buttons - How to set return url

Options
peepz
New Community Member

Hi,

Did you get this to work? I am also looking for this solution with Smart Buttons and Subscriptions. I can't find any info on how to do this!

Haven't Found your Answer?

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