diff --git a/example/transactions/externalPayment.php b/example/transactions/externalPayment.php new file mode 100644 index 0000000..85a881f --- /dev/null +++ b/example/transactions/externalPayment.php @@ -0,0 +1,19 @@ +method('externalPayment')->pay([ + 'invoice' => uniqid(), + 'amountDebit' => 10.10, + 'channel' => 'BackOffice' +]); + +$buckaroo->method('externalPayment')->refund([ + 'amountCredit' => 10, + 'invoice' => 'testinvoice 123', + 'originalTransactionKey' => $response->getTransactionKey(), +]); \ No newline at end of file diff --git a/src/PaymentMethods/ExternalPayment/ExternalPayment.php b/src/PaymentMethods/ExternalPayment/ExternalPayment.php new file mode 100644 index 0000000..f10e6d0 --- /dev/null +++ b/src/PaymentMethods/ExternalPayment/ExternalPayment.php @@ -0,0 +1,30 @@ + ['payperemail'], PaymentInitiation::class => ['paymentinitiation','paybybank'], EPS::class => ['eps'], + ExternalPayment::class => ['externalpayment'], Emandates::class => ['emandates'], Sofort::class => ['sofort', 'sofortueberweisung'], Tinka::class => ['tinka'], diff --git a/tests/Buckaroo/Payments/ExternalPaymentTest.php b/tests/Buckaroo/Payments/ExternalPaymentTest.php new file mode 100644 index 0000000..f2994fa --- /dev/null +++ b/tests/Buckaroo/Payments/ExternalPaymentTest.php @@ -0,0 +1,56 @@ +buckaroo->method('externalPayment')->pay([ + 'invoice' => uniqid(), + 'amountDebit' => 11.10, + 'channel' => 'BACKOFFICE' + ]); + + $this->assertTrue($response->isSuccess()); + } + + /** + * @test + */ + public function it_creates_a_external_payment_refund() + { + $response = $this->buckaroo->method('externalPayment')->refund([ + 'amountCredit' => 10, + 'invoice' => 'testinvoice 123', + 'description' => 'refund', + 'originalTransactionKey' => '2D04704995B74D679AACC59F87XXXXXX', + ]); + + $this->assertTrue($response->isFailed()); + } +}