diff --git a/example/transactions/mbway.php b/example/transactions/mbway.php new file mode 100644 index 00000000..f32d6822 --- /dev/null +++ b/example/transactions/mbway.php @@ -0,0 +1,21 @@ +method('mbway')->pay([ + 'invoice' => uniqid(), + 'amountDebit' => 10.10, +]); + +//Refund +$response = $buckaroo->method('mbway')->refund([ + 'invoice' => '', //Set invoice number of the transaction to refund + 'originalTransactionKey' => '', //Set transaction key of the transaction to refund + 'amountCredit' => 10.10, +]); diff --git a/src/PaymentMethods/MBWay/MBWay.php b/src/PaymentMethods/MBWay/MBWay.php new file mode 100644 index 00000000..89e74aaa --- /dev/null +++ b/src/PaymentMethods/MBWay/MBWay.php @@ -0,0 +1,30 @@ + ['in3old'], KlarnaPay::class => ['klarna', 'klarnain'], KlarnaKP::class => ['klarnakp'], + MBWay::class => ['mbway'], Surepay::class => ['surepay'], Subscriptions::class => ['subscriptions'], SEPA::class => ['sepadirectdebit', 'sepa'], diff --git a/tests/Buckaroo/Payments/MBWayTest.php b/tests/Buckaroo/Payments/MBWayTest.php new file mode 100644 index 00000000..dd7878ca --- /dev/null +++ b/tests/Buckaroo/Payments/MBWayTest.php @@ -0,0 +1,55 @@ +buckaroo->method('mbway')->pay([ + 'invoice' => uniqid(), + 'amountDebit' => 10.10, + ]); + + $this->assertTrue($response->isPendingProcessing()); + } + + /** + * @test + */ + public function it_creates_a_mbway_refund() + { + $response = $this->buckaroo->method('mbway')->refund([ + 'amountCredit' => 10, + 'invoice' => 'testinvoice 123', + 'description' => 'refund', + 'originalTransactionKey' => '2D04704995B74D679AACC59F87XXXXXX', + ]); + + $this->assertTrue($response->isFailed()); + } +}