# give/4.18.0/src/PaymentGateways/Gateways/Stripe/Actions/ValidatePaymentMethod.php

GiveWP – Donation Plugin and Fundraising Platform, version 4.18.0. 26 lines.

- Page: https://pluginprobe.com/plugins/give/4.18.0/code/src/PaymentGateways/Gateways/Stripe/Actions/ValidatePaymentMethod.php
- Raw: https://pluginprobe.com/plugins/give/4.18.0/raw/src/PaymentGateways/Gateways/Stripe/Actions/ValidatePaymentMethod.php
- Modified: 2022-03-31T22:56:06+00:00

Line numbers below start at 1. Link to a line or a range by appending a fragment to the
page URL, for example `https://pluginprobe.com/plugins/give/4.18.0/code/src/PaymentGateways/Gateways/Stripe/Actions/ValidatePaymentMethod.php#L10-L20`.

```php
<?php

namespace Give\PaymentGateways\Gateways\Stripe\Actions;

use Give\PaymentGateways\Gateways\Stripe\Exceptions\PaymentMethodException;
use Give\PaymentGateways\Gateways\Stripe\ValueObjects\PaymentMethod;

/**
 * @since 2.19.6 Do not extend removed WorkflowAction class.
 * @since 2.19.0
 */
class ValidatePaymentMethod
{
    /**
     * @since 2.19.0
     * @param PaymentMethod $paymentMethod
     * @throws PaymentMethodException
     */
    public function __invoke( PaymentMethod $paymentMethod )
    {
        if( ! $paymentMethod->id() ) {
            throw new PaymentMethodException('Payment Method Not Found');
        }
    }
}

```
