【发布时间】:2019-04-12 17:50:10
【问题描述】:
我正在使用此代码使用正确的付款方式。
除了 bancontact 它正在工作,当用户选择 bancontact 时,会显示此错误 API call failed: Error executing API call (request): The payment method is invalid.
(Mollie 将 Bancontact 设置为批准的付款方式)
有什么建议吗? 或者在此处发布代码的哪一部分可能会很有趣,以防止发布太多代码。
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
),
));
【问题讨论】:
-
远射正中目标@lovelace :)
-
乐于助人,祝你好运!