【发布时间】:2021-06-25 04:24:33
【问题描述】:
我正在实施支付宝的地方进行付款结账。我使用他们的方法渲染了贝宝按钮,但我想将这些按钮的操作放在我的自定义按钮上,但它不起作用。
我尝试更改功能,但没有成功。
这是呈现按钮和执行结帐操作的函数:
paypal.Buttons({
style: {
shape: 'rect',
color: 'gold',
layout: 'vertical',
label: 'subscribe'
},
createSubscription(data, actions) {
return actions.subscription.create({
/* Creates the subscription */
plan_id: 'My ID hiden'
});
},
onApprove(data, actions) {
alert(data.subscriptionID); // You can add optional success message for the subscriber here
}
}).render(this.paypalElement2.nativeElement);
我试着做这个:
checkout() {
paypal.Buttons({
createSubscription(data, actions) {
return actions.subscription.create({
/* Creates the subscription */
plan_id: ''
});
},
onApprove(data, actions) {
alert(data.subscriptionID); // You can add optional success message for the subscriber here
}
});
}
但是当我按下按钮时没有任何反应。
有没有办法制作这项工作?
【问题讨论】:
标签: javascript angularjs angular paypal