nimbles-nl/online-betaal-platform

PHP Package for onlinebetaalplatform

1.0.4 2017-08-29 09:07 UTC

This package is not auto-updated.

Last update: 2024-06-09 02:36:28 UTC


README

Build Status Latest Stable Version License Total Downloads codecov

This project is not maintained anymore

Download the package using composer

Install package by running the command:

$ composer require nimbles-nl/online-betaal-platform

Initializing OnlineBetaalPlatform

$guzzle = new Client();
$apiToken = 'secret-token';
$apiUrl = 'https://api-sandbox.onlinebetaalplatform.nl/v1';

$onlineBetaalPlatform = new OnlineBetaalPlatform($guzzle, $apiToken, $apiUrl);

Send a payment request

$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());

Receive a payment request

$uuid = 'uuid-received-from-create-method-above';

$payment = $onlineBetaalPlatform->getTransaction($uuid);

if ($payment->isSuccess()) {
    // Your payment is successful
} else {
    // Oops try again..
}

Receive Payments

$payments = $onlineBetaalPlatform->getTransactions();

Initializing Merchants Manager

$guzzle = new Client();
$apiToken = 'secret-token';
$apiUrl = 'https://api-sandbox.onlinebetaalplatform.nl/v1';

$merchantManager = new MerchantsManager($guzzle, $apiToken, $apiUrl);

Create Merchant

$merchant = $merchantManager->createMerchant('Klaas', 'Bruinsma', 'klaas@bruinsma.nl', '0031612345678');