forked from impress-org/givewp
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Feature: add stateless donation confirmation receipt routing, templat…
…e, and implementation (impress-org#113) * feature: add donation receipt route, dto, view, controller, template, and rendering * feature: make receipt settings dynamic, add query params to route url, update generators and tests * refactor: update form logic to listen for redirects from gateways, update receipt styles to match classic form, get next gen test gateways to use new receipt route as faux redirect * chore: scaffold same page receipt redirect for stripe * chore: add cors to postData for offsite redirects * feature: add concept of originId for showing receipt with multiple forms on a page * refactor: add redirectReturnUrl to gatewayData via filter and replace individual gateway logic * refactor: use givewp-event and givewp-listenr for redirect query params * feature: add isEmbed, embedId and RouteListener * feature: add backwards compatability to new receipts for legacy forms * feature: filter sub gateway data * chore: add receipt detail classnames * refactor: use detail classname for icons * refactor: use new donation status label getter * reactor: use isReceiptIdValid * refactor: udpate filter method names
- Loading branch information
1 parent
8406fe7
commit c8b6d30
Showing
60 changed files
with
1,900 additions
and
245 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
25 changes: 25 additions & 0 deletions
25
src/NextGen/DonationForm/Actions/GenerateDonationConfirmationReceiptUrl.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
<?php | ||
|
||
namespace Give\NextGen\DonationForm\Actions; | ||
|
||
use Give\Donations\Models\Donation; | ||
use Give\NextGen\Framework\Routes\RouteListener; | ||
|
||
class GenerateDonationConfirmationReceiptUrl | ||
{ | ||
/** | ||
* @unreleased | ||
*/ | ||
public function __invoke(Donation $donation, string $originUrl, string $embedId = ''): string | ||
{ | ||
$routeListener = new RouteListener( | ||
'donation-completed', | ||
'show-donation-confirmation-receipt' | ||
); | ||
|
||
return $routeListener->toUrl($originUrl, [ | ||
'givewp-receipt-id' => $donation->purchaseKey, | ||
'givewp-embed-id' => $embedId, | ||
]); | ||
} | ||
} |
24 changes: 24 additions & 0 deletions
24
src/NextGen/DonationForm/Actions/GenerateDonationConfirmationReceiptViewRouteUrl.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
<?php | ||
|
||
namespace Give\NextGen\DonationForm\Actions; | ||
|
||
|
||
use Give\NextGen\Framework\Routes\Route; | ||
|
||
/** | ||
* @unreleased | ||
*/ | ||
class GenerateDonationConfirmationReceiptViewRouteUrl | ||
{ | ||
/** | ||
* @unreleased | ||
*/ | ||
public function __invoke(string $receiptId): string | ||
{ | ||
$args = [ | ||
'receipt-id' => $receiptId | ||
]; | ||
|
||
return esc_url_raw(Route::url('donation-confirmation-receipt-view', $args)); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.