我正在尝试集成 paypal,但遇到了这个错误。
We’re sorry. This seller doesn’t accept payments in your currency. Please return to the seller and choose another way to pay.
我设置的货币是美元。我没有阻止它,我已经将它添加到我的帐户中。
这是代码,我使用的是 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();
}
最佳答案
于是我找到了解决这个问题的方法。
只需登录商家帐户(可能是沙盒帐户)(例如:someone-facilitator@domain)。
然后点击仪表板右上角的齿轮图标打开设置页面。
现在,从左侧边栏点击“销售工具”,然后点击“收款和管理我的风险”部分下“卡住付款”前面的“更新按钮”。
请参阅所附图片。
现在,在“接收付款的首选项”部分,为“允许以我不持有的货币向我发送付款:”这一问题选择“是,接受......”。
Preferences for receiving payments - Screenshot
就是这样。
关于php - 我们很抱歉。该卖家不接受以您的货币付款,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/50438436/