PluginProbe
Fluent Forms – Customizable Contact Forms, Survey, Quiz, & Conversational Form Builder / 6.2.2
Fluent Forms – Customizable Contact Forms, Survey, Quiz, & Conversational Form Builder v6.2.2
6.2.14 6.2.13 6.2.12 6.2.10 6.2.11 6.2.9 6.2.8 6.2.7 6.2.6 6.2.5 6.2.4 6.2.3 6.2.2 3.6.22 3.6.31 3.6.40 3.6.41 3.6.42 3.6.50 3.6.51 3.6.60 3.6.61 3.6.62 3.6.64 3.6.65 All 196 releases
fluentform / app / Modules / Payments / PaymentMethods / Stripe / API / SCA.php

SCA.php in Fluent Forms – Customizable Contact Forms, Survey, Quiz, & Conversational Form Builder 6.2.2, at app/Modules/Payments/PaymentMethods/Stripe/API/SCA.php

94 lines 2.6 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2
3 namespace FluentForm\App\Modules\Payments\PaymentMethods\Stripe\API;
4
5 use FluentForm\App\Modules\Payments\PaymentMethods\Stripe\StripeSettings;
6
7 if (!defined('ABSPATH')) {
8 exit;
9 }
10
11 class SCA
12 {
13 use RequestProcessor;
14
15 public static function createPaymentIntent($args, $formId)
16 {
17 $argsDefault = [
18 'confirmation_method' => 'manual',
19 'confirm' => 'true'
20 ];
21
22 $args = wp_parse_args($args, $argsDefault);
23
24 $secretKey = apply_filters_deprecated(
25 'fluentform-payment_stripe_secret_key',
26 [
27 StripeSettings::getSecretKey($formId),
28 $formId
29 ],
30 FLUENTFORM_FRAMEWORK_UPGRADE,
31 'fluentform/payment_stripe_secret_key',
32 'Use fluentform/payment_stripe_secret_key instead of fluentform-payment_stripe_secret_key.'
33 );
34
35 $secretKey = apply_filters('fluentform/payment_stripe_secret_key', $secretKey, $formId);
36
37 ApiRequest::set_secret_key($secretKey);
38
39 $response = ApiRequest::request($args, 'payment_intents');
40
41 return static::processResponse($response);
42 }
43
44 public static function retrievePaymentIntent($intentId, $args, $formId)
45 {
46 $secretKey = apply_filters_deprecated(
47 'fluentform-payment_stripe_secret_key',
48 [
49 StripeSettings::getSecretKey($formId),
50 $formId
51 ],
52 FLUENTFORM_FRAMEWORK_UPGRADE,
53 'fluentform/payment_stripe_secret_key',
54 'Use fluentform/payment_stripe_secret_key instead of fluentform-payment_stripe_secret_key.'
55 );
56
57 $secretKey = apply_filters('fluentform/payment_stripe_secret_key', $secretKey, $formId);
58
59 ApiRequest::set_secret_key($secretKey);
60
61 $response = ApiRequest::request($args, 'payment_intents/'.$intentId);
62
63 return static::processResponse($response);
64 }
65
66 public static function confirmPayment($intendId, $args, $formId)
67 {
68 $secretKey = apply_filters_deprecated(
69 'fluentform-payment_stripe_secret_key',
70 [
71 StripeSettings::getSecretKey($formId),
72 $formId
73 ],
74 FLUENTFORM_FRAMEWORK_UPGRADE,
75 'fluentform/payment_stripe_secret_key',
76 'Use fluentform/payment_stripe_secret_key instead of fluentform-payment_stripe_secret_key.'
77 );
78
79 $secretKey = apply_filters('fluentform/payment_stripe_secret_key', $secretKey, $formId);
80
81 ApiRequest::set_secret_key($secretKey);
82
83 $argsDefault = [
84 'payment_method' => ''
85 ];
86
87 $args = wp_parse_args($args, $argsDefault);
88
89 $response = ApiRequest::request($args, 'payment_intents/' . $intendId . '/confirm');
90
91 return static::processResponse($response);
92 }
93 }
94