【问题标题】:Paypal Rest Sandbox Error贝宝休息沙盒错误
【发布时间】:2015-10-29 06:36:36
【问题描述】:

当我每次尝试创建 Paypal 付款时,我都会收到此错误“无法连接到 api.sandbox.paypal.com 端口 443:连接被拒绝”

        $payer = new Payer();
    $payer->setPaymentMethod('paypal');

    $itemSignup = new Item();
    $itemSignup->setName('Test');
    $itemSignup->setCurrency('EUR');
    $itemSignup->setQuantity(1);
    $itemSignup->setPrice(self::SIGNUP_PRICE);

    $itemList =new ItemList();
    $itemList->setItems([$itemSignup]);

    $amount = new Amount();
    $amount->setCurrency('EUR');
    $amount->setTotal(self::SIGNUP_PRICE);

    $transaction = new Transaction();
    $transaction->setAmount($amount);
    $transaction->setItemList($itemList);
    $transaction->setDescription('Test');

    $redirectUrls = new RedirectUrls();
    $redirectUrls->setReturnUrl('http://localhost/test/');
    $redirectUrls->setCancelUrl('http://localhost/test/');

    $payment = new Payment();
    $payment->setIntent('Sale');
    $payment->setPayer($payer);
    $payment->setRedirectUrls($redirectUrls);
    $payment->setTransactions(array($transaction));

    try {
        $payment->create($this->_apiContext);
    } catch(\Exception $e){
        dd($e->getMessage());

【问题讨论】:

  • 如果这是在 IIS 上,那么您的应用程序池可能需要重新启动
  • 等一下,抱歉,请检查您的端口转发。它可能不喜欢返回 localhost 确保你“上线”并尝试你的实际 IP 并确保端口 80 被转发
  • allow_url_fopen 开启
  • 抱歉,我更新了那条评论
  • 检查你的 apache access.log 看看是否有 SSL 握手错误

标签: php paypal paypal-sandbox paypal-rest-sdk


【解决方案1】:

要创建付款,网址应为:

https://api.sandbox.paypal.com/v1/payments/payment

【讨论】:

    猜你喜欢
    • 2023-04-10
    • 2015-07-17
    • 2016-04-17
    • 2017-02-15
    • 2012-10-12
    • 2013-04-16
    • 2013-06-29
    • 2018-04-27
    • 2013-10-18
    相关资源
    最近更新 更多