PluginProbe
Fluent Forms – Customizable Contact Forms, Survey, Quiz, & Conversational Form Builder / 6.2.14
Fluent Forms – Customizable Contact Forms, Survey, Quiz, & Conversational Form Builder v6.2.14
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.14, at app/Modules/Payments/PaymentMethods/Stripe/API/SCA.php

95 lines 2.7 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 // was: the wrapper's default POST, which on this URL is Stripe's update endpoint, not retrieve
62 $response = ApiRequest::request($args, 'payment_intents/'.$intentId, 'GET');
63
64 return static::processResponse($response);
65 }
66
67 public static function confirmPayment($intendId, $args, $formId)
68 {
69 $secretKey = apply_filters_deprecated(
70 'fluentform-payment_stripe_secret_key',
71 [
72 StripeSettings::getSecretKey($formId),
73 $formId
74 ],
75 FLUENTFORM_FRAMEWORK_UPGRADE,
76 'fluentform/payment_stripe_secret_key',
77 'Use fluentform/payment_stripe_secret_key instead of fluentform-payment_stripe_secret_key.'
78 );
79
80 $secretKey = apply_filters('fluentform/payment_stripe_secret_key', $secretKey, $formId);
81
82 ApiRequest::set_secret_key($secretKey);
83
84 $argsDefault = [
85 'payment_method' => ''
86 ];
87
88 $args = wp_parse_args($args, $argsDefault);
89
90 $response = ApiRequest::request($args, 'payment_intents/' . $intendId . '/confirm');
91
92 return static::processResponse($response);
93 }
94 }
95