Custom message after successful payment in Subscription button code.
geej-mauriva
New Community Member
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Posted on
Jul-25-2024
12:18 PM
Hi there, I have a subscription button code that I'm embedding on my website and in the code there's a place where you have a custom message after successful payment.
Where exactly do I put the message in this code:
onApprove: function(data, actions) {
alert(data.subscriptionID); // You can add optional success message for the subscriber here
}
Do I put it before the ; or after the } ? Where exactly?
1 REPLY 1
Here-to-help
Contributor
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Aug-27-2024
05:20 AM
Hi @geej-mauriva ,
You can add a custom message within the onapprove function, after {
onApprove: function(data, actions) {
// You can add optional success messages for the subscriber here
}

Haven't Found your Answer?
It happens. Hit the "Login to Ask the community" button to create a question for the PayPal community.
Related Content
- Payments Refunded Automatically After Successful Transactions - PayPal Business Account Issue in REST APIs
- subscription_id has disappeared in REST APIs
- Recurring Payment issue in Braintree Client-side Integration (JS, iOS, Android SDKs)
- Paypal via Adyen Permission Denied in REST APIs
- Unable to test successful payments using sandbox personal accounts in NVP/SOAP APIs