Javascript 在客户端使用智能按钮时是否可以添加PayPal Webhook?
各位 我正在学习PayPal集成,目前正在试验智能按钮。我希望能够在我的服务器应用程序上获得某种通知,在那里我可以确认付款状态,以便我可以执行某种服务器端登录到我的客户帐户。所以这里的主要问题是,这可能吗?如果是,从哪里开始 下面是我的客户端集成代码,我相信你们都太熟悉了Javascript 在客户端使用智能按钮时是否可以添加PayPal Webhook?,javascript,php,paypal,paypal-ipn,Javascript,Php,Paypal,Paypal Ipn,各位 我正在学习PayPal集成,目前正在试验智能按钮。我希望能够在我的服务器应用程序上获得某种通知,在那里我可以确认付款状态,以便我可以执行某种服务器端登录到我的客户帐户。所以这里的主要问题是,这可能吗?如果是,从哪里开始 下面是我的客户端集成代码,我相信你们都太熟悉了 function renderPayPalButtons(){ try{ paypal.Buttons({ // Set up the transaction
function renderPayPalButtons(){
try{
paypal.Buttons({
// Set up the transaction
createOrder: function(data, actions) {
return actions.order.create({
purchase_units: [{
amount: {
value: charge.amount
}
}]
});
},
client:{
sandbox:"AbzNp-Tmgs-qNkcew3odqPMmBO5LJcOMGVcDV6X5QzgVXBnSAomEERM-fAoKduWqTdhJIX1NrH3Nrz6u"
},
// Finalize the transaction
onApprove: function(data, actions) {
return actions.order.capture().then(function(details) {
// Show a success message to the buyer
alert('Transaction completed by ' + details.payer.name.given_name + '!');
});
}
}).render('#paypal-button-container');
}catch(e){
console.log('PayPal not loaded!');
}
}