Sandbox rejecting testing application context in Subscriptions API

KryThorne
Contributor
Contributor

I'm trying to create a subscription in a test environment.

 

I've got a product and plan but when I try to create a subscription the application context's return_url and cancel_url are being rejected with this in the response for each:

 

{
    "field": "/application_context/cancel_url",
    "value": "http://homestead.test/paypal_cancel",
    "location": "body",
    "issue": "INVALID_PARAMETER_SYNTAX",
    "description": "The value of a field does not conform to the expected format."
}

 

I've used the same URLs (and application context object) just fine in testing a normal payment in the sandbox.

 

What am I missing here? If it were a live environment I could understand it being rejected for the development URL or for the fact it isn't HTTPS.

Login to Me Too
3 REPLIES 3

KryThorne
Contributor
Contributor

Solved - leaving a note here in case anyone else has the same issue. Sandbox environment wouldn't accept 'homestead.test' but would accept 'homestead.com'.

Login to Me Too

del0
Contributor
Contributor

It seems like paypal check the top-level domain. More details in this issue on github, but the problem is on the sandbox API. Changing your testing domain to any valid top level domain will work.

Login to Me Too

MrSean_
Contributor
Contributor

What is the validation error in here??

based on this documentation #definition-application_context 
return_url and cancel_url should only be validated with Minimum length: 10 and Maximum length: 4000

 

{
  "name": "INVALID_REQUEST",
  "message": "Request is not well-formed, syntactically incorrect, or violates schema.",
  "debug_id": "2634d0a134f79",
  "details": [
    {
      "field": "/application_context/return_url",
      "value": "https://test-paypal.test/return",
      "location": "body",
      "issue": "INVALID_PARAMETER_SYNTAX",
      "description": "The value of a field does not conform to the expected format."
    },
    {
      "field": "/application_context/cancel_url",
      "value": "https://test-paypal.test/cancel",
      "location": "body",
      "issue": "INVALID_PARAMETER_SYNTAX",
      "description": "The value of a field does not conform to the expected format."
    }
  ],
  "links": [
    {
      "href": "https://developer.paypal.com/docs/api/v1/billing/subscriptions#INVALID_REQUEST",
      "rel": "information_link",
      "method": "GET"
    }
  ]
}

 



I was supposed to create another issue on paypal but then I found this thread, so thank you.. I'll just post this still so that when someone trying to search for the error is going to find it, since I really had a hard time doing the search.

Login to Me Too

Haven't Found your Answer?

It happens. Hit the "Login to Ask the community" button to create a question for the PayPal community.