cancel
Showing results for 
Search instead for 
Did you mean: 

redirect to a confirmation web site after payment

Options
TigerMO
Contributor
Posted on

After I receive a payment from a customer, is there a way to automatically have PayPal redirect them to a custom web page on my site that thanks them for their payment and gives further instructions? I don't have any other merchant services enabled on PayPal.

4 REPLIES 4

redirect to a confirmation web site after payment

Options
sharpiemarker
Esteemed Advisor

@TigerMO 

 

If you use PayPal Website Payments Standard, choose a button type, the scroll to the bottom of page and click Customize advanced features link for the return url option:

https://developer.paypal.com/docs/classic/paypal-payments-standard/integration-guide/button-summary/

 

If you use smart buttons the available features to integrate here:

https://developer.paypal.com/docs/checkout/integration-features/#additional-smart-payment-buttons-fe...

 

If you need further assistance, post in the Technical forums:

https://www.paypal-community.com/t5/Merchant-Integration-Technical/ct-p/mts


Kudos & Solved are greatly appreciated. 🙂

redirect to a confirmation web site after payment

Options
TigerMO
Contributor

Let me clarify. I already have a Pay Now button that takes them to PayPal to submit the payment. After the payment, they have to click on Return to Merchant to go to the return URL. I'd like them to be redirected automatically without having the extra click. Is that possible?

redirect to a confirmation web site after payment

Options
gerard777
Contributor

Hi, i'm in the same case and try to solve this with the technical support.

After 6 days and lot of emails, they can find a proper answer.

 

 

redirect to a confirmation web site after payment

Options
GreenMonkeys
Contributor

Sadly, the New Smart Buttons Documentation redirects to a 404. Could the correct Documentation URL be provided so that we can figure out how to integrate the new Smart Buttons and have them auto redirect to a successful payment thank you page.

 

I've tried editing the part on the script for the success:

 

// Show a success message within this page, e.g.
//const element = document.getElementById('paypal-button-container');
//element.innerHTML = '';
//element.innerHTML = '<h3>Thank you for your payment!</h3>';

// Or go to another URL:
actions.redirect('https://mydomain.com/payment-success');

but no dice. It's not redirecting on either Sandbox or Live.

 

Here's the full script provided (I'm using Sandbox for privacy purposes). The module does work when I replace SB for my Client ID on the URL query.

<script src="https://www.paypal.com/sdk/js?client-id=sb&enable-funding=venmo&currency=USD" data-sdk-integration-source="button-factory"></script>
<script>
function initPayPalButton() {
paypal.Buttons({
style: {
shape: 'pill',
color: 'silver',
layout: 'horizontal',
label: 'paypal',

},

createOrder: function(data, actions) {
return actions.order.create({
purchase_units: [{"description":"Business Startup Package Deposit","amount":{"currency_code":"USD","value":0.5}}]
});
},

onApprove: function(data, actions) {
return actions.order.capture().then(function(orderData) {

// Full available details
console.log('Capture result', orderData, JSON.stringify(orderData, null, 2));

// Show a success message within this page, e.g.
//const element = document.getElementById('paypal-button-container');
//element.innerHTML = '';
//element.innerHTML = '<h3>Thank you for your payment!</h3>';

// Or go to another URL:
actions.redirect('https://my-domain.com/payment-success');

});
},

onError: function(err) {
console.log(err);
}
}).render('#paypal-button-container');
}
initPayPalButton();
</script>

 

Any guidance or answers would be greatly appreciated.

Thank you.

Haven't Found your Answer?

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