give
/
src
/
PaymentGateways
/
Gateways
/
Stripe
/
StripePaymentElementGateway
/
DataTransferObjects
/
StripeGatewayData.php
give
/
src
/
PaymentGateways
/
Gateways
/
Stripe
/
StripePaymentElementGateway
/
DataTransferObjects
Last commit date
StripeGatewayData.php
2 years ago
StripePaymentIntentData.php
1 year ago
StripeGatewayData.php
40 lines
| 1 | <?php |
| 2 | |
| 3 | namespace Give\PaymentGateways\Gateways\Stripe\StripePaymentElementGateway\DataTransferObjects; |
| 4 | |
| 5 | class StripeGatewayData |
| 6 | { |
| 7 | /** |
| 8 | * @var string |
| 9 | */ |
| 10 | public $stripeConnectedAccountId; |
| 11 | /** |
| 12 | * @var string |
| 13 | */ |
| 14 | public $successUrl; |
| 15 | /** |
| 16 | * @var string |
| 17 | */ |
| 18 | public $stripePaymentMethod; |
| 19 | /** |
| 20 | * @var bool |
| 21 | */ |
| 22 | public $stripePaymentMethodIsCreditCard; |
| 23 | |
| 24 | /** |
| 25 | * @since 3.0.0 |
| 26 | * |
| 27 | * @param array{stripeConnectedAccountKey: string, stripePaymentIntentId: string} $request |
| 28 | * @return StripeGatewayData |
| 29 | */ |
| 30 | public static function fromRequest(array $request): StripeGatewayData |
| 31 | { |
| 32 | $self = new self(); |
| 33 | $self->stripePaymentMethod = $request['stripePaymentMethod']; |
| 34 | $self->stripePaymentMethodIsCreditCard = $request['stripePaymentMethodIsCreditCard']; |
| 35 | $self->stripeConnectedAccountId = $request['stripeConnectedAccountId']; |
| 36 | $self->successUrl = rawurldecode($request['successUrl']); |
| 37 | |
| 38 | return $self; |
| 39 | } |
| 40 | } |