1. Go to this page and download the library: Download petericebear/laravel-mollie library. Choose the download type require.
2. Extract the ZIP file and open the index.php.
3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
petericebear / laravel-mollie example snippets
$payment = Mollie::getPayments()->create([
"amount" => 10.00,
"description" => "My first API payment",
"redirectUrl" => "https://webshop.example.org/order/12345/",
]);
$payment = Mollie::getPayments()->get($payment->id);
if ($payment->isPaid())
{
echo "Payment received.";
}
$issuers = Mollie::getIssuers()->all();
$payment = Mollie::getPayments()->create(array(
"amount" => 10.00,
"description" => "My first API payment",
"redirectUrl" => "https://webshop.example.org/order/12345/",
"method" => Mollie_API_Object_Method::IDEAL,
"issuer" => $selected_issuer_id, // e.g. "ideal_INGBNL2A"
));
$payment = Mollie::getPayments()->get($payment->id);
// Refund € 15 of this payment
$refund = Mollie::getPayments()->refund($payment, 15.00);