PluginProbe
Fluent Forms – Customizable Contact Forms, Survey, Quiz, & Conversational Form Builder / trunk
Fluent Forms – Customizable Contact Forms, Survey, Quiz, & Conversational Form Builder vtrunk
6.2.15 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 All 197 releases
fluentform / app / Modules / Payments / PaymentMethods / Stripe / API / Invoice.php

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

58 lines 1.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 Invoice
12 {
13 use RequestProcessor;
14
15 public static function createItem($item, $formId)
16 {
17 $secretKey = apply_filters_deprecated(
18 'fluentform-payment_stripe_secret_key',
19 [
20 StripeSettings::getSecretKey($formId),
21 $formId
22 ],
23 FLUENTFORM_FRAMEWORK_UPGRADE,
24 'fluentform/payment_stripe_secret_key',
25 'Use fluentform/payment_stripe_secret_key instead of fluentform-payment_stripe_secret_key.'
26 );
27 $secretKey = apply_filters('fluentform/payment_stripe_secret_key', $secretKey, $formId);
28
29 ApiRequest::set_secret_key($secretKey);
30
31 $response = ApiRequest::request($item, 'invoiceitems', 'POST');
32
33 return static::processResponse($response);
34 }
35
36 public static function retrieve($invoiceId, $formId, $args = [])
37 {
38 $secretKey = apply_filters_deprecated(
39 'fluentform-payment_stripe_secret_key',
40 [
41 StripeSettings::getSecretKey($formId),
42 $formId
43 ],
44 FLUENTFORM_FRAMEWORK_UPGRADE,
45 'fluentform/payment_stripe_secret_key',
46 'Use fluentform/payment_stripe_secret_key instead of fluentform-payment_stripe_secret_key.'
47 );
48
49 $secretKey = apply_filters('fluentform/payment_stripe_secret_key', $secretKey, $formId);
50
51 ApiRequest::set_secret_key($secretKey);
52
53 $response = ApiRequest::request($args, 'invoices/' . $invoiceId, 'POST');
54
55 return static::processResponse($response);
56 }
57 }
58