0

我正在使用此代码使用正确的付款方式。除了bancontact它正在工作,当用户选择bancontact时会显示此错误API call failed: Error executing API call (request): The payment method is invalid. (Bancontact在Mollie被设置为批准的付款选项)

有什么建议么?或者在此处发布代码的哪一部分可能会很有趣,以防止发布太多代码。

if($_SESSION['checkout_betaling'] == 'iDEAL') { $method = 'ideal'; }
elseif($_SESSION['checkout_betaling'] == 'Bancontact') { $method = 'bancontact'; }
elseif($_SESSION['checkout_betaling'] == 'PayPal') { $method = 'paypal'; }
elseif($_SESSION['checkout_betaling'] == 'SOFORT') { $method = 'sofort'; }
elseif($_SESSION['checkout_betaling'] == 'Belfius') { $method = 'belfius'; }
elseif($_SESSION['checkout_betaling'] == 'KBC / CBC') { $method = 'kbc'; }
elseif($_SESSION['checkout_betaling'] == 'ING HomePay') { $method = 'inghomepay'; }
elseif($_SESSION['checkout_betaling'] == 'Creditcard') { $method = 'creditcard'; }

网址:mollie.php?bestel_id=$bestel_id&ordernr=$ordernr&bedrag=$bedrag&method=$method&levertijd_dagen=$levertijd_dagen

$payment = $mollie->payments->create(array(
    "amount"       => "{$bedrag}",
    "description"  => $config['bedrijf']." Bestelling {$ordernr}",
    "redirectUrl"  => "{$protocol}://{$hostname}{$path}/checkout_complete.php?",
    "webhookUrl"   => "{$protocol}://{$hostname}{$path}/mollie_update_db.php",
    "method"       => "{$method}",
    "metadata"     => array(
        "bestel_id" => $bestel_id,
        "ordernr" => $ordernr,
        "levertijd_dagen" => $levertijd_dagen
    ),
));
4

1 回答 1

0

感谢 lovelace 的帮助,我能够通过以下方式解决这个问题:付款方式 misercash 应该是 bancontact · 问题 #187 · mollie/mollie-api-php · GitHub

于 2019-04-13T14:04:58.080 回答