Skip to content

Commit

Permalink
Update metadata completion_url redirection and add Pest watch plugin
Browse files Browse the repository at this point in the history
  • Loading branch information
damms005 committed Sep 10, 2024
1 parent 56d1885 commit c2669d8
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 2 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ Upon user confirmation of transaction, user is redirected to the appropriate pay
When user is done with the transaction on the payment handler's end (either successfully paid, or declined transaction), user is redirected
back to `/payment/completed` (`route('payment.finished.callback_url')` provided by this package) .

> If the `Payment` has [`metadata`](#step-1) (supplied with the payment initiation request), with a key named `completion_url`, the user will be redirected to that URL instead on successful payment, with the transaction reference included as transaction_reference in the URL query string.
> If the `Payment` has [`metadata`](#step-1) (supplied with the payment initiation request), with a key named `completion_url`, the user will be redirected to that URL instead on successful payment, with the transaction reference included as `transaction_reference` in the URL query string.
> If there are additional steps you want to take upon successful payment, listen for `SuccessfulLaravelMultipayPaymentEvent`. It will be fired whenever a successful payment occurs, with its corresponding `Payment` model.
Expand Down
1 change: 1 addition & 0 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@
"orchestra/testbench": "^8.0",
"pestphp/pest": "^2.0",
"pestphp/pest-plugin-laravel": "^2.0",
"pestphp/pest-plugin-watch": "^2.1",
"vimeo/psalm": "^5.0"
},
"autoload": {
Expand Down
2 changes: 1 addition & 1 deletion tests/CustomPaymentRedirectTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ function () use ($payment) {
->put('RRR', 12345)
->toArray()
)
->assertRedirect('https://foo.bar');
->assertRedirect('https://foo.bar?transaction_reference=' . $payment->transaction_reference);
});

it('redirects to default page when payment completion endpoint is not set', function () {
Expand Down

0 comments on commit c2669d8

Please sign in to comment.