| @@ -28,8 +28,9 @@ | ||
| 28 | 28 | public const PAYMENT_FAILED = 'failed'; |
| 29 | 29 | public const PAYMENT_REFUNDED = 'refunded'; |
| 30 | 30 | public const PAYMENT_PARTIALLY_REFUNDED = 'partially_refunded'; |
| 31 | 31 | public const PAYMENT_AUTHORIZED = 'authorized'; |
| 32 | + public const PAYMENT_SCHEDULED = 'payment_scheduled'; | |
| 32 | 33 | |
| 33 | 34 | // Transaction Statuses |
| 34 | 35 | public const TRANSACTION_SUCCEEDED = 'succeeded'; |
| 35 | 36 | public const TRANSACTION_AUTHORIZED = 'authorized'; |
| @@ -62,8 +63,12 @@ | ||
| 62 | 63 | public const SUBSCRIPTION_COMPLETED = 'completed'; |
| 63 | 64 | public const SUBSCRIPTION_AUTHENTICATED = 'authenticated'; |
| 64 | 65 | public const SUBSCRIPTION_CREATED = 'created'; |
| 65 | 66 | |
| 67 | + public const SUBSCRIPTION_METHOD_MANUAL = 'manual'; | |
| 68 | + public const SUBSCRIPTION_METHOD_AUTOMATIC = 'automatic'; | |
| 69 | + public const SUBSCRIPTION_METHOD_SYSTEM = 'system'; | |
| 70 | + | |
| 66 | 71 | // billing interval |
| 67 | 72 | public const BILLING_YEARLY = 'yearly'; |
| 68 | 73 | public const BILLING_HALF_YEARLY = 'half_yearly'; |
| 69 | 74 | public const BILLING_QUARTERLY = 'quarterly'; |
| @@ -166,17 +171,15 @@ | ||
| 166 | 171 | } |
| 167 | 172 | |
| 168 | 173 | public static function getEditableOrderStatuses() |
| 169 | 174 | { |
| 170 | - $statuses = apply_filters_deprecated('fluent-cart/editable_order_statuses', [ | |
| 171 | - [ | |
| 172 | - self::ORDER_ON_HOLD => __('On Hold', 'fluent-cart'), | |
| 173 | - self::ORDER_PROCESSING => __('Processing', 'fluent-cart'), | |
| 174 | - self::ORDER_COMPLETED => __('Completed', 'fluent-cart'), | |
| 175 | - // 'archived' => __('Archived', 'fluent-cart'), | |
| 176 | - self::ORDER_CANCELED => __('Canceled', 'fluent-cart') | |
| 177 | - ], [] | |
| 178 | - ], '1.3.16', 'fluent_cart/editable_order_statuses', 'Use fluent_cart/editable_order_statuses instead of fluent-cart/editable_order_statuses.'); | |
| 175 | + $statuses = [ | |
| 176 | + self::ORDER_ON_HOLD => __('On Hold', 'fluent-cart'), | |
| 177 | + self::ORDER_PROCESSING => __('Processing', 'fluent-cart'), | |
| 178 | + self::ORDER_COMPLETED => __('Completed', 'fluent-cart'), | |
| 179 | + // 'archived' => __('Archived', 'fluent-cart'), | |
| 180 | + self::ORDER_CANCELED => __('Canceled', 'fluent-cart') | |
| 181 | + ]; | |
| 179 | 182 | |
| 180 | 183 | return apply_filters('fluent_cart/editable_order_statuses', $statuses, []); |
| 181 | 184 | } |
| 182 | 185 | |
| @@ -191,8 +194,9 @@ | ||
| 191 | 194 | self::PAYMENT_FAILED => __('Failed', 'fluent-cart'), |
| 192 | 195 | self::PAYMENT_REFUNDED => __('Refunded', 'fluent-cart'), |
| 193 | 196 | self::PAYMENT_PARTIALLY_REFUNDED => __('Partially Refunded', 'fluent-cart'), |
| 194 | 197 | self::PAYMENT_AUTHORIZED => __('Authorized', 'fluent-cart'), |
| 198 | + self::PAYMENT_SCHEDULED => __('Payment Scheduled', 'fluent-cart'), | |
| 195 | 199 | ], []); |
| 196 | 200 | } |
| 197 | 201 | |
| 198 | 202 | // Transaction statuses |
| @@ -214,17 +218,15 @@ | ||
| 214 | 218 | } |
| 215 | 219 | |
| 216 | 220 | public static function getEditableTransactionStatuses($withLabel = true) |
| 217 | 221 | { |
| 218 | - $statuses = apply_filters_deprecated('fluent-cart/editable_transaction_statuses', [ | |
| 219 | - [ | |
| 220 | - self::TRANSACTION_PENDING => __('Pending', 'fluent-cart'), | |
| 221 | - self::TRANSACTION_SUCCEEDED => __('Succeeded', 'fluent-cart'), | |
| 222 | - self::TRANSACTION_AUTHORIZED => __('Authorized', 'fluent-cart'), | |
| 223 | - self::TRANSACTION_FAILED => __('Failed', 'fluent-cart'), | |
| 224 | - self::TRANSACTION_REFUNDED => __('Refunded', 'fluent-cart'), | |
| 225 | - ], [] | |
| 226 | - ], '1.3.16', 'fluent_cart/editable_transaction_statuses', 'Use fluent_cart/editable_transaction_statuses instead of fluent-cart/editable_transaction_statuses.'); | |
| 222 | + $statuses = [ | |
| 223 | + self::TRANSACTION_PENDING => __('Pending', 'fluent-cart'), | |
| 224 | + self::TRANSACTION_SUCCEEDED => __('Succeeded', 'fluent-cart'), | |
| 225 | + self::TRANSACTION_AUTHORIZED => __('Authorized', 'fluent-cart'), | |
| 226 | + self::TRANSACTION_FAILED => __('Failed', 'fluent-cart'), | |
| 227 | + self::TRANSACTION_REFUNDED => __('Refunded', 'fluent-cart'), | |
| 228 | + ]; | |
| 227 | 229 | |
| 228 | 230 | $statuses = apply_filters('fluent_cart/editable_transaction_statuses', $statuses, []); |
| 229 | 231 | |
| 230 | 232 | if ($withLabel) { |
| @@ -246,16 +248,14 @@ | ||
| 246 | 248 | } |
| 247 | 249 | |
| 248 | 250 | public static function getEditableShippingStatuses() |
| 249 | 251 | { |
| 250 | - $statuses = apply_filters_deprecated('fluent-cart/editable_order_statuses', [ | |
| 251 | - [ | |
| 252 | - self::SHIPPING_UNSHIPPED => __('Unshipped', 'fluent-cart'), | |
| 253 | - self::SHIPPING_SHIPPED => __('Shipped', 'fluent-cart'), | |
| 254 | - self::SHIPPING_DELIVERED => __('Delivered', 'fluent-cart'), | |
| 255 | - self::SHIPPING_UNSHIPPABLE => __('Unshippable', 'fluent-cart'), | |
| 256 | - ], [] | |
| 257 | - ], '1.3.16', 'fluent_cart/editable_shipping_statuses', 'Use fluent_cart/editable_shipping_statuses instead of fluent-cart/editable_order_statuses.'); | |
| 252 | + $statuses = [ | |
| 253 | + self::SHIPPING_UNSHIPPED => __('Unshipped', 'fluent-cart'), | |
| 254 | + self::SHIPPING_SHIPPED => __('Shipped', 'fluent-cart'), | |
| 255 | + self::SHIPPING_DELIVERED => __('Delivered', 'fluent-cart'), | |
| 256 | + self::SHIPPING_UNSHIPPABLE => __('Unshippable', 'fluent-cart'), | |
| 257 | + ]; | |
| 258 | 258 | |
| 259 | 259 | return apply_filters('fluent_cart/editable_shipping_statuses', $statuses, []); |
| 260 | 260 | } |
| 261 | 261 | |
| @@ -323,12 +323,20 @@ | ||
| 323 | 323 | { |
| 324 | 324 | return [ |
| 325 | 325 | self::PAYMENT_PAID, |
| 326 | 326 | self::PAYMENT_PARTIALLY_REFUNDED, |
| 327 | - self::PAYMENT_PARTIALLY_PAID | |
| 327 | + self::PAYMENT_PARTIALLY_PAID, | |
| 328 | 328 | ]; |
| 329 | 329 | } |
| 330 | 330 | |
| 331 | + public static function getPaymentRetryableStatuses() | |
| 332 | + { | |
| 333 | + return [ | |
| 334 | + self::PAYMENT_PENDING, | |
| 335 | + self::PAYMENT_FAILED | |
| 336 | + ]; | |
| 337 | + } | |
| 338 | + | |
| 331 | 339 | public static function getReportStatuses() |
| 332 | 340 | { |
| 333 | 341 | return [ |
| 334 | 342 | self::PAYMENT_PAID, |
| @@ -358,14 +366,12 @@ | ||
| 358 | 366 | } |
| 359 | 367 | |
| 360 | 368 | public static function getEditableCustomerStatuses() |
| 361 | 369 | { |
| 362 | - $statuses = apply_filters_deprecated('fluent-cart/editable_customer_statuses', [ | |
| 363 | - [ | |
| 364 | - self::CUSTOMER_ACTIVE => __('Active', 'fluent-cart'), | |
| 365 | - self::CUSTOMER_INACTIVE => __('Inactive', 'fluent-cart'), | |
| 366 | - ], [] | |
| 367 | - ], '1.3.16', 'fluent_cart/editable_customer_statuses', 'Use fluent_cart/editable_customer_statuses instead of fluent-cart/editable_customer_statuses.'); | |
| 370 | + $statuses = [ | |
| 371 | + self::CUSTOMER_ACTIVE => __('Active', 'fluent-cart'), | |
| 372 | + self::CUSTOMER_INACTIVE => __('Inactive', 'fluent-cart'), | |
| 373 | + ]; | |
| 368 | 374 | |
| 369 | 375 | return apply_filters('fluent_cart/editable_customer_statuses', $statuses, []); |
| 370 | 376 | } |
| 371 | 377 | |