I currently am encountering the following response from PayPal when attempting to process a Subscription payment.
2 times out of 10, this is what we are experiencing when we try to execute a billing agreement:
err: Error: Response Status : 400
httpStatusCode: 400
message: "Response Status : 400"
response: Object
debug_id: "bdbdb346c2726"
httpStatusCode: 400
information_link: "https://developer.paypal.com/webapps/developer/docs/api/#INVALID_TOKEN"
message: "The token is invalid"
name: "INVALID_TOKEN"
__ proto__: Object
stack: undefined
__ proto__: Error
result: null
this: global
Any help in troubleshooting the issue would be greatly appreciated. Has anyone encountered a similar issue?
Based on PayPal's log, the error message is EXECUTE_AGREEMENT_BUYER_NOT_ACCEPTED, It looks like buyer didn't accept this agreement, so you can't create billing agreement based on the token.
Related
I set developed my own site that sells items with a shopping cart. When items are selected, a call is made to paypal's api to create a payment request, then to complete the payment. Seems to work fine with sandbox mode, but with live setting I get the following response :
{ [Error: Response Status : 400]
response:
{ name: 'VALIDATION_ERROR',
details: [ [Object] ],
message: 'Invalid request - see details',
information_link: 'https://developer.paypal.com/docs/api/#VALIDATION_ERROR',
debug_id: 'f8dbb7c22fdf2',
httpStatusCode: 400 },
httpStatusCode: 400 }
I was wondering if someone out who has worked with paypal's api to give me some advice.
Thanks!
Yesterday we were able to create payments and get redirect urls that could be used to approve payments. However today the redirect urls that get returned all result in pages with the message "At this time, we are unable to process your request. Please return to and try another option."
We are also unable to GET previous payments that have not been approved/refunded. Instead we get
{
"name": "INVALID_RESOURCE_ID",
"message": "The requested resource ID was not found",
"information_link": "https://developer.paypal.com/docs/api/#INVALID_RESOURCE_ID",
"debug_id": "ade89339d6e00"
}
Additional debug ids include: d07f86c738cea,5c6da3bb0b6a.
There are allready several posts about this. All you can do is to wait until this issues is fixed by paypal. Fixing the url by yourself wont fix the problem.
We are now adding PayPal future to our iOS application.
We are testing it with the sanbox of course but I keep getting "Invalid authorization code" error when I am trying to get an access toekn from OAuth2AuthorizationCode which we got from PayPal mSDK.
This is our request:
"https://api.sandbox.paypal.com/v1/identity/openidconnect/tokenservice",
"method":"post",
"headers":{"Content-Type":"application/x-www-form-urlencoded",
"Authorization":"Basic QWFNdTNQYXBfcnNhSFFQTXl...."},
"body":"&grant_type=authorization_code&response_type=token&code=QzEwMS4z....."
And this is the response / error that we are getting:
{"status":400,"execution_time":397,"body":{"error_description":"Invalid authorization code","error":"access_denied","correlation_id":"XXXX",
"information_link":"https://developer.paypal.com/docs/api/#errors"}}
Thanks
I have fully integrated my website with paypal using paypal RESTful's API PHP SDK. Now my problem is every once in a while on the payment process, once the user approves the payment and it comes back to my website for execution, the API execution request comes back with the following responses from paypal. The HTTP response code's in these scenarios are 400 and 500. Below I have listed the error name and error message which comes as a part of the JSON response I get form paypal on execute action (https://api.paypal.com/v1/payments/payment/PAY-xxxxxxxxxxxxxxxxxxxxxxxxxx/execute):
400 PAYMENT_NOT_APPROVED_FOR_EXECUTION,Payer has not approved payment
500 INTERNAL_SERVICE_ERROR,An internal service error has occurred
In terms of the code I use to make that call I have added the function which executes the payment. I should add that this is working in 98% of times. Below is the code:
public function getExecute()
{
// Payment is cancelled
if (!(Input::get('success') && Input::get('success') == 'true'))
return $this->runPaymentExitProcess();
// No paymentId
if (!Session::has('paymentId'))
return "No payment id to execute";
$paymentId = Session::get('paymentId');
$this->payment = Payment::get($paymentId, $this->apiContext);
// The payer_id is added to the request query parameters when the user is redirected from paypal back to your site
$this->execution->setPayer_id(Input::get('PayerID'));
$response = $this->payment->execute($this->execution, $this->apiContext);
// Check for paypal errors
if (isset($response->name)) {
// When we have a paypal error
if ($this->hasPaypalError($response)) {
$error = array('name' => $response->name, 'message' => $response->message);
Session::put('error', $error);
return (MODE == 'LIVE') ? Redirect::to('/paypalerror') : Redirect::to('/paypalerror'.MODE_PARAM);
die;
}
}
// Unset session
Session::forget('paymentId');
// execution successful
if ($this->addPaymentIdToUser($paymentId))
return (MODE == 'LIVE') ? Redirect::to('/') : Redirect::to('/'.MODE_PARAM);
}
The code is in laravel. Please note that the $this->apiContext is set in the constructor of the class. Also this is the function is the success url which is set in the API under redirect_urls.
Can someone please help me figure out if this issue is coming from my side or Paypal's side?
For the 400 error, this would occur if the user decided not to approve the payment. If you think the payment was actually approved in the web flow then that would be an issue to look into further.
Can you provide the debugId and approximate time (with timezone, or GMT) of a 500 internal server error response, and a 400 if you believe the payment was actually approved by user.
Today, out of nowhere, my app has stopped working.
I'm getting this message and when i click ok, he redirect and get a server error.
API Error Code: 100
API Error Description: Invalid parameter
Error Message: Some content in this message has been reported as abusive by Facebook users.
I use Facebook php sdk.
How to fix this?