[英]PayPal Subscription Data
Good day how can I change the data on my alert that instead of notifying the subscription ID it will show the subscribers name.美好的一天,我如何更改警报中的数据,而不是通知订阅 ID,而是显示订阅者姓名。
<div id="paypal-button-container"></div>
<script src="https://www.paypal.com/sdk/js?client-id=api&vault=true" data-sdk-integration-source="button-factory"></script>
<script>
paypal.Buttons({
style: {
shape: 'rect',
color: 'gold',
layout: 'vertical',
label: 'subscribe'
},
createSubscription: function(data, actions) {
return actions.subscription.create({
'plan_id': 'plan_id'
});
},
onApprove: function(data, actions) {
alert(data.subscriptionID);
}
}).render('#paypal-button-container');
</script>
I tried using data.subscriber.name.given_name
bases on this like in the Paypal checkout我尝试使用data.subscriber.name.given_name
基于此,例如在Paypal 结帐中
Put console.log(data);
把console.log(data);
in your code next to the alert, and after making a test payment look around in your Web Developer tools, expanding everything in the object to find the path to the data you want.在警报旁边的代码中,并在您的 Web Developer 工具中进行测试付款后,展开对象中的所有内容以找到所需数据的路径。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.