我正在使用这个代码来使用正确的付款方法。除了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
),
));发布于 2019-04-13 22:04:58
多亏了lovelace的帮助,我能够用Payment method mistercash should be bancontact · Issue #187 · mollie/mollie-api-php · GitHub解决这个问题:
https://stackoverflow.com/questions/55657185
复制相似问题