I am trying to integrate paypal, but stuck with this error.
We’re sorry. This seller doesn’t accept payments in your currency. Please return to the seller and choose another way to pay.
The currency I am setting is USD. I have not blocked it and I have added it into my account.
Here is the code, I am using PHP.
$transaction_value = $this->payment_detail['amount'];
// $this->response($transaction_value);
$apiContext = new \PayPal\Rest\ApiContext(new \PayPal\Auth\OAuthTokenCredential(PAYPAL_CLIENTID,PAYPAL_SECRET));
$payer = new \PayPal\Api\Payer();
$payer->setPaymentMethod('paypal');
$amount = new \PayPal\Api\Amount();
$amount->setTotal($transaction_value);
$amount->setCurrency($this->payment_detail['currency']);
// $amount->setCurrency('INR');
$transaction = new \PayPal\Api\Transaction();
$transaction->setAmount($amount);
$redirectUrls = new \PayPal\Api\RedirectUrls();
$redirectUrls->setReturnUrl(PROTOCOL.base_url().'pay/api/process')
->setCancelUrl(PROTOCOL.base_url().'home');
$payment = new \PayPal\Api\Payment();
$payment->setIntent('sale')
->setPayer($payer)
->setTransactions(array($transaction))
->setRedirectUrls($redirectUrls);
try {
$payment->create($apiContext);
// $this->response(array("paymentId" => $payment->id));
header('Location: '.$payment->getApprovalLink());
exit(0);
// echo $payment;
// echo "\n\nRedirect user to approval_url: " . $payment->getApprovalLink() . "\n";
}
catch (\PayPal\Exception\PayPalConnectionException $ex) {
// This will print the detailed information on the exception.
//REALLY HELPFUL FOR DEBUGGING
echo $ex->getData();
}
So I found a way to solve this problem.
Simply log in to the merchant account probably a sandbox account (Example: someone-facilitator@domain).
Then open settings page by clicking on the gear icon at the top right corner of your dashboard.
Now, From left sidebar click on "Selling Tools" and then on "update button" in front of "Block Payments" under the "Getting paid and managing my risk" Section.
Refer to the image attached.
Settings page - Screenshot
Now In the "Preferences for receiving payments" Section, choose "Yes, accept ...." for the question "Allow payments sent to me in a currency I do not hold:".
Preferences for receiving payments - Screenshot
That's it.
I had the same problem. There's no need to worry about it. It's working totally fine. I called Paypal Customer support and they explained that for an Indian Paypal seller account to receive the money you need to set currency in USD and then only Non-Indian Accounts can make a purchase through it. If you set the currency as INR then only Indian accounts can make payment to you. You created a different account but still, you created it from India only using login credentials so it's still an Indian account. If you want to test then test from an account of someone who's not from India or not living in India. It will work properly fine.
Cheers!
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With