Chandragupta Borkotoky
Chandragupta Borkotoky

Reputation: 1756

PayPal Subscription revise - buyer is not redirected after consent

I am using following PayPal REST API endpoint to revise subscription. In this case, I am trying to change the existing plan to 'enterprise plan'.

https://api-m.sandbox.paypal.com/v1/billing/subscriptions/I-RWWYH16HNGLT/revise

Following JSON is being sent in the body:

{
    "plan_id": "{{enterprise_plan_id}}",
    "application_context": {
        "return_url": "https://ijcaonline.org",
        "cancel_url": "https://www.elsevier.com"
    }
}

PayPal sends me a proper JSON response with HATEOAS link for approval.

{
    "plan_id": "P-58L61331DX546581WMIPDYMQ",
    "plan_overridden": false,
    "links": [
        {
            "href": "https://www.sandbox.paypal.com/webapps/billing/subscriptions/update?ba_token=BA-2HE39875M7268303S",
            "rel": "approve",
            "method": "GET"
        },
        {
            "href": "https://api-m.sandbox.paypal.com/v1/billing/subscriptions/I-RWWYH16HNGLT",
            "rel": "edit",
            "method": "PATCH"
        },
        {
            "href": "https://api-m.sandbox.paypal.com/v1/billing/subscriptions/I-RWWYH16HNGLT",
            "rel": "self",
            "method": "GET"
        },
        {
            "href": "https://api-m.sandbox.paypal.com/v1/billing/subscriptions/I-RWWYH16HNGLT/cancel",
            "rel": "cancel",
            "method": "POST"
        },
        {
            "href": "https://api-m.sandbox.paypal.com/v1/billing/subscriptions/I-RWWYH16HNGLT/suspend",
            "rel": "suspend",
            "method": "POST"
        },
        {
            "href": "https://api-m.sandbox.paypal.com/v1/billing/subscriptions/I-RWWYH16HNGLT/capture",
            "rel": "capture",
            "method": "POST"
        }
    ]
}

When I go to the approval link in the browser, I am greeted with the login form. But after login, the page loops arounds for a few seconds and later I am flashed with an error in the browser:

We’re sorry Things don’t appear to be working at the moment. Try Again

I opened the google chrome developer console and have noted the errors: Google Chrome developer console error screenshot

I tried doing the subscription revision using Javascript SDK as well rather than calling REST API endpoints but still the HATEOAS approval link won't work.

Upvotes: 0

Views: 362

Answers (1)

C.Monti
C.Monti

Reputation: 13

@Chandragupta, can you try the operation again? We had an identified issue that has since been resolved. If you are still encountering this issue after retry, please let us know.

Upvotes: 1

Related Questions