Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
105 changes: 1 addition & 104 deletions example/transactions/billink.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
$buckaroo = new BuckarooClient($_ENV['BPE_WEBSITE_KEY'], $_ENV['BPE_SECRET_KEY']);

//Also accepts json
//Pay
//Pay - Direct payment (combined flow)
Comment thread
vildanbina marked this conversation as resolved.
$response = $buckaroo->method('billink')->pay([
'amountDebit' => 50.30,
'order' => uniqid(),
Expand Down Expand Up @@ -78,109 +78,6 @@
],
]);

//Authorize
$response = $buckaroo->method('billink')->authorize([
'amountDebit' => 50.30,
'order' => uniqid(),
'invoice' => uniqid(),
'trackAndTrace' => 'TR0F123456789',
'vATNumber' => '2',
'billing' => [
'recipient' => [
'category' => 'B2B',
'careOf' => 'John Smith',
'title' => 'Female',
'initials' => 'JD',
'firstName' => 'John',
'lastName' => 'Do',
'birthDate' => '01-01-1990',
'chamberOfCommerce' => 'TEST',
],
'address' => [
'street' => 'Hoofdstraat',
'houseNumber' => '13',
'houseNumberAdditional' => 'a',
'zipcode' => '1234AB',
'city' => 'Heerenveen',
'country' => 'NL',
],
'phone' => [
'mobile' => '0698765433',
'landline' => '0109876543',
],
'email' => 'test@buckaroo.nl',
],
'shipping' => [
'recipient' => [
'category' => 'B2C',
'careOf' => 'John Smith',
'title' => 'Male',
'initials' => 'JD',
'firstName' => 'John',
'lastName' => 'Do',
'birthDate' => '1990-01-01',
],
'address' => [
'street' => 'Kalverstraat',
'houseNumber' => '13',
'houseNumberAdditional' => 'b',
'zipcode' => '4321EB',
'city' => 'Amsterdam',
'country' => 'NL',
],
],
'articles' => [
[
'identifier' => 'Articlenumber1',
'description' => 'Blue Toy Car',
'vatPercentage' => '21',
'quantity' => '2',
'price' => '20.10',
'priceExcl' => 5,
],
[
'identifier' => 'Articlenumber2',
'description' => 'Red Toy Car',
'vatPercentage' => '21',
'quantity' => '1',
'price' => 10.10,
'priceExcl' => 5,
],
],
]);

//Capture
$response = $buckaroo->method('billink')->capture([
'originalTransactionKey' => '74AD098CCFAA4F739FE16279B5059B6B', //Set transaction key of the transaction to capture
'invoice' => '62905fa2650f4', //Set invoice id
'amountDebit' => 50.30, //set amount to capture
'articles' => [
[
'identifier' => 'Articlenumber1',
'description' => 'Blue Toy Car',
'vatPercentage' => '21',
'quantity' => '2',
'price' => '20.10',
'priceExcl' => 5,
],
[
'identifier' => 'Articlenumber2',
'description' => 'Red Toy Car',
'vatPercentage' => '21',
'quantity' => '1',
'price' => 10.10,
'priceExcl' => 5,
],
],
]);

//Cancel authorize
$response = $buckaroo->method('billink')->cancelAuthorize([
'originalTransactionKey' => '74AD098CCFAA4F739FE16279B5059B6B',
//Set transaction key of the authorized transaction to cancel
'invoice' => '62905fa2650f4', //Set invoice id
'AmountCredit' => 10, //set amount to capture
]);

//Refund
$response = $buckaroo->method('billink')->refund([
Expand Down
43 changes: 0 additions & 43 deletions src/PaymentMethods/Billink/Billink.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@
namespace Buckaroo\PaymentMethods\Billink;

use Buckaroo\Models\Model;
use Buckaroo\PaymentMethods\Billink\Models\Capture;
use Buckaroo\PaymentMethods\Billink\Models\Pay;
use Buckaroo\PaymentMethods\Billink\Models\Refund;
use Buckaroo\PaymentMethods\PayablePaymentMethod;
Expand All @@ -42,46 +41,4 @@ public function pay(?Model $model = null): TransactionResponse
{
return parent::pay($model ?? new Pay($this->payload));
}

/**
* @return TransactionResponse
*/
public function authorize(): TransactionResponse
{
$pay = new Pay($this->payload);

$this->setPayPayload();

$this->setServiceList('Authorize', $pay);

return $this->postRequest();
}

/**
* @return TransactionResponse
*/
public function capture(): TransactionResponse
{
$capture = new Capture($this->payload);

$this->setPayPayload();

$this->setServiceList('Capture', $capture);

return $this->postRequest();
}

/**
* @return TransactionResponse
*/
public function cancelAuthorize(): TransactionResponse
{
$cancel = new Refund($this->payload);

$this->setPayPayload();

$this->setServiceList('CancelAuthorize', $cancel);

return $this->postRequest();
}
}
57 changes: 0 additions & 57 deletions src/PaymentMethods/Billink/Models/Capture.php

This file was deleted.

62 changes: 0 additions & 62 deletions tests/Buckaroo/Payments/BillinkTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -41,68 +41,6 @@ public function it_creates_a_billink_payment()
$this->assertTrue($response->isSuccess());
}

/**
* @test
*/
public function it_creates_a_billink_authorize()
{
$response = $this->buckaroo->method('billink')->authorize($this->getPayPayload(
[
'trackAndTrace' => 'TR0F123456789',
'vatNumber' => '2',
'articles' => $this->getArticlesPayload(),
]
));

self::$authorizeTransactionKey = $response->getTransactionKey();

$this->assertTrue($response->isSuccess());
}


// Not able to test (issue with amount) - Validation failure
// /**
// * @test
// */
// public function it_creates_a_billink_cancel_authorize()
// {
// $response = $this->buckaroo->method('billink')->cancelAuthorize($this->getRefundPayload([
// 'originalTransactionKey' => self::$authorizeTransactionKey,
// 'amountCredit' => 100.30,
// ]));


// $this->assertTrue($response->isSuccess());
// }

/**
* @test
*/
public function it_creates_a_billink_capture()
{
$response = $this->buckaroo->method('billink')->authorize($this->getPayPayload(
[
'trackAndTrace' => '12345678',
'vatNumber' => '2',
'articles' => $this->getArticlesPayload(),
]
));

$this->assertTrue($response->isSuccess());

sleep(2);
$response = $this->buckaroo->method('billink')->capture($this->getPayPayload(
[
'originalTransactionKey' => $response->getTransactionKey(),
'trackAndTrace' => '12345678',
'vatNumber' => '2',
'articles' => $this->getArticlesPayload(),
]
));

$this->assertTrue($response->isSuccess());
}

/**
* @test
*/
Expand Down