我现在被困在试图创建一个支付与Omnipay。我的项目中安装了以下库:
但我在开始的时候有问题。我在示例中看到,我需要这些参数:
$params = [
'amount' => $order->amount,
'issuer' => $issuerId,
'description' => $order->description,
'returnUrl' => URL::action('PurchaseController@return', [$order->id]),
];但是$issuerId是什么?我想要与莫利进行集成。
有人可能有一个与Mollie一起使用的例子吗?
更新:
我正在尝试提交带有ajax调用的表单。在我的PHP函数中,我有以下代码:
$gateway = Omnipay\Omnipay::create('Mollie');
$gateway->setApiKey('test_gSDS4xNA96AfNmmdwB3fAA47zS84KN');
$params = [
'amount' => $ticket_order['order_total'] + $ticket_order['organiser_booking_fee'],
'description' => 'Kapelhoek wijkfeesten',
'returnUrl' => URL::action('EventCheckoutController@fallback'),
];
$response = $gateway->purchase($params)->send();
if ($response->isSuccessful()) {
// payment was successful: update database
print_r($response); die;
} elseif ($response->isRedirect()) {
// redirect to offsite payment gateway
return $response->getRedirectResponse(); die;
} else {
// payment failed: display message to customer
echo $response->getMessage(); die;
}但是现在我得到了以下控制台错误:
XMLHttpRequest无法加载https://www.mollie.com/payscreen/select-method/PRMtm6qnWG。请求的资源上没有“访问-控制-允许-原产地”标题。因此,“http://kapelhoektickets.dev”源是不允许访问的。
我怎么才能解决这个问题?
发布于 2017-04-28 18:40:15
但是$issuerId是什么呢?
发行人ID是发行人的唯一标识符,例如ideal_ABNANL2A。在创建支付时,指定此ID作为发行者参数,以便将消费者直接转发到他们的银行环境。
您可以通过调用这个API url:https://api.mollie.nl/v1/issuers来查看可用的发行者列表。
如https://www.mollie.com/be/docs/reference/issuers/list中所述
要阅读更多关于发行者的信息,请访问API-文档的这一部分:https://www.mollie.com/be/docs/reference/issuers/get。
https://stackoverflow.com/questions/43684435
复制相似问题