/**
  * @test
  */
 public function it_should_be_in_test_mode()
 {
     $this->oBuckarooTransaction->putInTestMode();
     $this->assertTrue($this->oBuckarooTransaction->isInTestMode());
 }
<?php

include __DIR__ . "/../vendor/autoload.php";
use SeBuDesign\Buckaroo\Transaction;
use SeBuDesign\Buckaroo\Helpers\ServiceHelper;
use SeBuDesign\Buckaroo\CreditCardTransaction;
/**
 *
 * WITH CREDIT CARD TRANSACTION CLASS
 *
 */
// Get all static credit card types
$staticCreditCardTypes = CreditCardTransaction::getStaticCreditCardTypes();
// Specific simplified credit card transaction
$oTransaction = new CreditCardTransaction('CHANGEME', __DIR__ . '/../tests/test.pem');
$creditCardResponse1 = $oTransaction->putInTestMode()->setAmount(1.23)->setInvoice('TEST_INVOICE')->setService(ServiceHelper::SERVICE_MASTERCARD)->setCustomerCode('test')->setStartRecurrent(true)->perform();
/**
 *
 * WITH TRANSACTION CLASS
 *
 */
// Credit card payment
$oTransaction = new Transaction('CHANGEME', __DIR__ . '/../tests/test.pem');
$creditCardResponse2 = $oTransaction->putInTestMode()->setAmountDebit(1.23)->setInvoice('TEST_INVOICE')->setService(ServiceHelper::SERVICE_MASTERCARD)->addServiceParameter('customercode', 'a_unique_code')->setStartRecurrent(true)->perform();
var_dump($creditCardResponse1, $creditCardResponse2);
<?php

include __DIR__ . "/../vendor/autoload.php";
use SeBuDesign\Buckaroo\BancontactMrCashTransaction;
use SeBuDesign\Buckaroo\Transaction;
use SeBuDesign\Buckaroo\Helpers\ServiceHelper;
/**
 *
 * WITH BANCONTACT & MR CASH TRANSACTION CLASS
 *
 */
$oTransaction = new BancontactMrCashTransaction('CHANGEME', __DIR__ . '/../tests/test.pem');
$response1 = $oTransaction->putInTestMode()->setAmount(1.23)->setInvoice('TEST_INVOICE')->perform();
/**
 *
 * WITH TRANSACTION CLASS
 *
 */
$oTransaction = new Transaction('CHANGEME', __DIR__ . '/../tests/test.pem');
$response2 = $oTransaction->putInTestMode()->setAmountDebit(1.23)->setService(ServiceHelper::SERVICE_BANCONTACT_MR_CASH)->setInvoice('TEST_INVOICE')->perform();
var_dump($response1, $response2);
Ejemplo n.º 4
0
<?php

include __DIR__ . "/../vendor/autoload.php";
use SeBuDesign\Buckaroo\SofortTransaction;
use SeBuDesign\Buckaroo\Transaction;
use SeBuDesign\Buckaroo\Helpers\ServiceHelper;
/**
 *
 * WITH BANCONTACT & MR CASH TRANSACTION CLASS
 *
 */
$oTransaction = new SofortTransaction('CHANGEME', __DIR__ . '/../tests/test.pem');
$response1 = $oTransaction->putInTestMode()->sellingPhysicalGoods()->setAmount(1.23)->setInvoice('TEST_INVOICE')->perform();
/**
 *
 * WITH TRANSACTION CLASS
 *
 */
$oTransaction = new Transaction('CHANGEME', __DIR__ . '/../tests/test.pem');
$response2 = $oTransaction->putInTestMode()->setAmountDebit(1.23)->setService(ServiceHelper::SERVICE_SOFORT_PHYSICAL)->setInvoice('TEST_INVOICE')->perform();
var_dump($response1, $response2);
Ejemplo n.º 5
0
<?php

include __DIR__ . "/../vendor/autoload.php";
use SeBuDesign\Buckaroo\Transaction;
use SeBuDesign\Buckaroo\PayPalTransaction;
use SeBuDesign\Buckaroo\Helpers\ServiceHelper;
/**
 *
 * WITH PAYPAL TRANSACTION CLASS
 *
 */
// With service parameters
$oTransaction = new PayPalTransaction('CHANGEME', __DIR__ . '/../tests/test.pem');
$paypalResponse1 = $oTransaction->putInTestMode()->setAmount(1.23)->setInvoice('TEST_INVOICE')->setCustomerEmail('*****@*****.**')->setPageStylesheetUrl('http://link.to/css (30 chars)')->setBillingAgreement('A description used for a billing agreement. (max 127 characters)')->setProductName('A product / order id')->setStartRecurrent(true)->perform();
/**
 *
 * WITH TRANSACTION CLASS
 *
 */
// With service parameters
$oTransaction = new Transaction('CHANGEME', __DIR__ . '/../tests/test.pem');
$paypalResponse2 = $oTransaction->putInTestMode()->setAmountDebit(1.23)->setInvoice('TEST_INVOICE')->setService(ServiceHelper::SERVICE_PAYPAL)->addServiceParameter('BuyerEmail', '*****@*****.**')->addServiceParameter('PageStyle', 'http://link.to/css (30 chars)')->addServiceParameter('BillingAgreementDescription', 'A description used for a billing agreement. (max 127 characters)')->addServiceParameter('ProductName', 'A product / order id')->setStartRecurrent(true)->perform();
var_dump($paypalResponse1, $paypalResponse2);
Ejemplo n.º 6
0
<?php

include __DIR__ . "/../vendor/autoload.php";
use SeBuDesign\Buckaroo\IdealTransaction;
use SeBuDesign\Buckaroo\Transaction;
use SeBuDesign\Buckaroo\Helpers\ServiceHelper;
/**
 *
 * WITH IDEAL TRANSACTION CLASS
 *
 */
$oTransaction = new IdealTransaction('CHANGEME', __DIR__ . '/../tests/test.pem');
$iDealResponse2 = $oTransaction->putInTestMode()->setAmount(1.23)->setIdealIssuer(ServiceHelper::IDEAL_BUNQ)->setInvoice('TEST_INVOICE')->perform();
// Get all static iDeal banks
$staticIdealBanks = IdealTransaction::getStaticIdealBanks();
/**
 *
 * WITH TRANSACTION CLASS
 *
 */
$oTransaction = new Transaction('CHANGEME', __DIR__ . '/../tests/test.pem');
$iDealResponse = $oTransaction->putInTestMode()->setAmountDebit(1.23)->setService(ServiceHelper::SERVICE_IDEAL)->addServiceParameter('issuer', ServiceHelper::IDEAL_BUNQ)->setInvoice('TEST_INVOICE')->perform();
var_dump($iDealResponse, $iDealResponse2);