2

I'm currently stuck trying to create a payment with Omnipay. I have the following libraries installed in my project:

But I'm having problems starting. I see in the example that I need these params:

$params = [
    'amount' => $order->amount,
    'issuer' => $issuerId,
    'description' => $order->description,
    'returnUrl' => URL::action('PurchaseController@return', [$order->id]),
];

But what's the $issuerId? I would like to have an integration with Mollie.

Does someone maybe has an example of using laravel Omnipay with Mollie?

UPDATE:

I'm trying to submit my form with an ajax call. In my PHP function I have the following code:

 $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;
}

But now I'm getting the following console error:

XMLHttpRequest cannot load https://www.mollie.com/payscreen/select-method/PRMtm6qnWG. No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin 'http://kapelhoektickets.dev' is therefore not allowed access.

How can I fix this?

nielsv
  • 6,540
  • 35
  • 111
  • 215
  • Note that the `issuer` field is optional. You can omit it and Mollie will just display a screen where the consumer can choose their bank. – Daan Apr 30 '17 at 14:34
  • @Daan, I've updated my topic, can you help me? – nielsv May 03 '17 at 16:07

1 Answers1

2

But what's the $issuerId?

Issuer ID is The issuer's unique identifier, for example ideal_ABNANL2A. When creating a payment, specify this ID as the issuer parameter to forward the consumer to their banking environment directly.

You can see a list of available issuers by calling this API url: https://api.mollie.nl/v1/issuers

as stated in https://www.mollie.com/be/docs/reference/issuers/list

To read more about the issuer visit this part of the API-documentation: https://www.mollie.com/be/docs/reference/issuers/get

henrik
  • 1,558
  • 3
  • 14
  • 29
  • Fetching the list of issuers is also supported in the [`omnipay-mollie`](https://github.com/thephpleague/omnipay-mollie) module, using `$gateway->fetchIssuers()`. – Daan Apr 30 '17 at 14:30
  • 1
    @nielsv This is not how you should use stackoverflow – henrik May 03 '17 at 16:10