CreateCheckoutSession.php
4 years ago
CreatePaymentIntent.php
4 years ago
GetOrCreateStripeCustomer.php
4 years ago
GetPaymentMethodFromRequest.php
4 years ago
SaveDonationSummary.php
4 years ago
UpdateStripeAccountStatementDescriptor.php
4 years ago
ValidatePaymentMethod.php
4 years ago
ValidatePaymentMethod.php
26 lines
| 1 | <?php |
| 2 | |
| 3 | namespace Give\PaymentGateways\Gateways\Stripe\Actions; |
| 4 | |
| 5 | use Give\PaymentGateways\Gateways\Stripe\Exceptions\PaymentMethodException; |
| 6 | use Give\PaymentGateways\Gateways\Stripe\ValueObjects\PaymentMethod; |
| 7 | |
| 8 | /** |
| 9 | * @since 2.19.6 Do not extend removed WorkflowAction class. |
| 10 | * @since 2.19.0 |
| 11 | */ |
| 12 | class ValidatePaymentMethod |
| 13 | { |
| 14 | /** |
| 15 | * @since 2.19.0 |
| 16 | * @param PaymentMethod $paymentMethod |
| 17 | * @throws PaymentMethodException |
| 18 | */ |
| 19 | public function __invoke( PaymentMethod $paymentMethod ) |
| 20 | { |
| 21 | if( ! $paymentMethod->id() ) { |
| 22 | throw new PaymentMethodException('Payment Method Not Found'); |
| 23 | } |
| 24 | } |
| 25 | } |
| 26 |