diff --git a/example/transactions/tinka.php b/example/transactions/tinka.php deleted file mode 100644 index deb26f2a..00000000 --- a/example/transactions/tinka.php +++ /dev/null @@ -1,81 +0,0 @@ -method('tinka')->pay([ - 'amountDebit' => 3.5, - 'order' => uniqid(), - 'invoice' => uniqid(), - 'description' => 'This is a test order', - 'paymentMethod' => 'Credit', - 'deliveryMethod' => 'Locker', - 'deliveryDate' => '2030-01-01', - 'articles' => [ - [ - 'type' => 1, - 'description' => 'Blue Toy Car', - 'brand' => 'Ford Focus', - 'manufacturer' => 'Ford', - 'color' => 'Red', - 'size' => 'Small', - 'quantity' => '1', - 'price' => '3.5', - 'unitCode' => 'test', - ], - ], - 'customer' => [ - 'gender' => Gender::MALE, - 'firstName' => 'Buck', - 'lastName' => 'Aroo', - 'initials' => 'BA', - 'birthDate' => '1990-01-01', - ], - 'billing' => [ - 'recipient' => [ - 'lastNamePrefix' => 'the', - ], - 'email' => 'billingcustomer@buckaroo.nl', - 'phone' => [ - 'mobile' => '0109876543', - ], - 'address' => [ - 'street' => 'Hoofdstraat', - 'houseNumber' => '80', - 'houseNumberAdditional' => 'A', - 'zipcode' => '8441EE', - 'city' => 'Heerenveen', - 'country' => 'NL', - ], - ], - 'shipping' => [ - 'recipient' => [ - 'lastNamePrefix' => 'the', - ], - 'email' => 'billingcustomer@buckaroo.nl', - 'phone' => [ - 'mobile' => '0109876543', - ], - 'address' => [ - 'street' => 'Hoofdstraat', - 'houseNumber' => '80', - 'houseNumberAdditional' => 'A', - 'zipcode' => '8441EE', - 'city' => 'Heerenveen', - 'country' => 'NL', - ], - ], -]); - -//Refund -$response = $buckaroo->method('tinka')->refund([ - 'amountCredit' => 10, - 'invoice' => 'testinvoice 123', - 'originalTransactionKey' => '2D04704995B74D679AACC59F87XXXXXX', -]); diff --git a/phpcs.xml b/phpcs.xml index e60e272d..e3e1b7c2 100644 --- a/phpcs.xml +++ b/phpcs.xml @@ -16,6 +16,7 @@ src/PaymentMethods/iDeal/iDeal.php src/PaymentMethods/iDealQR/iDealQR.php src/PaymentMethods/iDin/iDin.php + src/PaymentMethods/iDealProcessing/iDealProcessing.php diff --git a/src/PaymentMethods/PaymentMethodFactory.php b/src/PaymentMethods/PaymentMethodFactory.php index f07890ba..325405e2 100644 --- a/src/PaymentMethods/PaymentMethodFactory.php +++ b/src/PaymentMethods/PaymentMethodFactory.php @@ -29,7 +29,6 @@ use Buckaroo\PaymentMethods\iDeal\iDeal; use Buckaroo\PaymentMethods\iDealProcessing\iDealProcessing; use Buckaroo\PaymentMethods\MBWay\MBWay; -use Buckaroo\PaymentMethods\Tinka\Tinka; use Buckaroo\Exceptions\BuckarooException; use Buckaroo\PaymentMethods\Alipay\Alipay; use Buckaroo\PaymentMethods\In3Old\In3Old; @@ -115,7 +114,6 @@ class PaymentMethodFactory ExternalPayment::class => ['externalpayment'], Emandates::class => ['emandates'], Sofort::class => ['sofort', 'sofortueberweisung'], - Tinka::class => ['tinka'], Marketplaces::class => ['marketplaces'], NoServiceSpecifiedPayment::class => ['noservice'], Payconiq::class => ['payconiq'], diff --git a/src/PaymentMethods/Tinka/Models/Article.php b/src/PaymentMethods/Tinka/Models/Article.php deleted file mode 100644 index 1ad39f07..00000000 --- a/src/PaymentMethods/Tinka/Models/Article.php +++ /dev/null @@ -1,26 +0,0 @@ - [ - 'groupType' => 'Article', - ], - ]; - - /** - * @param $billing - * @return Recipient - */ - public function billing($billing = null) - { - if (is_array($billing)) - { - $this->billingRecipient = new Recipient('Billing', $billing); - $this->shippingRecipient = new Recipient('Billing', $billing); - } - - return $this->billingRecipient; - } - - /** - * @param $shipping - * @return Recipient - */ - public function shipping($shipping = null) - { - if (is_array($shipping)) - { - $this->shippingRecipient = new Recipient('Shipping', $shipping); - } - - return $this->shippingRecipient; - } - - /** - * @param $customer - * @return CustomerAdapter - */ - public function customer($customer = null) - { - if (is_array($customer)) - { - $this->customer = new CustomerAdapter(new Person($customer)); - } - - return $this->customer; - } - - /** - * @param array|null $articles - * @return array - */ - public function articles(?array $articles = null) - { - if (is_array($articles)) - { - foreach ($articles as $article) - { - $this->articles[] = new ArticleAdapter(new Article($article)); - } - } - - return $this->articles; - } -} diff --git a/src/PaymentMethods/Tinka/Models/Recipient.php b/src/PaymentMethods/Tinka/Models/Recipient.php deleted file mode 100644 index b266423a..00000000 --- a/src/PaymentMethods/Tinka/Models/Recipient.php +++ /dev/null @@ -1,132 +0,0 @@ -type = $type; - - parent::__construct($values); - } - - /** - * @param $recipient - * @return CustomerAdapter - */ - public function recipient($recipient = null) - { - if (is_array($recipient)) - { - $this->recipient = new CustomerAdapter(new Person($recipient)); - } - - return $this->recipient; - } - - /** - * @param $address - * @return AddressAdapter - */ - public function address($address = null) - { - if (is_array($address)) - { - $this->address = new AddressAdapter(new Address($address)); - } - - return $this->address; - } - - /** - * @param $phone - * @return PhoneAdapter - */ - public function phone($phone = null) - { - if (is_array($phone)) - { - $this->phone = new PhoneAdapter(new Phone($phone)); - } - - return $this->phone; - } - - /** - * @param $email - * @return Email - */ - public function email($email = null) - { - if (is_string($email)) - { - $this->email = new Email($email); - } - - return $this->email; - } - - /** - * @param string $key - * @return string|null - */ - public function getGroupType(string $key): ?string - { - return $this->type . 'Customer'; - } -} diff --git a/src/PaymentMethods/Tinka/Service/ParameterKeys/AddressAdapter.php b/src/PaymentMethods/Tinka/Service/ParameterKeys/AddressAdapter.php deleted file mode 100644 index bd316ace..00000000 --- a/src/PaymentMethods/Tinka/Service/ParameterKeys/AddressAdapter.php +++ /dev/null @@ -1,32 +0,0 @@ - 'StreetNumber', - 'houseNumberAdditional' => 'StreetNumberAdditional', - 'zipcode' => 'PostalCode', - ]; -} diff --git a/src/PaymentMethods/Tinka/Service/ParameterKeys/ArticleAdapter.php b/src/PaymentMethods/Tinka/Service/ParameterKeys/ArticleAdapter.php deleted file mode 100644 index 79f51acc..00000000 --- a/src/PaymentMethods/Tinka/Service/ParameterKeys/ArticleAdapter.php +++ /dev/null @@ -1,30 +0,0 @@ - 'UnitGrossPrice', - ]; -} diff --git a/src/PaymentMethods/Tinka/Service/ParameterKeys/CustomerAdapter.php b/src/PaymentMethods/Tinka/Service/ParameterKeys/CustomerAdapter.php deleted file mode 100644 index f868f4e8..00000000 --- a/src/PaymentMethods/Tinka/Service/ParameterKeys/CustomerAdapter.php +++ /dev/null @@ -1,31 +0,0 @@ - 'PrefixLastName', - 'birthDate' => 'DateOfBirth', - ]; -} diff --git a/src/PaymentMethods/Tinka/Service/ParameterKeys/PhoneAdapter.php b/src/PaymentMethods/Tinka/Service/ParameterKeys/PhoneAdapter.php deleted file mode 100644 index e9638788..00000000 --- a/src/PaymentMethods/Tinka/Service/ParameterKeys/PhoneAdapter.php +++ /dev/null @@ -1,30 +0,0 @@ - 'Phone' - ]; -} diff --git a/src/PaymentMethods/Tinka/Tinka.php b/src/PaymentMethods/Tinka/Tinka.php deleted file mode 100644 index 0363ae78..00000000 --- a/src/PaymentMethods/Tinka/Tinka.php +++ /dev/null @@ -1,37 +0,0 @@ -payload)); - } -} diff --git a/tests/Buckaroo/Payments/TinkaTest.php b/tests/Buckaroo/Payments/TinkaTest.php deleted file mode 100644 index e4689423..00000000 --- a/tests/Buckaroo/Payments/TinkaTest.php +++ /dev/null @@ -1,118 +0,0 @@ -buckaroo->method('tinka')->pay($this->getPaymentPayload()); - - $this->assertTrue($response->isPendingProcessing()); - } - - /** - * @test - */ - public function it_creates_a_tinka_refund() - { - $response = $this->buckaroo->method('tinka')->refund([ - 'amountCredit' => 10, - 'invoice' => 'testinvoice 123', - 'originalTransactionKey' => '2D04704995B74D679AACC59F87XXXXXX', - ]); - - $this->assertTrue($response->isFailed()); - } - - private function getPaymentPayload(): array - { - return [ - 'amountDebit' => 3.5, - 'order' => uniqid(), - 'invoice' => uniqid(), - 'description' => 'This is a test order', - 'paymentMethod' => 'Credit', - 'deliveryMethod' => 'Locker', - 'deliveryDate' => '2030-01-01', - 'articles' => [ - [ - 'type' => 1, - 'description' => 'Blue Toy Car', - 'brand' => 'Ford Focus', - 'manufacturer' => 'Ford', - 'color' => 'Red', - 'size' => 'Small', - 'quantity' => '1', - 'price' => '3.5', - 'unitCode' => 'test', - ], - ], - 'customer' => [ - 'gender' => Gender::MALE, - 'firstName' => 'Buck', - 'lastName' => 'Aroo', - 'initials' => 'BA', - 'birthDate' => '1990-01-01', - ], - 'billing' => [ - 'recipient' => [ - 'lastNamePrefix' => 'the', - ], - 'email' => 'billingcustomer@buckaroo.nl', - 'phone' => [ - 'mobile' => '0109876543', - ], - 'address' => [ - 'street' => 'Hoofdstraat', - 'houseNumber' => '80', - 'houseNumberAdditional' => 'A', - 'zipcode' => '8441EE', - 'city' => 'Heerenveen', - 'country' => 'NL', - ], - ], - 'shipping' => [ - 'recipient' => [ - 'lastNamePrefix' => 'the', - ], - 'email' => 'billingcustomer@buckaroo.nl', - 'phone' => [ - 'mobile' => '0109876543', - ], - 'address' => [ - 'street' => 'Hoofdstraat', - 'houseNumber' => '80', - 'houseNumberAdditional' => 'A', - 'zipcode' => '8441EE', - 'city' => 'Heerenveen', - 'country' => 'NL', - ], - ], - ]; - } -}