[英]INVALID RESOURCE ID paypal Subcription update plan
i have this problem.我有这个问题。 (I try to update a subrcription on sanbox from one plan to another plan) - Same product, amount different.
(我尝试将 sanbox 上的订阅从一个计划更新到另一个计划) - 相同的产品,数量不同。
I call rest api POST :我调用 rest api POST :
https://api-m.sandbox.paypal.com/v1/billing/subscriptions/(SubscptionId)/revise https://api-m.sandbox.paypal.com/v1/billing/subscriptions/(SubscptionId)/revise
On visual studio debug it working and paypal response 200.在视觉工作室调试它工作和贝宝响应 200。
When i try to use on Azure web api (on logger i have this error on json)当我尝试在 Azure Web api 上使用时(在记录器上我在 json 上有这个错误)
issues="INVALID_RESOURCE_ID"
description =" Requested resource ID was not found."
But the resource id is not required on request field.但是请求字段不需要资源ID。
Someone know how i can resolve?有人知道我该如何解决吗?
Thanks in advance.提前致谢。
REQUEST:要求:
SUBSCRIPTION ACTIVATED WEBHOOK RESPONSE订阅激活的网络挂钩响应
response webhook paypal响应 webhook 贝宝
{
"id": "WH-05X15924JM439863B-0A754578Y3494494Y",
"create_time": "2022-06-17T09:57:07.299Z",
"resource_type": "subscription",
"event_type": "BILLING.SUBSCRIPTION.ACTIVATED",
"summary": "Subscription activated",
"resource": {
"quantity": "1",
"subscriber": {
"email_address": sb-m4dxd17050716@personal.example.com,
"payer_id": "HNJDGM4CVQWDQ",
"name": {
"given_name": "John",
"surname": "Doe"
},
"shipping_address": {
"address": {
"address_line_1": "Via Unit? d'Italia",
"admin_area_2": "Napoli",
"admin_area_1": "Napoli",
"postal_code": "80127",
"country_code": "IT"
}
}
},
"create_time": "2022-06-17T09:56:58Z",
"plan_overridden": false,
"shipping_amount": {
"currency_code": "EUR",
"value": "0.0"
},
"start_time": "2022-06-17T09:56:40Z",
"update_time": "2022-06-17T09:56:59Z",
"billing_info": {
"outstanding_balance": {
"currency_code": "EUR",
"value": "0.0"
},
"cycle_executions": [
{
"tenure_type": "REGULAR",
"sequence": 1,
"cycles_completed": 1,
"cycles_remaining": 0,
"current_pricing_scheme_version": 1,
"total_cycles": 0
}
],
"last_payment": {
"amount": {
"currency_code": "EUR",
"value": "50.0"
},
"time": "2022-06-17T09:56:58Z"
},
"next_billing_time": "2022-06-19T10:00:00Z",
"failed_payments_count": 0
},
"links": [
{
"href": https://api.sandbox.paypal.com/v1/billing/subscriptions/I-3J5HHBY1JHMC/cancel,
"rel": "cancel",
"method": "POST",
"encType": "application/json"
},
{
"href": https://api.sandbox.paypal.com/v1/billing/subscriptions/I-3J5HHBY1JHMC,
"rel": "edit",
"method": "PATCH",
"encType": "application/json"
},
{
"href": https://api.sandbox.paypal.com/v1/billing/subscriptions/I-3J5HHBY1JHMC,
"rel": "self",
"method": "GET",
"encType": "application/json"
},
{
"href": https://api.sandbox.paypal.com/v1/billing/subscriptions/I-3J5HHBY1JHMC/suspend,
"rel": "suspend",
"method": "POST",
"encType": "application/json"
},
{
"href": https://api.sandbox.paypal.com/v1/billing/subscriptions/I-3J5HHBY1JHMC/capture,
"rel": "capture",
"method": "POST",
"encType": "application/json"
}
],
"id": "I-3J5HHBY1JHMC",
"plan_id": "P-8SG32020HB3302043MKVTYZY",
"status": "ACTIVE",
"status_update_time": "2022-06-17T09:56:59Z"
},
"status": "SUCCESS",
"transmissions": [
{
"webhook_url": https://regolari.azurewebsites.net/RegolariCaller,
"http_status": 200,
"reason_phrase": "HTTP/1.1 200 Connection established",
"response_headers": {
"Transfer-Encoding": "chunked",
"Server": "Microsoft-IIS/10.0",
"Connection": "keep-alive",
"Set-Cookie": "ARRAffinitySameSite=2989c34f7c0cdb7ec5c37c2d6a0cd07c20c702dc389fc83ca79bfb532ef0320f;Path=/;HttpOnly;SameSite=None;Secure;Domain=regolari.azurewebsites.net",
"Date": "Fri, 17 Jun 2022 09:57:44 GMT",
"Content-Type": "application/json; charset=utf-8",
"X-Powered-By": "ASP.NET"
},
"transmission_id": "e87042a0-ee23-11ec-8079-f5b1270d17b4",
"status": "SUCCESS",
"timestamp": "2022-06-17T09:57:33Z"
}
],
"links": [
{
"href": https://api.sandbox.paypal.com/v1/notifications/webhooks-events/WH-05X15924JM439863B-0A754578Y3494494Y,
"rel": "self",
"method": "GET",
"encType": "application/json"
},
{
"href": https://api.sandbox.paypal.com/v1/notifications/webhooks-events/WH-05X15924JM439863B-0A754578Y3494494Y/resend,
"rel": "resend",
"method": "POST",
"encType": "application/json"
}
],
"event_version": "1.0",
"resource_version": "2.0"
}
PAYMENT SALED COMPLETED WEBHOOK付款已完成 WEBHOOK
{
"id": "WH-3YN53862H3003372E-77V7032476059723Y",
"create_time": "2022-06-17T09:57:17.044Z",
"resource_type": "sale",
"event_type": "PAYMENT.SALE.COMPLETED",
"summary": "Payment completed for EUR 50.0 EUR",
"resource": {
"billing_agreement_id": "I-3J5HHBY1JHMC",
"amount": {
"total": "50.00",
"currency": "EUR",
"details": {
"subtotal": "50.00"
}
},
"payment_mode": "INSTANT_TRANSFER",
"update_time": "2022-06-17T09:56:58Z",
"create_time": "2022-06-17T09:56:58Z",
"protection_eligibility_type": "ITEM_NOT_RECEIVED_ELIGIBLE,UNAUTHORIZED_PAYMENT_ELIGIBLE",
"transaction_fee": {
"currency": "EUR",
"value": "2.05"
},
"protection_eligibility": "ELIGIBLE",
"links": [
{
"method": "GET",
"rel": "self",
"href": https://api.sandbox.paypal.com/v1/payments/sale/5C135321A6617514V
},
{
"method": "POST",
"rel": "refund",
"href": https://api.sandbox.paypal.com/v1/payments/sale/5C135321A6617514V/refund
}
],
"id": "5C135321A6617514V",
"state": "completed",
"invoice_number": ""
},
"status": "SUCCESS",
"transmissions": [
{
"webhook_url": https://regolari.azurewebsites.net/RegolariCaller,
"http_status": 200,
"reason_phrase": "HTTP/1.1 200 Connection established",
"response_headers": {
"Transfer-Encoding": "chunked",
"Server": "Microsoft-IIS/10.0",
"Connection": "keep-alive",
"Set-Cookie": "ARRAffinitySameSite=2989c34f7c0cdb7ec5c37c2d6a0cd07c20c702dc389fc83ca79bfb532ef0320f;Path=/;HttpOnly;SameSite=None;Secure;Domain=regolari.azurewebsites.net",
"Date": "Fri, 17 Jun 2022 09:57:41 GMT",
"Content-Type": "application/json; charset=utf-8",
"X-Powered-By": "ASP.NET"
},
"transmission_id": "e11441f0-ee23-11ec-bf74-079e67007b5e",
"status": "SUCCESS",
"timestamp": "2022-06-17T09:57:20Z"
}
],
"links": [
{
"href": https://api.sandbox.paypal.com/v1/notifications/webhooks-events/WH-3YN53862H3003372E-77V7032476059723Y,
"rel": "self",
"method": "GET",
"encType": "application/json"
},
{
"href": https://api.sandbox.paypal.com/v1/notifications/webhooks-events/WH-3YN53862H3003372E-77V7032476059723Y/resend,
"rel": "resend",
"method": "POST",
"encType": "application/json"
}
],
"event_version": "1.0"
}
API CALL FOR CHANGE SUBSCRIPTION TO A NEW PLAN API 呼吁更改订阅新计划
POST https://api-m.sandbox.paypal.com/v1/billing/subscriptions/I-3J5HHBY1JHMC/revise
-H "Content-Type: application/json" \
-H "Authorization: Bearer <Access-Token>" \
-d '
{ "plan_id": " P-39787693WX5555114MKWE6KI"
}'
RESPONSE LOG ON AZURE LOG APPINSIGHT响应登录 AZURE LOG APPINSIGHT
{
"name": "RESOURCE_NOT_FOUND",
"message": "The specified resource does not exist.",
"debug_id": "cff93589c06cd",
"details": [
{
"issue": "INVALID_RESOURCE_ID",
"description": "Requested resource ID was not found."
}
],
"links": [
{
"href": https://developer.paypal.com/docs/api/v1/billing/subscriptions#RESOURCE_NOT_FOUND,
"rel": "information_link",
"method": "GET"
}
]
}
It would appear you created the subscription ID with a different APP/client-id than the one you are attempting to revise the subscription with.您创建的订阅 ID 似乎与您尝试修改订阅的 APP/客户端 ID 不同。
Manage your apps and corresponding client ids in https://www.paypal.com/signin?intent=developer&returnUri=https%3A%2F%2Fdeveloper.paypal.com%2Fdeveloper%2Fapplications在https://www.paypal.com/signin?intent=developer&returnUri=https%3A%2F%2Fdeveloper.paypal.com%2Fdeveloper%2Fapplications管理您的应用程序和相应的客户端 ID
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.