简体   繁体   English

PayPal Plus - 在沙盒模式下没有“按发票付款”

[英]PayPal Plus - No "Pay upon Invoice" in Sandbox mode

I'm trying to integrate Paypal Plus in an online shop, using the REST API SDK, and so far everything is working fine.我正在尝试使用 REST API SDK 将 Paypal Plus 集成到在线商店中,到目前为止一切正常。 Only that the option "Pay upon Invoice" is missing.只是缺少“按发票付款”选项。 The funny thing is: Two weeks ago it was working.有趣的是:两周前它正在起作用。 And to my knowledge nothing has changed in the script.据我所知,剧本中没有任何变化。

I tried patching the payment before showing the paywall, as recommended in PayPal Plus Sandbox - Pay upon Invoice .我尝试在显示付费专区之前修补付款,如PayPal Plus Sandbox - Pay on Invoice 中推荐的那样。 I tried adding the shipping address to the itemlist.我尝试将送货地址添加到项目列表中。 I made sure, the shipping address really exists.我确定,送货地址确实存在。 Even upgraded the SDK.甚至升级了SDK。 I'm out of ideas.我没主意了。

This is what my PHP code looks like:这是我的 PHP 代码的样子:

$items = array();
$item = new PayPal\Api\Item();
$item->setName("test")
     ->setDescription("test")
     ->setCurrency('EUR')
     ->setQuantity(1)
     ->setPrice(5);
$items[] = $item;

$itemList = new PayPal\Api\ItemList();
$itemList->setItems($items);

$details = new PayPal\Api\Details();
$details->setTax(0.95)
        ->setSubtotal(5);
$amount = new PayPal\Api\Amount();
$amount->setCurrency("EUR")
       ->setTotal(5.95)
       ->setDetails($details);

$transaction = new PayPal\Api\Transaction();
$transaction->setAmount($amount)
            ->setItemList($itemList)
            ->setDescription("Test")
            ->setInvoiceNumber(uniqid());

$payer = new PayPal\Api\Payer();
$payer->setPaymentMethod("paypal");

$redirectUrls = new PayPal\Api\RedirectUrls();
$redirectUrls->setReturnUrl($CFG["paypal_return"]);
$redirectUrls->setCancelUrl($CFG["paypal_abbruch"]);

$payment = new PayPal\Api\Payment();
$payment->setIntent("sale")
        ->setPayer($payer)
        ->setRedirectUrls($redirectUrls)
        ->setTransactions(array($transaction));

try {
    $payment->create($apiContext);
    $approvalUrl = $payment->getApprovalLink();
    $paymentId = $payment->getId();
} catch (PayPal\Exception\PayPalConnectionException $ex) {d($ex);
    die("Error creating payment");
}

And below that my HTML/JS:下面是我的 HTML/JS:

<div id="ppplus"></div>
<script src="https://www.paypalobjects.com/webstatic/ppplus/ppplus.min.js" type="text/javascript"></script>
<script type="application/javascript">
    var ppp = PAYPAL.apps.PPP({
        "approvalUrl": "<?=$approvalUrl?>",
        "placeholder": "ppplus",
        "mode": "sandbox",
        "showPuiOnSandbox": "true",
        "country": "DE",
        "language": "de_DE",
        "surcharging": true,
        "useraction": "commit",
        "buttonLocation": "outside"
    });
</script>

Does anyone have an idea, that might do the trick?有没有人有想法,这可能会奏效?

By default, Pay upon Invoice is offered for total amounts between 1,50 and 1470 EUR.默认情况下,按发票付款的总金额在 1,50 到 1470 欧元之间。

https://developer.paypal.com/docs/paypal-plus/germany/how-to/pay-upon-invoice/ https://developer.paypal.com/docs/paypal-plus/germany/how-to/pay-upon-invoice/

To test pay upon invoice in Sandbox you can enable the payment method in PLUS by adding the following parameter to the configuration object: showPuiOnSandbox: "true",要在 Sandbox 中测试按发票付款,您可以通过将以下参数添加到配置对象来启用 PLUS 中的付款方式: showPuiOnSandbox: "true",

https://www.paypalobjects.com/digitalassets/c/website/marketing/emea/de/de/paypal-plus-center/PayPal_PLUS_integration_guide.pdf https://www.paypalobjects.com/digitalassets/c/website/marketing/emea/de/de/paypal-plus-center/PayPal_PLUS_integration_guide.pdf

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM