soneritics/buckaroojson

Buckaroo PHP implementation

v1.5 2022-01-01 17:37 UTC

This package is auto-updated.

Last update: 2024-10-29 05:28:29 UTC


README

Build Status Coverage Status Latest Stable License

Buckaroo

Buckaroo payment provider implementation classes Connect with Buckaroo through their easy to use JSON API.

Important!

If you have the problem where floats are serialized the wrong way, add this line to your code:

ini_set( 'serialize_precision', -1 );

you have this problem when you get the error: An error occurred while processing the transaction: Total amount of articles does not match the transaction amount (S996)

Payment methods

Currently, the following payment methods are supported

  • iDeal
  • AfterPay (DigiAccept)
  • Bancontact
  • KBC
  • Credit cards:
    • Mastercard
    • Visa
    • American Express
  • Debit cards:
    • VPay
    • Maestro
    • Visa Electron
    • Carte Bleue
    • Carte Bancaire
    • Dankort

Example

Some example code has been added in the Examples folder. A sneak peek below :-)

$transactionKey = ''; // Your transaction key here

$authentication = new Authentication($secretKey, $websiteKey);
$buckaroo = new Buckaroo($authentication, true);
$transactionStatusRequest = $buckaroo->getTransactionStatusRequest($transactionKey)->request();

if ($transactionStatusRequest['Status']['Code']['Code'] == PaymentStatus::SUCCESS) {
    // Order is paid
}

Multiple payment methods

When you want the customer to make a choice for the payment method, but you do not want it on your own site, that's also possible. You can use the MultiServiceTransactionRequest for that. This is something that's commonly used for creditcard transactions.

$ccTransactionRequest = $buckaroo->getMultiServiceTransactionRequest()
    ->addService(new CreditcardMastercard)
    ->addService(new CreditcardVisa)
    ->addService(new CreditcardAmericanExpress)
    ->setAmountDebit(12.5)
    ->setInvoice('inv-123')
    ->request();
    
// Redirect the user to: echo $ccTransactionRequest['RequiredAction']['RedirectURL']

Change list