Sandbox rejecting testing application context in Subscriptions API
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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'.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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.
Haven't Found your Answer?
It happens. Hit the "Login to Ask the community" button to create a question for the PayPal community.
- I Have PayPal API Billing Authentication Failure Python-Flask in REST APIs
- Need Help Upgrading to PayPal complete payments in PayPal Upgrade Community
- How to test Subscription payments in Sandbox Environment
- invoice api doesn't accept bearer token in REST APIs
- Error creating subscription in sandbox account using js api in REST APIs