我使用PayPal REST API在我的网站上实现订阅(定期付款)。我必须通过PayPal通过订阅计划设置一个通知URL以通知付款(例如,每月计划)。 PayPal将其称为即时付款通知。
我的问题是,开发人员是否可以滥用该来电来模拟来自PayPal的来电?因为开发人员知道传递给该方法的通知URL和参数。开发人员只需知道recurring_payment_id。
如果它可能被滥用,那么我应该遵循哪些步骤来防止它。请指导我。
答案 0 :(得分:1)
即时付款通知不适用于Rest API,但是,Rest API确实有自己发送的通知。
为了使用Notifications for Rest API,开发人员需要创建Webhooks。
WebHooks and Notifications with PayPal Rest API
通过帐单协议配置文件ID,开发人员可以取消协议或暂停协议。开发人员无法从PayPal获取信用卡数据。
以下是PayPal开发者网站上有关定期付款和结算协议创建的一些信息:
即使有人能够从服务器获得回复,它也只是帐单协议的状态。不会返回任何帐户持有人信息。
这是来自PayPal开发者网站的示例回复: Retrieve an Agreement Rest API
{
"id": "I-0LN988D3JACS",
"state": "Pending",
"description": "New Description",
"plan": {
"payment_definitions": [
{
"type": "REGULAR",
"frequency": "Month",
"amount": {
"currency": "USD",
"value": "100.00"
},
"charge_models": [
{
"type": "TAX",
"amount": {
"currency": "USD",
"value": "12.00"
}
},
{
"type": "SHIPPING",
"amount": {
"currency": "USD",
"value": "10.00"
}
}
],
"cycles": "12",
"frequency_interval": "2"
}
],
"merchant_preferences": {
"setup_fee": {
"currency": "USD",
"value": "0.00"
},
"max_fail_attempts": "0",
"auto_bill_amount": "YES"
}
},
"links": [
{
"href": "https://api.sandbox.paypal.com/v1/payments/billing-agreements /I-0LN988D3JACS/suspend",
"rel": "suspend",
"method": "POST"
},
{
"href": "https://api.sandbox.paypal.com/v1/payments/billing-agreements/I-0LN988D3JACS/re-activate",
"rel": "re_activate",
"method": "POST"
},
{
"href": "https://api.sandbox.paypal.com/v1/payments/billing-agreements/I-0LN988D3JACS/cancel",
"rel": "cancel",
"method": "POST"
},
{
"href": "https://api.sandbox.paypal.com/v1/payments/billing-agreements/I-0LN988D3JACS/bill-balance",
"rel": "self",
"method": "POST"
},
{
"href": "https://api.sandbox.paypal.com/v1/payments/billing-agreements/I-0LN988D3JACS/set-balance",
"rel": "self",
"method": "POST"
}
],
"start_date": "2015-02-19T08:00:00Z",
"agreement_details": {
"outstanding_balance": {
"currency": "USD",
"value": "0.00"
},
"cycles_remaining": "12",
"cycles_completed": "0",
"final_payment_date": "2016-12-19T10:00:00Z",
"failed_payment_count": "0"
}
}