Install package by running the command:
$ composer require nimbles-nl/online-betaal-platform
$guzzle = new Client();
$apiToken = 'secret-token';
$apiUrl = 'https://api-sandbox.onlinebetaalplatform.nl/v1';
$onlineBetaalPlatform = new OnlineBetaalPlatform($guzzle, $apiToken, $apiUrl);
$amount = 10050; // in cents 100 = 1 euro.
$payment = new Payment('https://www.mywebsite.nl/return-url', $amount);
$product = new Product('Apple pie', 950, 1);
$payment->addProduct($product);
$payment = $onlineBetaalPlatform->createTransaction($payment);
$payment->getUid(); // remember this uuid..
return new RedirectResponse($payment->getRedirectUrl());
$uuid = 'uuid-received-from-create-method-above';
$payment = $onlineBetaalPlatform->getTransaction($uuid);
if ($payment->isSuccess()) {
// Your payment is successful
} else {
// Oops try again..
}
$payments = $onlineBetaalPlatform->getTransactions();
$guzzle = new Client();
$apiToken = 'secret-token';
$apiUrl = 'https://api-sandbox.onlinebetaalplatform.nl/v1';
$merchantManager = new MerchantsManager($guzzle, $apiToken, $apiUrl);
$merchant = $merchantManager->createMerchant('Klaas', 'Bruinsma', 'klaas@bruinsma.nl', '0031612345678');