PluginProbe
FluentCart A New Era of eCommerce – Faster, Lighter, and Simpler / 1.5.1
FluentCart A New Era of eCommerce – Faster, Lighter, and Simpler v1.5.1
1.6.5 1.6.4 1.6.3 1.6.2 1.6.1 1.6.0 1.5.4 1.5.5 1.5.3 1.5.2 1.5.1 1.5.0 1.4.2 1.4.1 1.4.0 1.3.28 1.3.27 1.3.26 1.3.25 1.3.23 1.3.22 1.3.21 1.3.20 1.3.19 trunk All 48 releases
fluent-cart / app / Modules / PaymentMethods / Core / AbstractSubscriptionModule.php

AbstractSubscriptionModule.php in FluentCart A New Era of eCommerce – Faster, Lighter, and Simpler 1.5.1, at app/Modules/PaymentMethods/Core/AbstractSubscriptionModule.php

96 lines 2.8 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2
3 namespace FluentCart\App\Modules\PaymentMethods\Core;
4
5 use FluentCart\App\Models\Subscription;
6
7 abstract class AbstractSubscriptionModule
8 {
9 /**
10 * @throws \Exception
11 */
12 public function fetchSubscription($data, $order, $subscription)
13 {
14 throw new \Exception(esc_html__('Subscription fetching not available for this method!', 'fluent-cart'), 404);
15 }
16
17 /**
18 * @throws \Exception
19 */
20 public function cardUpdate($data, $subscriptionId)
21 {
22 throw new \Exception(esc_html__('No valid payment method to update!', 'fluent-cart'), 404);
23 }
24
25 /**
26 * @throws \Exception
27 */
28 public function switchPaymentMethod($data, $subscriptionId)
29 {
30 throw new \Exception(esc_html__('No valid payment method to switch!', 'fluent-cart'), 404);
31 }
32
33 /**
34 * @throws \Exception
35 */
36 public function reactivateSubscription($data, $subscriptionId)
37 {
38 throw new \Exception(esc_html__('No valid payment method to reactivate!', 'fluent-cart'), 404);
39 }
40
41 /**
42 * @throws \Exception
43 */
44 public function pauseSubscription($data, $order, $subscription)
45 {
46 throw new \Exception(esc_html__('No valid payment method to pause!', 'fluent-cart'), 404);
47 }
48
49 /**
50 * @throws \Exception
51 */
52 public function resumeSubscription($data, $order, $subscription)
53 {
54 throw new \Exception(esc_html__('No valid payment method to resume!', 'fluent-cart'), 404);
55 }
56
57 public function cancel($vendorSubscriptionId, $args = [])
58 {
59 return new \WP_Error(
60 'not_implemented',
61 esc_html__('Cancel subscription is not implemented for this payment method.', 'fluent-cart')
62 );
63 }
64
65 /**
66 * @throws \Exception
67 */
68 public function cancelSubscription($data, $order, $subscription)
69 {
70 throw new \Exception(esc_html__('No valid payment method to cancel!', 'fluent-cart'), 404);
71 }
72
73 public function cancelOnPlanChange($vendorSubscriptionId, $parentOrderId, $subscriptionId, $reason)
74 {
75 // cancel the subscription on the vendor side, implement on the child class
76 }
77
78 public function cancelAutoRenew($subscription)
79 {
80 // cancel the subscription on the vendor side, implement on the child class
81 }
82
83 public function cancelOnSwitchPaymentMethod($currentVendorSubscriptionId, $parentOrderId, $vendorSubscriptionId, $newPaymentMethod, $reason)
84 {
85 // cancel the subscription on the vendor side, implement on the child class
86 }
87
88 public function reSyncSubscriptionFromRemote(Subscription $subscriptionModel)
89 {
90 return new \WP_Error(
91 'not_implemented',
92 esc_html__('Re-sync subscription from remote is not implemented for this payment method.', 'fluent-cart')
93 );
94 }
95 }
96