- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi,
i had set up a standard subscription with sdk. It works fine, but i want to get some subscription-details like the name or email of subscriber. Anyone know how i get this information in the onApprove() function after the user had subscribe for a plan?
I know the process with a standard order, its like:
// JS
paypal.Buttons({
createOrder: function(data, actions) {
return actions.order.create({
intent: "CAPTURE",
prefer: "return=representation",
purchase_units: [{
amount: {
currency_code: "EUR",
value: preis_ges
}
}]
});
},
onApprove: function(data, actions) {
return actions.order.capture().then(function(details) {
var id = details.payer.payer_id ;
var name = details.payer.name.given_name+' '+details.payer.name.surname ;
});
}
}).render('#paypal-button-container');
But this wont work for a subscription ?!
Thanks, A
Solved! Go to Solution.
Accepted Solutions
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi, thanks for your reply.
After hours of searching for a working solution i've change my onApprove-function like following. This works for me:
onApprove: function(data,actions) {
return actions.subscription.get(data.subscriptionID).then(function(details) {
var mail = details.subscriber.email_address;
var name = details.subscriber.name.given_name+" "+details.subscriber.name.surname;
and so on...
});
}
All available values can you find here : https://developer.paypal.com/docs/api/subscriptions/v1/#subscriptions_get
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi @and_taurus,
Thank you for contacting PayPal community.
Our sincere apologies for the inconvenience caused.
Yes, you can get the subscriber details by implementing "Show subscription details".
Thank you for understanding and patience.
Sincerely,
Chiranjeevi
PayPal, Inc.
If this post or any other was helpful, please enrich the community by giving kudos or accepting it as a solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi, thanks for your reply.
After hours of searching for a working solution i've change my onApprove-function like following. This works for me:
onApprove: function(data,actions) {
return actions.subscription.get(data.subscriptionID).then(function(details) {
var mail = details.subscriber.email_address;
var name = details.subscriber.name.given_name+" "+details.subscriber.name.surname;
and so on...
});
}
All available values can you find here : https://developer.paypal.com/docs/api/subscriptions/v1/#subscriptions_get
Haven't Found your Answer?
It happens. Hit the "Login to Ask the community" button to create a question for the PayPal community.
- Express Checkout with Bigcommerce in PayPal Payments Standard
- Sandbox testing has beaten me !! in Sandbox Environment
- Issue with Empty store_info in Response Using /v1/reporting/transactions on Sandbox API in REST APIs
- can we assign a unique detail to every subscription creation? in NVP/SOAP APIs
- I want to implement subscription functionality. in REST APIs