Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add accessor field for payment status
- it was hard to look up the payment status through the payment specific fields - enable easier lookup This commit can be reverted when doing squizlabs/PHP_CodeSniffer#3479
- Loading branch information
Showing
18 changed files
with
158 additions
and
143 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
<?php | ||
|
||
declare( strict_types = 1 ); | ||
|
||
namespace WMDE\Fundraising\PaymentContext\Domain\Model; | ||
|
||
trait LegacyBookingStatusTrait { | ||
|
||
abstract public function isBooked(): bool; | ||
|
||
protected function getLegacyPaymentStatus(): string { | ||
if ( $this->isBooked() ) { return LegacyPaymentStatus::EXTERNAL_BOOKED->value; | ||
} | ||
return LegacyPaymentStatus::EXTERNAL_INCOMPLETE->value; | ||
} | ||
|
||
} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
<?php | ||
// phpcs:ignoreFile -- Until phpcs has 8.1 enum support, see https://github.com/squizlabs/PHP_CodeSniffer/issues/3479 | ||
declare( strict_types = 1 ); | ||
|
||
namespace WMDE\Fundraising\PaymentContext\Domain\Model; | ||
|
||
/** | ||
* These values are a mixture of payment-type dependent status and | ||
* actions (booking, cancelling) that were performed on the payment. | ||
* | ||
* The status will be stored in the donation (which may add another status for moderation). | ||
* | ||
* When https://phabricator.wikimedia.org/T281853 is done, you should delete this class and all code that uses it. | ||
*/ | ||
enum LegacyPaymentStatus: string { | ||
// direct debit | ||
case DIRECT_DEBIT = 'N'; | ||
|
||
// bank transfer | ||
case BANK_TRANSFER = 'Z'; | ||
|
||
// external payment, not notified by payment provider | ||
case EXTERNAL_INCOMPLETE = 'X'; | ||
|
||
// external payment, notified by payment provider | ||
case EXTERNAL_BOOKED = 'B'; | ||
case CANCELLED = 'D'; | ||
} |
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 was deleted.
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
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.