gpt4 book ai didi

PayPal 计费协议(protocol) - 创建后无 approval_url 或 redirect_url

转载 作者:太空宇宙 更新时间:2023-11-03 15:46:26 26 4
gpt4 key购买 nike

我正在尝试使用 PayPal REST API 和 paypal-rest-api-sdk 在 PayPal Sandbox 上为 Java 设置计费协议(protocol)。所以,到目前为止,我已经能够创建一个计费计划并通过它的 id 来创建一个计费协议(protocol)。但是,我在创建计费协议(protocol)后得到的响应没有 approval_url 和 redirect_url。以下是我的要求

{
"name": "MYOP Recurring Contribution Agreement",
"description": "Agreement for MYOP Recurring Contributions",
"start_date": "2014-12-13T06:26:32Z",
"payer": {
"payment_method": "credit_card",
"funding_instruments": [
{
"credit_card": {
"number": "XXXXXXXXXXXX",
"type": "visa",
"expire_month": 1,
"expire_year": 2015,
"cvv2": 874,
"first_name": "Joe",
"last_name": "Young",
"billing_address": {
"line1": "52 N Main ST",
"city": "Johnstown",
"country_code": "US",
"postal_code": "43210",
"state": "OH"
}
}
}
]
},
"plan": {
"id": "P-85A16162MC374104FU7KAYMQ"
}
}

作为对我创建结算协议(protocol)请求的回应,我仅收到以下信息:

{
"id": "I-77GK9WNNV04U",
"links": [
{
"href": "https://api.sandbox.paypal.com/v1/payments/billing-agreements/I-77GK9WNNV04U",
"rel": "self",
"method": "GET"
}
]
}

当我通过协议(protocol) ID 的 GET 请求获取创建的计费协议(protocol)时,我收到有关协议(protocol)的信息,该协议(protocol)具有不包含 approval_url 或 redirect_url 的“链接”数组。

我无法继续将付款人发送到批准 URL 以执行协议(protocol)。请帮忙。

最佳答案

您正在使用 ("payment_method":"credit_card") 更改 ("Payment_method":"PAYPAL")

 '{
"name": "T-Shirt of the Month Club Plan",
"description": "Template creation.",
"start_date": "2016-03-31T00:37:04Z",
"plan": {
"id":"'.$plan_id.'"
},
"payer": {
"payment_method": "PAYPAL"
},
"shipping_address": {
"line1": "111 First Street",
"city": "Saratoga",
"state": "CA",
"postal_code": "95070",
"country_code": "US"
}
}';
Thanks

关于PayPal 计费协议(protocol) - 创建后无 approval_url 或 redirect_url,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/26903299/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com