mollie / laravel-mollie

Mollie API client wrapper for Laravel & Mollie Connect provider for Laravel Socialite
https://www.mollie.com/
MIT License
326 stars 63 forks source link

Checkout doesn't show #39

Closed Raynth closed 6 years ago

Raynth commented 6 years ago

I've installed en configurated as shown in the README.md. I tested with this example:

$payment = Mollie::api()->payments()->create([ "amount" => 10.00, "description" => "My first API payment", "redirectUrl" => "https://webshop.example.org/order/12345/", ]);

$payment = Mollie::api()->payments()->get($payment->id);

if ($payment->isPaid()) { echo "Payment received."; }

I don't see the checkout, I'm getting no errors. I see the transaction showing in my account with the status 'open' at www.mollie.com. I use Chrome 65 and Laravel 5.6. I tried Edge also.

The documentation is poor for beginners. I'll need some help.

invalid-bot commented 6 years ago

I think your understanding is not correct.

The Create Payment API call responds with the unique id and the links.paymentUrl for the newly created payment. Your website stores the id, links it to the customer's order and redirects the customer to the paymentUrl from the Mollie API response. This is the URL to the payment screen for this specific payment.

You can access the Payment url as follows

$payment = Mollie::api()->payments()->create([ "amount" => 10.00, "description" => "My first API payment", "redirectUrl" => "https://webshop.example.org/order/12345/", ]); echo $payment->links->paymentUrl; // you should redirect your user to this url for payment

Read more here: https://www.mollie.com/en/docs/overview

willemstuursma commented 6 years ago

This package does not provide a "checkout", as it does not integrate with any ecommerce solutions. Instead, is it just a convenience wrapper for Laravel for the mollie/mollie-api-php package.

Have a look at our other package for drop in plugins for ecommerce software.

basepack commented 6 years ago

There is actually a function to get the Checkout Url after you create the payment: $payment->getCheckoutUrl()