fluentcart-developer 3.0.0 → 3.0.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE.md +26 -26
- package/README.md +59 -59
- package/dist/cards/fluentcart/templates-native.js +1087 -1087
- package/dist/cards/fluentcart/tools.js +2309 -2309
- package/dist/server.d.ts.map +1 -1
- package/dist/server.js +37 -1
- package/dist/server.js.map +1 -1
- package/dist/skills/fluentcart-developer/SKILL.md +108 -108
- package/dist/skills/fluentcart-developer/examples/README.md +30 -30
- package/dist/skills/fluentcart-developer/examples/fluentcart-starter-child-theme/fluent-cart/checkout.php +32 -32
- package/dist/skills/fluentcart-developer/examples/fluentcart-starter-child-theme/functions.php +40 -40
- package/dist/skills/fluentcart-developer/examples/sample-custom-addon/fluentcart-custom-addon.php +113 -113
- package/dist/skills/fluentcart-developer/examples/sample-custom-payment-gateway/fluentcart-custom-gateway-example.php +148 -148
- package/dist/skills/fluentcart-developer/examples/sample-fee-surcharge-plugin/fluentcart-fee-surcharge.php +38 -38
- package/dist/skills/fluentcart-developer/examples/sample-plugin-with-licensing-sdk/README.md +22 -22
- package/dist/skills/fluentcart-developer/examples/sample-plugin-with-licensing-sdk/sample-plugin-with-licensing-sdk.php +79 -79
- package/dist/skills/fluentcart-developer/examples/sample-plugin-with-licensing-sdk/updater/FluentLicensing.php +303 -303
- package/dist/skills/fluentcart-developer/examples/sample-plugin-with-licensing-sdk/updater/LicenseSettings.php +566 -566
- package/dist/skills/fluentcart-developer/examples/sample-plugin-with-licensing-sdk/updater/PluginUpdater.php +304 -304
- package/dist/skills/fluentcart-developer/examples/sample-shipping-carrier/fluentcart-custom-shipping-carrier.php +61 -61
- package/dist/skills/fluentcart-developer/references/api/authentication.md +452 -452
- package/dist/skills/fluentcart-developer/references/api/coupons.md +786 -786
- package/dist/skills/fluentcart-developer/references/api/customers.md +889 -889
- package/dist/skills/fluentcart-developer/references/api/files.md +609 -609
- package/dist/skills/fluentcart-developer/references/api/index.md +432 -432
- package/dist/skills/fluentcart-developer/references/api/licensing.md +633 -633
- package/dist/skills/fluentcart-developer/references/api/order-bump.md +384 -384
- package/dist/skills/fluentcart-developer/references/api/orders.md +814 -814
- package/dist/skills/fluentcart-developer/references/api/products.md +866 -866
- package/dist/skills/fluentcart-developer/references/api/roles-permissions.md +536 -536
- package/dist/skills/fluentcart-developer/references/api/subscriptions.md +827 -827
- package/dist/skills/fluentcart-developer/references/database/index.md +44 -44
- package/dist/skills/fluentcart-developer/references/database/models/activity.md +178 -178
- package/dist/skills/fluentcart-developer/references/database/models/applied-coupon.md +291 -291
- package/dist/skills/fluentcart-developer/references/database/models/attribute-group.md +239 -239
- package/dist/skills/fluentcart-developer/references/database/models/attribute-relation.md +181 -181
- package/dist/skills/fluentcart-developer/references/database/models/attribute-term.md +219 -219
- package/dist/skills/fluentcart-developer/references/database/models/cart.md +645 -645
- package/dist/skills/fluentcart-developer/references/database/models/coupon.md +427 -427
- package/dist/skills/fluentcart-developer/references/database/models/customer-addresses.md +348 -348
- package/dist/skills/fluentcart-developer/references/database/models/customer-meta.md +156 -156
- package/dist/skills/fluentcart-developer/references/database/models/customer.md +584 -584
- package/dist/skills/fluentcart-developer/references/database/models/dynamic-model.md +163 -163
- package/dist/skills/fluentcart-developer/references/database/models/label-relationship.md +155 -155
- package/dist/skills/fluentcart-developer/references/database/models/label.md +153 -153
- package/dist/skills/fluentcart-developer/references/database/models/license-activation.md +182 -182
- package/dist/skills/fluentcart-developer/references/database/models/license-meta.md +163 -163
- package/dist/skills/fluentcart-developer/references/database/models/license-site.md +208 -208
- package/dist/skills/fluentcart-developer/references/database/models/license.md +640 -640
- package/dist/skills/fluentcart-developer/references/database/models/meta.md +233 -233
- package/dist/skills/fluentcart-developer/references/database/models/order-address.md +391 -391
- package/dist/skills/fluentcart-developer/references/database/models/order-download-permission.md +144 -144
- package/dist/skills/fluentcart-developer/references/database/models/order-item.md +383 -383
- package/dist/skills/fluentcart-developer/references/database/models/order-meta.md +303 -303
- package/dist/skills/fluentcart-developer/references/database/models/order-operation.md +158 -158
- package/dist/skills/fluentcart-developer/references/database/models/order-promotion-stat.md +175 -175
- package/dist/skills/fluentcart-developer/references/database/models/order-promotion.md +250 -250
- package/dist/skills/fluentcart-developer/references/database/models/order-tax-rate.md +172 -172
- package/dist/skills/fluentcart-developer/references/database/models/order-transaction.md +440 -440
- package/dist/skills/fluentcart-developer/references/database/models/order.md +727 -727
- package/dist/skills/fluentcart-developer/references/database/models/product-detail.md +397 -397
- package/dist/skills/fluentcart-developer/references/database/models/product-download.md +258 -258
- package/dist/skills/fluentcart-developer/references/database/models/product-meta.md +153 -153
- package/dist/skills/fluentcart-developer/references/database/models/product-variation.md +556 -556
- package/dist/skills/fluentcart-developer/references/database/models/product.md +580 -580
- package/dist/skills/fluentcart-developer/references/database/models/relationships.md +427 -427
- package/dist/skills/fluentcart-developer/references/database/models/scheduled-action.md +175 -175
- package/dist/skills/fluentcart-developer/references/database/models/shipping-class.md +148 -148
- package/dist/skills/fluentcart-developer/references/database/models/shipping-method.md +280 -280
- package/dist/skills/fluentcart-developer/references/database/models/shipping-zone.md +205 -205
- package/dist/skills/fluentcart-developer/references/database/models/subscription-meta.md +173 -173
- package/dist/skills/fluentcart-developer/references/database/models/subscription.md +528 -528
- package/dist/skills/fluentcart-developer/references/database/models/tax-class.md +195 -195
- package/dist/skills/fluentcart-developer/references/database/models/tax-rate.md +225 -225
- package/dist/skills/fluentcart-developer/references/database/models/user-meta.md +166 -166
- package/dist/skills/fluentcart-developer/references/database/models/user.md +220 -220
- package/dist/skills/fluentcart-developer/references/database/models.md +404 -404
- package/dist/skills/fluentcart-developer/references/database/query-builder.md +860 -860
- package/dist/skills/fluentcart-developer/references/database/readme.md +276 -276
- package/dist/skills/fluentcart-developer/references/database/schema.md +1002 -1002
- package/dist/skills/fluentcart-developer/references/engineering/adding-custom-pages-to-the-customer-dashboard.md +395 -395
- package/dist/skills/fluentcart-developer/references/engineering/index.md +4 -4
- package/dist/skills/fluentcart-developer/references/engineering.md +4 -4
- package/dist/skills/fluentcart-developer/references/getting-started.md +249 -249
- package/dist/skills/fluentcart-developer/references/guides/frontend.md +519 -519
- package/dist/skills/fluentcart-developer/references/guides/index.md +107 -107
- package/dist/skills/fluentcart-developer/references/guides/integrations.md +600 -600
- package/dist/skills/fluentcart-developer/references/guides/shipping-carrier/index.md +237 -237
- package/dist/skills/fluentcart-developer/references/guides/shipping-carrier/labels-and-tracking.md +481 -481
- package/dist/skills/fluentcart-developer/references/guides/shipping-carrier/live-rates.md +269 -269
- package/dist/skills/fluentcart-developer/references/guides/shipping-carrier/reference.md +223 -223
- package/dist/skills/fluentcart-developer/references/guides/shipping-carrier/settings.md +370 -370
- package/dist/skills/fluentcart-developer/references/guides/shipping-carrier.md +237 -237
- package/dist/skills/fluentcart-developer/references/guides/subscriptions.md +217 -217
- package/dist/skills/fluentcart-developer/references/hooks/actions/admin-and-templates.md +1079 -1079
- package/dist/skills/fluentcart-developer/references/hooks/actions/cart-and-checkout.md +1795 -1795
- package/dist/skills/fluentcart-developer/references/hooks/actions/customers-and-users.md +327 -327
- package/dist/skills/fluentcart-developer/references/hooks/actions/licenses.md +829 -829
- package/dist/skills/fluentcart-developer/references/hooks/actions/modules.md +81 -81
- package/dist/skills/fluentcart-developer/references/hooks/actions/orders.md +757 -757
- package/dist/skills/fluentcart-developer/references/hooks/actions/payments-and-integrations.md +1163 -1163
- package/dist/skills/fluentcart-developer/references/hooks/actions/pro-modules.md +219 -219
- package/dist/skills/fluentcart-developer/references/hooks/actions/products-and-coupons.md +1019 -1019
- package/dist/skills/fluentcart-developer/references/hooks/actions/subscriptions.md +1290 -1290
- package/dist/skills/fluentcart-developer/references/hooks/actions.md +16 -16
- package/dist/skills/fluentcart-developer/references/hooks/deprecated.md +60 -60
- package/dist/skills/fluentcart-developer/references/hooks/filters/cart-and-checkout.md +2032 -2032
- package/dist/skills/fluentcart-developer/references/hooks/filters/customers-and-subscriptions.md +1746 -1746
- package/dist/skills/fluentcart-developer/references/hooks/filters/integrations-and-advanced.md +2439 -2439
- package/dist/skills/fluentcart-developer/references/hooks/filters/modules.md +464 -464
- package/dist/skills/fluentcart-developer/references/hooks/filters/orders-and-payments.md +2658 -2658
- package/dist/skills/fluentcart-developer/references/hooks/filters/pro-modules.md +502 -502
- package/dist/skills/fluentcart-developer/references/hooks/filters/products-and-pricing.md +1785 -1785
- package/dist/skills/fluentcart-developer/references/hooks/filters/settings-and-configuration.md +2966 -2966
- package/dist/skills/fluentcart-developer/references/hooks/filters.md +14 -14
- package/dist/skills/fluentcart-developer/references/hooks/index.md +35 -35
- package/dist/skills/fluentcart-developer/references/index.md +625 -625
- package/dist/skills/fluentcart-developer/references/modules/fee-system.md +427 -427
- package/dist/skills/fluentcart-developer/references/modules/ghost-product-selling.md +440 -440
- package/dist/skills/fluentcart-developer/references/modules/index.md +484 -484
- package/dist/skills/fluentcart-developer/references/modules/licensing.md +342 -342
- package/dist/skills/fluentcart-developer/references/modules/order-bump.md +433 -433
- package/dist/skills/fluentcart-developer/references/modules/payment-methods.md +129 -129
- package/dist/skills/fluentcart-developer/references/modules/refunds.md +170 -170
- package/dist/skills/fluentcart-developer/references/modules/shipping.md +846 -846
- package/dist/skills/fluentcart-developer/references/modules/storage.md +986 -986
- package/dist/skills/fluentcart-developer/references/modules/subscription-vendor-ids.md +186 -186
- package/dist/skills/fluentcart-developer/references/modules/subscriptions.md +678 -678
- package/dist/skills/fluentcart-developer/references/payment-methods-integration/index.md +164 -164
- package/dist/skills/fluentcart-developer/references/payment-methods-integration/paddle-example.md +1648 -1648
- package/dist/skills/fluentcart-developer/references/payment-methods-integration/payment/setting/fields.md +353 -353
- package/dist/skills/fluentcart-developer/references/payment-methods-integration/quick-implementation.md +1079 -1079
- package/dist/skills/fluentcart-developer/references/payment-methods-integration.md +164 -164
- package/dist/skills/fluentcart-developer/references/restapi/checkout.md +573 -573
- package/dist/skills/fluentcart-developer/references/restapi/coupons.md +958 -958
- package/dist/skills/fluentcart-developer/references/restapi/customer-profile.md +1423 -1423
- package/dist/skills/fluentcart-developer/references/restapi/customers.md +1103 -1103
- package/dist/skills/fluentcart-developer/references/restapi/dashboard.md +1083 -1083
- package/dist/skills/fluentcart-developer/references/restapi/data-export.md +132 -132
- package/dist/skills/fluentcart-developer/references/restapi/email-notifications.md +846 -846
- package/dist/skills/fluentcart-developer/references/restapi/files.md +313 -313
- package/dist/skills/fluentcart-developer/references/restapi/index.md +127 -127
- package/dist/skills/fluentcart-developer/references/restapi/integrations.md +1000 -1000
- package/dist/skills/fluentcart-developer/references/restapi/inventory.md +192 -192
- package/dist/skills/fluentcart-developer/references/restapi/labels-and-attributes.md +797 -797
- package/dist/skills/fluentcart-developer/references/restapi/licensing.md +1733 -1733
- package/dist/skills/fluentcart-developer/references/restapi/operations/checkout/get-available-shipping-methods.md +30 -30
- package/dist/skills/fluentcart-developer/references/restapi/operations/checkout/get-checkout-summary.md +28 -28
- package/dist/skills/fluentcart-developer/references/restapi/operations/checkout/get-country-info.md +29 -29
- package/dist/skills/fluentcart-developer/references/restapi/operations/checkout/get-order-info.md +28 -28
- package/dist/skills/fluentcart-developer/references/restapi/operations/checkout/get-shipping-methods-list-view.md +30 -30
- package/dist/skills/fluentcart-developer/references/restapi/operations/checkout/login.md +66 -66
- package/dist/skills/fluentcart-developer/references/restapi/operations/checkout/place-order.md +179 -179
- package/dist/skills/fluentcart-developer/references/restapi/operations/coupons/apply-coupon.md +83 -83
- package/dist/skills/fluentcart-developer/references/restapi/operations/coupons/cancel-coupon.md +87 -87
- package/dist/skills/fluentcart-developer/references/restapi/operations/coupons/check-product-eligibility.md +59 -59
- package/dist/skills/fluentcart-developer/references/restapi/operations/coupons/create-coupon.md +230 -230
- package/dist/skills/fluentcart-developer/references/restapi/operations/coupons/delete-coupon.md +29 -29
- package/dist/skills/fluentcart-developer/references/restapi/operations/coupons/get-coupon-settings.md +20 -20
- package/dist/skills/fluentcart-developer/references/restapi/operations/coupons/get-coupon.md +27 -27
- package/dist/skills/fluentcart-developer/references/restapi/operations/coupons/list-coupon-codes.md +20 -20
- package/dist/skills/fluentcart-developer/references/restapi/operations/coupons/list-coupons.md +37 -37
- package/dist/skills/fluentcart-developer/references/restapi/operations/coupons/re-apply-coupons.md +75 -75
- package/dist/skills/fluentcart-developer/references/restapi/operations/coupons/store-coupon-settings.md +40 -40
- package/dist/skills/fluentcart-developer/references/restapi/operations/coupons/update-coupon.md +133 -133
- package/dist/skills/fluentcart-developer/references/restapi/operations/customer-profile/create-address-checkout.md +138 -138
- package/dist/skills/fluentcart-developer/references/restapi/operations/customer-profile/create-profile-address.md +119 -119
- package/dist/skills/fluentcart-developer/references/restapi/operations/customer-profile/dashboard-overview.md +22 -22
- package/dist/skills/fluentcart-developer/references/restapi/operations/customer-profile/delete-profile-address.md +46 -46
- package/dist/skills/fluentcart-developer/references/restapi/operations/customer-profile/get-order-details.md +30 -30
- package/dist/skills/fluentcart-developer/references/restapi/operations/customer-profile/get-portal-sections.md +29 -29
- package/dist/skills/fluentcart-developer/references/restapi/operations/customer-profile/get-profile-details.md +22 -22
- package/dist/skills/fluentcart-developer/references/restapi/operations/customer-profile/get-transaction-billing-address.md +30 -30
- package/dist/skills/fluentcart-developer/references/restapi/operations/customer-profile/get-upgrade-paths.md +31 -31
- package/dist/skills/fluentcart-developer/references/restapi/operations/customer-profile/list-downloads.md +29 -29
- package/dist/skills/fluentcart-developer/references/restapi/operations/customer-profile/list-orders.md +28 -28
- package/dist/skills/fluentcart-developer/references/restapi/operations/customer-profile/make-profile-address-primary.md +55 -55
- package/dist/skills/fluentcart-developer/references/restapi/operations/customer-profile/pause-subscription.md +29 -29
- package/dist/skills/fluentcart-developer/references/restapi/operations/customer-profile/resume-subscription.md +29 -29
- package/dist/skills/fluentcart-developer/references/restapi/operations/customer-profile/save-transaction-billing-address.md +92 -92
- package/dist/skills/fluentcart-developer/references/restapi/operations/customer-profile/select-address-for-checkout.md +32 -32
- package/dist/skills/fluentcart-developer/references/restapi/operations/customer-profile/update-profile-address.md +115 -115
- package/dist/skills/fluentcart-developer/references/restapi/operations/customer-profile/update-profile-details.md +69 -69
- package/dist/skills/fluentcart-developer/references/restapi/operations/customers/attach-user.md +50 -50
- package/dist/skills/fluentcart-developer/references/restapi/operations/customers/bulk-actions.md +65 -65
- package/dist/skills/fluentcart-developer/references/restapi/operations/customers/create-address.md +135 -135
- package/dist/skills/fluentcart-developer/references/restapi/operations/customers/create-customer.md +108 -108
- package/dist/skills/fluentcart-developer/references/restapi/operations/customers/delete-address.md +62 -62
- package/dist/skills/fluentcart-developer/references/restapi/operations/customers/detach-user.md +28 -28
- package/dist/skills/fluentcart-developer/references/restapi/operations/customers/find-customer-order.md +27 -27
- package/dist/skills/fluentcart-developer/references/restapi/operations/customers/get-attachable-users.md +20 -20
- package/dist/skills/fluentcart-developer/references/restapi/operations/customers/get-customer-addresses.md +28 -28
- package/dist/skills/fluentcart-developer/references/restapi/operations/customers/get-customer-orders.md +37 -37
- package/dist/skills/fluentcart-developer/references/restapi/operations/customers/get-customer-stats.md +27 -27
- package/dist/skills/fluentcart-developer/references/restapi/operations/customers/get-customer.md +32 -32
- package/dist/skills/fluentcart-developer/references/restapi/operations/customers/list-customers.md +37 -37
- package/dist/skills/fluentcart-developer/references/restapi/operations/customers/recalculate-ltv.md +28 -28
- package/dist/skills/fluentcart-developer/references/restapi/operations/customers/set-primary-address.md +72 -72
- package/dist/skills/fluentcart-developer/references/restapi/operations/customers/update-additional-info.md +55 -55
- package/dist/skills/fluentcart-developer/references/restapi/operations/customers/update-address.md +144 -144
- package/dist/skills/fluentcart-developer/references/restapi/operations/customers/update-customer.md +123 -123
- package/dist/skills/fluentcart-developer/references/restapi/operations/dashboard/attach-note-to-order.md +49 -49
- package/dist/skills/fluentcart-developer/references/restapi/operations/dashboard/create-all-pages.md +21 -21
- package/dist/skills/fluentcart-developer/references/restapi/operations/dashboard/create-single-page.md +55 -55
- package/dist/skills/fluentcart-developer/references/restapi/operations/dashboard/delete-activity.md +28 -28
- package/dist/skills/fluentcart-developer/references/restapi/operations/dashboard/get-country-info.md +29 -29
- package/dist/skills/fluentcart-developer/references/restapi/operations/dashboard/get-dashboard-stats.md +22 -22
- package/dist/skills/fluentcart-developer/references/restapi/operations/dashboard/get-filter-options.md +31 -31
- package/dist/skills/fluentcart-developer/references/restapi/operations/dashboard/get-onboarding-data.md +20 -20
- package/dist/skills/fluentcart-developer/references/restapi/operations/dashboard/get-onboarding-settings.md +20 -20
- package/dist/skills/fluentcart-developer/references/restapi/operations/dashboard/get-print-templates.md +20 -20
- package/dist/skills/fluentcart-developer/references/restapi/operations/dashboard/get-search-options.md +27 -27
- package/dist/skills/fluentcart-developer/references/restapi/operations/dashboard/get-widgets.md +28 -28
- package/dist/skills/fluentcart-developer/references/restapi/operations/dashboard/initialize-app.md +20 -20
- package/dist/skills/fluentcart-developer/references/restapi/operations/dashboard/list-activities.md +33 -33
- package/dist/skills/fluentcart-developer/references/restapi/operations/dashboard/list-attachments.md +21 -21
- package/dist/skills/fluentcart-developer/references/restapi/operations/dashboard/list-countries.md +20 -20
- package/dist/skills/fluentcart-developer/references/restapi/operations/dashboard/mark-activity-read.md +53 -53
- package/dist/skills/fluentcart-developer/references/restapi/operations/dashboard/run-data-backfills.md +21 -21
- package/dist/skills/fluentcart-developer/references/restapi/operations/dashboard/save-onboarding-settings.md +54 -54
- package/dist/skills/fluentcart-developer/references/restapi/operations/dashboard/save-onboarding-tax-settings.md +73 -73
- package/dist/skills/fluentcart-developer/references/restapi/operations/dashboard/save-print-templates.md +64 -64
- package/dist/skills/fluentcart-developer/references/restapi/operations/dashboard/upload-attachment.md +42 -42
- package/dist/skills/fluentcart-developer/references/restapi/operations/data-export/export-customers-batch.md +129 -129
- package/dist/skills/fluentcart-developer/references/restapi/operations/data-export/export-licenses-batch.md +133 -133
- package/dist/skills/fluentcart-developer/references/restapi/operations/data-export/export-orders-batch.md +129 -129
- package/dist/skills/fluentcart-developer/references/restapi/operations/data-export/export-subscriptions-batch.md +129 -129
- package/dist/skills/fluentcart-developer/references/restapi/operations/data-export/get-customers-export-schema.md +21 -21
- package/dist/skills/fluentcart-developer/references/restapi/operations/data-export/get-licenses-export-schema.md +26 -26
- package/dist/skills/fluentcart-developer/references/restapi/operations/data-export/get-orders-export-schema.md +21 -21
- package/dist/skills/fluentcart-developer/references/restapi/operations/data-export/get-subscriptions-export-schema.md +21 -21
- package/dist/skills/fluentcart-developer/references/restapi/operations/email-notification/enable-notification.md +57 -57
- package/dist/skills/fluentcart-developer/references/restapi/operations/email-notification/get-digest-settings.md +22 -22
- package/dist/skills/fluentcart-developer/references/restapi/operations/email-notification/get-notification.md +30 -30
- package/dist/skills/fluentcart-developer/references/restapi/operations/email-notification/get-reminders.md +22 -22
- package/dist/skills/fluentcart-developer/references/restapi/operations/email-notification/get-settings.md +22 -22
- package/dist/skills/fluentcart-developer/references/restapi/operations/email-notification/get-shortcodes.md +22 -22
- package/dist/skills/fluentcart-developer/references/restapi/operations/email-notification/list-notifications.md +20 -20
- package/dist/skills/fluentcart-developer/references/restapi/operations/email-notification/preview-default-template.md +66 -66
- package/dist/skills/fluentcart-developer/references/restapi/operations/email-notification/preview-notification.md +50 -50
- package/dist/skills/fluentcart-developer/references/restapi/operations/email-notification/save-digest-settings.md +101 -101
- package/dist/skills/fluentcart-developer/references/restapi/operations/email-notification/save-reminders.md +162 -162
- package/dist/skills/fluentcart-developer/references/restapi/operations/email-notification/save-settings.md +99 -99
- package/dist/skills/fluentcart-developer/references/restapi/operations/email-notification/send-digest-test.md +47 -47
- package/dist/skills/fluentcart-developer/references/restapi/operations/email-notification/send-manual-reminder.md +51 -51
- package/dist/skills/fluentcart-developer/references/restapi/operations/email-notification/update-notification.md +93 -93
- package/dist/skills/fluentcart-developer/references/restapi/operations/files/delete-file.md +31 -31
- package/dist/skills/fluentcart-developer/references/restapi/operations/files/get-bucket-list.md +28 -28
- package/dist/skills/fluentcart-developer/references/restapi/operations/files/list-files.md +30 -30
- package/dist/skills/fluentcart-developer/references/restapi/operations/files/upload-editor-file.md +32 -32
- package/dist/skills/fluentcart-developer/references/restapi/operations/files/upload-file.md +34 -34
- package/dist/skills/fluentcart-developer/references/restapi/operations/integration/chained-data-request.md +46 -46
- package/dist/skills/fluentcart-developer/references/restapi/operations/integration/change-feed-status.md +51 -51
- package/dist/skills/fluentcart-developer/references/restapi/operations/integration/delete-feed.md +27 -27
- package/dist/skills/fluentcart-developer/references/restapi/operations/integration/get-dynamic-options.md +29 -29
- package/dist/skills/fluentcart-developer/references/restapi/operations/integration/get-feed-lists.md +27 -27
- package/dist/skills/fluentcart-developer/references/restapi/operations/integration/get-feed-settings.md +27 -27
- package/dist/skills/fluentcart-developer/references/restapi/operations/integration/get-global-feeds.md +20 -20
- package/dist/skills/fluentcart-developer/references/restapi/operations/integration/get-global-settings.md +26 -26
- package/dist/skills/fluentcart-developer/references/restapi/operations/integration/install-addon-plugin.md +49 -49
- package/dist/skills/fluentcart-developer/references/restapi/operations/integration/list-addons.md +20 -20
- package/dist/skills/fluentcart-developer/references/restapi/operations/integration/save-feed-settings.md +52 -52
- package/dist/skills/fluentcart-developer/references/restapi/operations/integration/set-global-settings.md +50 -50
- package/dist/skills/fluentcart-developer/references/restapi/operations/inventory/bulk-update-stock.md +94 -94
- package/dist/skills/fluentcart-developer/references/restapi/operations/inventory/export-inventory.md +81 -81
- package/dist/skills/fluentcart-developer/references/restapi/operations/inventory/get-adjustment-history.md +26 -26
- package/dist/skills/fluentcart-developer/references/restapi/operations/inventory/get-inventory-stats.md +21 -21
- package/dist/skills/fluentcart-developer/references/restapi/operations/inventory/list-inventory.md +33 -33
- package/dist/skills/fluentcart-developer/references/restapi/operations/inventory/update-stock.md +75 -75
- package/dist/skills/fluentcart-developer/references/restapi/operations/labels-attributes/create-attribute-group.md +31 -31
- package/dist/skills/fluentcart-developer/references/restapi/operations/labels-attributes/create-label.md +31 -31
- package/dist/skills/fluentcart-developer/references/restapi/operations/labels-attributes/create-terms.md +90 -90
- package/dist/skills/fluentcart-developer/references/restapi/operations/labels-attributes/delete-attribute-group.md +28 -28
- package/dist/skills/fluentcart-developer/references/restapi/operations/labels-attributes/delete-attribute-term.md +29 -29
- package/dist/skills/fluentcart-developer/references/restapi/operations/labels-attributes/get-attribute-group.md +28 -28
- package/dist/skills/fluentcart-developer/references/restapi/operations/labels-attributes/get-attribute-library.md +20 -20
- package/dist/skills/fluentcart-developer/references/restapi/operations/labels-attributes/list-attribute-groups.md +32 -32
- package/dist/skills/fluentcart-developer/references/restapi/operations/labels-attributes/list-attribute-terms.md +33 -33
- package/dist/skills/fluentcart-developer/references/restapi/operations/labels-attributes/list-labels.md +20 -20
- package/dist/skills/fluentcart-developer/references/restapi/operations/labels-attributes/reorder-groups.md +51 -51
- package/dist/skills/fluentcart-developer/references/restapi/operations/labels-attributes/reorder-terms.md +56 -56
- package/dist/skills/fluentcart-developer/references/restapi/operations/labels-attributes/update-attribute-group.md +37 -37
- package/dist/skills/fluentcart-developer/references/restapi/operations/labels-attributes/update-attribute-term.md +39 -39
- package/dist/skills/fluentcart-developer/references/restapi/operations/labels-attributes/update-label-selections.md +32 -32
- package/dist/skills/fluentcart-developer/references/restapi/operations/licensing/activate-plugin-license.md +41 -41
- package/dist/skills/fluentcart-developer/references/restapi/operations/licensing/activate-site-admin.md +60 -60
- package/dist/skills/fluentcart-developer/references/restapi/operations/licensing/deactivate-plugin-license.md +18 -18
- package/dist/skills/fluentcart-developer/references/restapi/operations/licensing/deactivate-site-admin.md +67 -67
- package/dist/skills/fluentcart-developer/references/restapi/operations/licensing/deactivate-site-customer.md +47 -47
- package/dist/skills/fluentcart-developer/references/restapi/operations/licensing/delete-license.md +24 -24
- package/dist/skills/fluentcart-developer/references/restapi/operations/licensing/extend-license-validity.md +47 -47
- package/dist/skills/fluentcart-developer/references/restapi/operations/licensing/get-customer-license-details.md +25 -25
- package/dist/skills/fluentcart-developer/references/restapi/operations/licensing/get-customer-licenses-admin.md +26 -26
- package/dist/skills/fluentcart-developer/references/restapi/operations/licensing/get-license-activations.md +25 -25
- package/dist/skills/fluentcart-developer/references/restapi/operations/licensing/get-license-details.md +25 -25
- package/dist/skills/fluentcart-developer/references/restapi/operations/licensing/get-license-site.md +30 -30
- package/dist/skills/fluentcart-developer/references/restapi/operations/licensing/get-plugin-license-status.md +18 -18
- package/dist/skills/fluentcart-developer/references/restapi/operations/licensing/get-product-license-settings.md +24 -24
- package/dist/skills/fluentcart-developer/references/restapi/operations/licensing/list-customer-licenses.md +25 -25
- package/dist/skills/fluentcart-developer/references/restapi/operations/licensing/list-license-sites.md +33 -33
- package/dist/skills/fluentcart-developer/references/restapi/operations/licensing/list-licenses.md +38 -38
- package/dist/skills/fluentcart-developer/references/restapi/operations/licensing/public-activate-license.md +54 -54
- package/dist/skills/fluentcart-developer/references/restapi/operations/licensing/public-check-license.md +26 -26
- package/dist/skills/fluentcart-developer/references/restapi/operations/licensing/public-deactivate-license.md +46 -46
- package/dist/skills/fluentcart-developer/references/restapi/operations/licensing/public-download-license-package.md +23 -23
- package/dist/skills/fluentcart-developer/references/restapi/operations/licensing/public-get-license-version.md +26 -26
- package/dist/skills/fluentcart-developer/references/restapi/operations/licensing/regenerate-license-key.md +24 -24
- package/dist/skills/fluentcart-developer/references/restapi/operations/licensing/save-product-license-settings.md +193 -193
- package/dist/skills/fluentcart-developer/references/restapi/operations/licensing/update-license-activation-limit.md +53 -53
- package/dist/skills/fluentcart-developer/references/restapi/operations/licensing/update-license-status.md +52 -52
- package/dist/skills/fluentcart-developer/references/restapi/operations/order-bumps/create-order-bump.md +47 -47
- package/dist/skills/fluentcart-developer/references/restapi/operations/order-bumps/delete-order-bump.md +25 -25
- package/dist/skills/fluentcart-developer/references/restapi/operations/order-bumps/get-order-bump.md +25 -25
- package/dist/skills/fluentcart-developer/references/restapi/operations/order-bumps/list-order-bumps.md +29 -29
- package/dist/skills/fluentcart-developer/references/restapi/operations/order-bumps/update-order-bump.md +141 -141
- package/dist/skills/fluentcart-developer/references/restapi/operations/orders/accept-dispute.md +47 -47
- package/dist/skills/fluentcart-developer/references/restapi/operations/orders/bulk-actions.md +72 -72
- package/dist/skills/fluentcart-developer/references/restapi/operations/orders/calculate-shipping.md +67 -67
- package/dist/skills/fluentcart-developer/references/restapi/operations/orders/calculate-tax.md +98 -98
- package/dist/skills/fluentcart-developer/references/restapi/operations/orders/change-customer.md +50 -50
- package/dist/skills/fluentcart-developer/references/restapi/operations/orders/charge-now.md +29 -29
- package/dist/skills/fluentcart-developer/references/restapi/operations/orders/create-and-change-customer.md +92 -92
- package/dist/skills/fluentcart-developer/references/restapi/operations/orders/create-custom-order-item.md +68 -68
- package/dist/skills/fluentcart-developer/references/restapi/operations/orders/create-order.md +351 -351
- package/dist/skills/fluentcart-developer/references/restapi/operations/orders/create-renewal-now.md +29 -29
- package/dist/skills/fluentcart-developer/references/restapi/operations/orders/delete-order.md +28 -28
- package/dist/skills/fluentcart-developer/references/restapi/operations/orders/generate-missing-licenses.md +29 -29
- package/dist/skills/fluentcart-developer/references/restapi/operations/orders/get-order-transactions.md +27 -27
- package/dist/skills/fluentcart-developer/references/restapi/operations/orders/get-order.md +27 -27
- package/dist/skills/fluentcart-developer/references/restapi/operations/orders/get-renewal.md +28 -28
- package/dist/skills/fluentcart-developer/references/restapi/operations/orders/get-shipping-methods.md +28 -28
- package/dist/skills/fluentcart-developer/references/restapi/operations/orders/get-single-transaction.md +28 -28
- package/dist/skills/fluentcart-developer/references/restapi/operations/orders/list-order-currencies.md +22 -22
- package/dist/skills/fluentcart-developer/references/restapi/operations/orders/list-orders.md +42 -42
- package/dist/skills/fluentcart-developer/references/restapi/operations/orders/list-renewals.md +28 -28
- package/dist/skills/fluentcart-developer/references/restapi/operations/orders/mark-as-paid.md +61 -61
- package/dist/skills/fluentcart-developer/references/restapi/operations/orders/price-order.md +135 -135
- package/dist/skills/fluentcart-developer/references/restapi/operations/orders/refund-order.md +72 -72
- package/dist/skills/fluentcart-developer/references/restapi/operations/orders/resend-renewal-invoice.md +29 -29
- package/dist/skills/fluentcart-developer/references/restapi/operations/orders/skip-renewal.md +48 -48
- package/dist/skills/fluentcart-developer/references/restapi/operations/orders/sync-order-statuses.md +28 -28
- package/dist/skills/fluentcart-developer/references/restapi/operations/orders/sync-pending-transaction.md +29 -29
- package/dist/skills/fluentcart-developer/references/restapi/operations/orders/update-order-address-id.md +60 -60
- package/dist/skills/fluentcart-developer/references/restapi/operations/orders/update-order-address.md +98 -98
- package/dist/skills/fluentcart-developer/references/restapi/operations/orders/update-order.md +172 -172
- package/dist/skills/fluentcart-developer/references/restapi/operations/orders/update-statuses.md +77 -77
- package/dist/skills/fluentcart-developer/references/restapi/operations/orders/update-subscription-details.md +84 -84
- package/dist/skills/fluentcart-developer/references/restapi/operations/orders/update-transaction-status.md +51 -51
- package/dist/skills/fluentcart-developer/references/restapi/operations/orders/void-renewal.md +30 -30
- package/dist/skills/fluentcart-developer/references/restapi/operations/pdf-templates/create-pdf-template.md +42 -42
- package/dist/skills/fluentcart-developer/references/restapi/operations/pdf-templates/delete-pdf-template.md +26 -26
- package/dist/skills/fluentcart-developer/references/restapi/operations/pdf-templates/download-pdf-preview.md +44 -44
- package/dist/skills/fluentcart-developer/references/restapi/operations/pdf-templates/get-factory-default-templates.md +19 -19
- package/dist/skills/fluentcart-developer/references/restapi/operations/pdf-templates/get-pdf-status.md +21 -21
- package/dist/skills/fluentcart-developer/references/restapi/operations/pdf-templates/get-pdf-template.md +26 -26
- package/dist/skills/fluentcart-developer/references/restapi/operations/pdf-templates/get-saved-templates.md +21 -21
- package/dist/skills/fluentcart-developer/references/restapi/operations/pdf-templates/get-seller-details.md +19 -19
- package/dist/skills/fluentcart-developer/references/restapi/operations/pdf-templates/list-pdf-templates.md +19 -19
- package/dist/skills/fluentcart-developer/references/restapi/operations/pdf-templates/save-pdf-template.md +53 -53
- package/dist/skills/fluentcart-developer/references/restapi/operations/pdf-templates/save-seller-details.md +97 -97
- package/dist/skills/fluentcart-developer/references/restapi/operations/products/add-product-terms.md +64 -64
- package/dist/skills/fluentcart-developer/references/restapi/operations/products/bulk-edit-fetch.md +30 -30
- package/dist/skills/fluentcart-developer/references/restapi/operations/products/bulk-insert-products.md +62 -62
- package/dist/skills/fluentcart-developer/references/restapi/operations/products/bulk-update-products.md +59 -59
- package/dist/skills/fluentcart-developer/references/restapi/operations/products/bulk-update-variants.md +83 -83
- package/dist/skills/fluentcart-developer/references/restapi/operations/products/change-integration-status.md +64 -64
- package/dist/skills/fluentcart-developer/references/restapi/operations/products/create-dummy-products.md +45 -45
- package/dist/skills/fluentcart-developer/references/restapi/operations/products/create-product.md +81 -81
- package/dist/skills/fluentcart-developer/references/restapi/operations/products/create-variation.md +181 -181
- package/dist/skills/fluentcart-developer/references/restapi/operations/products/delete-downloadable-file.md +27 -27
- package/dist/skills/fluentcart-developer/references/restapi/operations/products/delete-product-integration.md +30 -30
- package/dist/skills/fluentcart-developer/references/restapi/operations/products/delete-product.md +27 -27
- package/dist/skills/fluentcart-developer/references/restapi/operations/products/delete-taxonomy-term.md +55 -55
- package/dist/skills/fluentcart-developer/references/restapi/operations/products/delete-upgrade-path.md +27 -27
- package/dist/skills/fluentcart-developer/references/restapi/operations/products/delete-variation.md +27 -27
- package/dist/skills/fluentcart-developer/references/restapi/operations/products/do-bulk-action.md +56 -56
- package/dist/skills/fluentcart-developer/references/restapi/operations/products/duplicate-product.md +56 -56
- package/dist/skills/fluentcart-developer/references/restapi/operations/products/fetch-products-by-ids.md +26 -26
- package/dist/skills/fluentcart-developer/references/restapi/operations/products/fetch-taxonomy-terms.md +20 -20
- package/dist/skills/fluentcart-developer/references/restapi/operations/products/fetch-terms-by-parent.md +60 -60
- package/dist/skills/fluentcart-developer/references/restapi/operations/products/fetch-variations-by-ids.md +26 -26
- package/dist/skills/fluentcart-developer/references/restapi/operations/products/find-subscription-variants.md +26 -26
- package/dist/skills/fluentcart-developer/references/restapi/operations/products/get-bundle-info.md +27 -27
- package/dist/skills/fluentcart-developer/references/restapi/operations/products/get-downloadable-url.md +27 -27
- package/dist/skills/fluentcart-developer/references/restapi/operations/products/get-max-excerpt-word-count.md +20 -20
- package/dist/skills/fluentcart-developer/references/restapi/operations/products/get-pricing-widgets.md +27 -27
- package/dist/skills/fluentcart-developer/references/restapi/operations/products/get-product-integration-feeds.md +29 -29
- package/dist/skills/fluentcart-developer/references/restapi/operations/products/get-product-integration-settings.md +31 -31
- package/dist/skills/fluentcart-developer/references/restapi/operations/products/get-product-pricing.md +28 -28
- package/dist/skills/fluentcart-developer/references/restapi/operations/products/get-product.md +28 -28
- package/dist/skills/fluentcart-developer/references/restapi/operations/products/get-related-products.md +31 -31
- package/dist/skills/fluentcart-developer/references/restapi/operations/products/get-upgrade-settings.md +27 -27
- package/dist/skills/fluentcart-developer/references/restapi/operations/products/get-variation-upgrade-paths.md +28 -28
- package/dist/skills/fluentcart-developer/references/restapi/operations/products/group-bulk-update-variants.md +103 -103
- package/dist/skills/fluentcart-developer/references/restapi/operations/products/list-all-variants.md +26 -26
- package/dist/skills/fluentcart-developer/references/restapi/operations/products/list-product-variations.md +26 -26
- package/dist/skills/fluentcart-developer/references/restapi/operations/products/list-products.md +34 -34
- package/dist/skills/fluentcart-developer/references/restapi/operations/products/remove-shipping-class.md +27 -27
- package/dist/skills/fluentcart-developer/references/restapi/operations/products/remove-tax-class.md +27 -27
- package/dist/skills/fluentcart-developer/references/restapi/operations/products/save-bundle-info.md +56 -56
- package/dist/skills/fluentcart-developer/references/restapi/operations/products/save-product-integration.md +62 -62
- package/dist/skills/fluentcart-developer/references/restapi/operations/products/save-upgrade-path.md +78 -78
- package/dist/skills/fluentcart-developer/references/restapi/operations/products/search-product-variant-options.md +29 -29
- package/dist/skills/fluentcart-developer/references/restapi/operations/products/search-products-by-name.md +28 -28
- package/dist/skills/fluentcart-developer/references/restapi/operations/products/search-variants-by-name.md +28 -28
- package/dist/skills/fluentcart-developer/references/restapi/operations/products/set-variation-media.md +74 -74
- package/dist/skills/fluentcart-developer/references/restapi/operations/products/suggest-sku.md +28 -28
- package/dist/skills/fluentcart-developer/references/restapi/operations/products/sync-downloadable-files.md +134 -134
- package/dist/skills/fluentcart-developer/references/restapi/operations/products/sync-taxonomy-terms.md +61 -61
- package/dist/skills/fluentcart-developer/references/restapi/operations/products/toggle-product-tax-exemption.md +56 -56
- package/dist/skills/fluentcart-developer/references/restapi/operations/products/update-downloadable-file.md +98 -98
- package/dist/skills/fluentcart-developer/references/restapi/operations/products/update-inventory.md +56 -56
- package/dist/skills/fluentcart-developer/references/restapi/operations/products/update-long-desc-editor-mode.md +49 -49
- package/dist/skills/fluentcart-developer/references/restapi/operations/products/update-manage-stock.md +53 -53
- package/dist/skills/fluentcart-developer/references/restapi/operations/products/update-product-detail.md +58 -58
- package/dist/skills/fluentcart-developer/references/restapi/operations/products/update-product-pricing.md +225 -225
- package/dist/skills/fluentcart-developer/references/restapi/operations/products/update-shipping-class.md +49 -49
- package/dist/skills/fluentcart-developer/references/restapi/operations/products/update-tax-class.md +49 -49
- package/dist/skills/fluentcart-developer/references/restapi/operations/products/update-upgrade-path.md +78 -78
- package/dist/skills/fluentcart-developer/references/restapi/operations/products/update-variant-option.md +79 -79
- package/dist/skills/fluentcart-developer/references/restapi/operations/products/update-variant-tax-exemption.md +56 -56
- package/dist/skills/fluentcart-developer/references/restapi/operations/products/update-variation-pricing-table.md +49 -49
- package/dist/skills/fluentcart-developer/references/restapi/operations/products/update-variation.md +105 -105
- package/dist/skills/fluentcart-developer/references/restapi/operations/public-shop/get-product-views.md +34 -34
- package/dist/skills/fluentcart-developer/references/restapi/operations/public-shop/list-products.md +42 -42
- package/dist/skills/fluentcart-developer/references/restapi/operations/public-shop/search-products.md +30 -30
- package/dist/skills/fluentcart-developer/references/restapi/operations/reports/channel-rules.md +24 -24
- package/dist/skills/fluentcart-developer/references/restapi/operations/reports/country-heat-map.md +22 -22
- package/dist/skills/fluentcart-developer/references/restapi/operations/reports/coupon-overview.md +37 -37
- package/dist/skills/fluentcart-developer/references/restapi/operations/reports/coupons.md +36 -36
- package/dist/skills/fluentcart-developer/references/restapi/operations/reports/customer-insights.md +31 -31
- package/dist/skills/fluentcart-developer/references/restapi/operations/reports/customer-overview.md +36 -36
- package/dist/skills/fluentcart-developer/references/restapi/operations/reports/customer-repeat.md +35 -35
- package/dist/skills/fluentcart-developer/references/restapi/operations/reports/customer-segment-customers.md +36 -36
- package/dist/skills/fluentcart-developer/references/restapi/operations/reports/customer-segments.md +30 -30
- package/dist/skills/fluentcart-developer/references/restapi/operations/reports/customer-value.md +34 -34
- package/dist/skills/fluentcart-developer/references/restapi/operations/reports/dashboard-stats.md +30 -30
- package/dist/skills/fluentcart-developer/references/restapi/operations/reports/failed-orders.md +34 -34
- package/dist/skills/fluentcart-developer/references/restapi/operations/reports/fetch-new-vs-returning-customer.md +34 -34
- package/dist/skills/fluentcart-developer/references/restapi/operations/reports/fetch-report-by-day-and-hour.md +34 -34
- package/dist/skills/fluentcart-developer/references/restapi/operations/reports/fetch-report-meta.md +29 -29
- package/dist/skills/fluentcart-developer/references/restapi/operations/reports/fetch-top-sold-products.md +34 -34
- package/dist/skills/fluentcart-developer/references/restapi/operations/reports/future-renewals.md +31 -31
- package/dist/skills/fluentcart-developer/references/restapi/operations/reports/generate-retention-snapshots.md +24 -24
- package/dist/skills/fluentcart-developer/references/restapi/operations/reports/get-overview.md +30 -30
- package/dist/skills/fluentcart-developer/references/restapi/operations/reports/get-recent-activities.md +26 -26
- package/dist/skills/fluentcart-developer/references/restapi/operations/reports/get-recent-orders.md +20 -20
- package/dist/skills/fluentcart-developer/references/restapi/operations/reports/get-revenue.md +37 -37
- package/dist/skills/fluentcart-developer/references/restapi/operations/reports/installments-at-risk.md +35 -35
- package/dist/skills/fluentcart-developer/references/restapi/operations/reports/installments-variations.md +33 -33
- package/dist/skills/fluentcart-developer/references/restapi/operations/reports/installments.md +33 -33
- package/dist/skills/fluentcart-developer/references/restapi/operations/reports/item-count-distribution.md +34 -34
- package/dist/skills/fluentcart-developer/references/restapi/operations/reports/license-chart.md +30 -30
- package/dist/skills/fluentcart-developer/references/restapi/operations/reports/license-pie-chart.md +22 -22
- package/dist/skills/fluentcart-developer/references/restapi/operations/reports/license-summary.md +22 -22
- package/dist/skills/fluentcart-developer/references/restapi/operations/reports/locations.md +43 -43
- package/dist/skills/fluentcart-developer/references/restapi/operations/reports/order-chart.md +37 -37
- package/dist/skills/fluentcart-developer/references/restapi/operations/reports/order-completion-time.md +34 -34
- package/dist/skills/fluentcart-developer/references/restapi/operations/reports/order-mix.md +34 -34
- package/dist/skills/fluentcart-developer/references/restapi/operations/reports/order-value-distribution.md +34 -34
- package/dist/skills/fluentcart-developer/references/restapi/operations/reports/payment-methods-disputes.md +38 -38
- package/dist/skills/fluentcart-developer/references/restapi/operations/reports/payment-methods-methods.md +36 -36
- package/dist/skills/fluentcart-developer/references/restapi/operations/reports/payment-methods.md +37 -37
- package/dist/skills/fluentcart-developer/references/restapi/operations/reports/product-comparison-launch.md +33 -33
- package/dist/skills/fluentcart-developer/references/restapi/operations/reports/product-comparison.md +40 -40
- package/dist/skills/fluentcart-developer/references/restapi/operations/reports/product-detail.md +37 -37
- package/dist/skills/fluentcart-developer/references/restapi/operations/reports/product-sales.md +37 -37
- package/dist/skills/fluentcart-developer/references/restapi/operations/reports/refunds-overview.md +37 -37
- package/dist/skills/fluentcart-developer/references/restapi/operations/reports/retention-snapshots-step.md +45 -45
- package/dist/skills/fluentcart-developer/references/restapi/operations/reports/sales-growth-chart.md +35 -35
- package/dist/skills/fluentcart-developer/references/restapi/operations/reports/save-channel-rules.md +73 -73
- package/dist/skills/fluentcart-developer/references/restapi/operations/reports/source-channels.md +37 -37
- package/dist/skills/fluentcart-developer/references/restapi/operations/reports/sources.md +49 -49
- package/dist/skills/fluentcart-developer/references/restapi/operations/reports/subscription-cohorts.md +33 -33
- package/dist/skills/fluentcart-developer/references/restapi/operations/reports/subscription-health.md +30 -30
- package/dist/skills/fluentcart-developer/references/restapi/operations/reports/subscription-rebuys.md +37 -37
- package/dist/skills/fluentcart-developer/references/restapi/operations/reports/subscription-retention.md +34 -34
- package/dist/skills/fluentcart-developer/references/restapi/operations/reports/subscription-variations.md +22 -22
- package/dist/skills/fluentcart-developer/references/restapi/operations/reports/subscriptions-overview.md +37 -37
- package/dist/skills/fluentcart-developer/references/restapi/operations/reports/weeks-between-refund.md +34 -34
- package/dist/skills/fluentcart-developer/references/restapi/operations/roles-permissions/assign-role.md +48 -48
- package/dist/skills/fluentcart-developer/references/restapi/operations/roles-permissions/delete-role-assignment.md +47 -47
- package/dist/skills/fluentcart-developer/references/restapi/operations/roles-permissions/get-role.md +25 -25
- package/dist/skills/fluentcart-developer/references/restapi/operations/roles-permissions/list-managers.md +18 -18
- package/dist/skills/fluentcart-developer/references/restapi/operations/roles-permissions/list-roles.md +18 -18
- package/dist/skills/fluentcart-developer/references/restapi/operations/roles-permissions/search-users.md +25 -25
- package/dist/skills/fluentcart-developer/references/restapi/operations/roles-permissions/update-role.md +43 -43
- package/dist/skills/fluentcart-developer/references/restapi/operations/saved-views/create-saved-view.md +106 -106
- package/dist/skills/fluentcart-developer/references/restapi/operations/saved-views/delete-saved-view.md +26 -26
- package/dist/skills/fluentcart-developer/references/restapi/operations/saved-views/list-saved-views.md +25 -25
- package/dist/skills/fluentcart-developer/references/restapi/operations/saved-views/update-saved-view.md +83 -83
- package/dist/skills/fluentcart-developer/references/restapi/operations/settings/activate-payment-addon.md +44 -44
- package/dist/skills/fluentcart-developer/references/restapi/operations/settings/activate-plugin-addon.md +44 -44
- package/dist/skills/fluentcart-developer/references/restapi/operations/settings/change-storage-driver-status.md +56 -56
- package/dist/skills/fluentcart-developer/references/restapi/operations/settings/check-paypal-webhook.md +26 -26
- package/dist/skills/fluentcart-developer/references/restapi/operations/settings/create-storage-bucket.md +63 -63
- package/dist/skills/fluentcart-developer/references/restapi/operations/settings/disconnect-payment-method.md +55 -55
- package/dist/skills/fluentcart-developer/references/restapi/operations/settings/exchange-paypal-seller-auth-token.md +62 -62
- package/dist/skills/fluentcart-developer/references/restapi/operations/settings/get-active-storage-drivers.md +20 -20
- package/dist/skills/fluentcart-developer/references/restapi/operations/settings/get-checkout-fields.md +22 -22
- package/dist/skills/fluentcart-developer/references/restapi/operations/settings/get-email-shortcodes.md +20 -20
- package/dist/skills/fluentcart-developer/references/restapi/operations/settings/get-mcp-config-snippets.md +26 -26
- package/dist/skills/fluentcart-developer/references/restapi/operations/settings/get-mcp-status.md +20 -20
- package/dist/skills/fluentcart-developer/references/restapi/operations/settings/get-module-settings.md +20 -20
- package/dist/skills/fluentcart-developer/references/restapi/operations/settings/get-payment-method-connection-info.md +26 -26
- package/dist/skills/fluentcart-developer/references/restapi/operations/settings/get-payment-method-settings.md +26 -26
- package/dist/skills/fluentcart-developer/references/restapi/operations/settings/get-permissions.md +22 -22
- package/dist/skills/fluentcart-developer/references/restapi/operations/settings/get-plugin-addons.md +20 -20
- package/dist/skills/fluentcart-developer/references/restapi/operations/settings/get-storage-driver-settings.md +27 -27
- package/dist/skills/fluentcart-developer/references/restapi/operations/settings/get-store-settings.md +26 -26
- package/dist/skills/fluentcart-developer/references/restapi/operations/settings/install-mcp-adapter.md +21 -21
- package/dist/skills/fluentcart-developer/references/restapi/operations/settings/install-payment-addon.md +60 -60
- package/dist/skills/fluentcart-developer/references/restapi/operations/settings/install-plugin-addon.md +64 -64
- package/dist/skills/fluentcart-developer/references/restapi/operations/settings/list-all-payment-methods.md +20 -20
- package/dist/skills/fluentcart-developer/references/restapi/operations/settings/list-all-storage-drivers.md +20 -20
- package/dist/skills/fluentcart-developer/references/restapi/operations/settings/list-storage-buckets.md +67 -67
- package/dist/skills/fluentcart-developer/references/restapi/operations/settings/reorder-payment-methods.md +55 -55
- package/dist/skills/fluentcart-developer/references/restapi/operations/settings/reset-storage-driver-settings.md +45 -45
- package/dist/skills/fluentcart-developer/references/restapi/operations/settings/save-checkout-fields.md +133 -133
- package/dist/skills/fluentcart-developer/references/restapi/operations/settings/save-confirmation-settings.md +68 -68
- package/dist/skills/fluentcart-developer/references/restapi/operations/settings/save-module-settings.md +68 -68
- package/dist/skills/fluentcart-developer/references/restapi/operations/settings/save-payment-method-design.md +67 -67
- package/dist/skills/fluentcart-developer/references/restapi/operations/settings/save-payment-method-settings.md +58 -58
- package/dist/skills/fluentcart-developer/references/restapi/operations/settings/save-permissions.md +68 -68
- package/dist/skills/fluentcart-developer/references/restapi/operations/settings/save-storage-driver-settings.md +62 -62
- package/dist/skills/fluentcart-developer/references/restapi/operations/settings/save-store-settings.md +239 -239
- package/dist/skills/fluentcart-developer/references/restapi/operations/settings/setup-paypal-webhook.md +48 -48
- package/dist/skills/fluentcart-developer/references/restapi/operations/settings/toggle-mcp.md +40 -40
- package/dist/skills/fluentcart-developer/references/restapi/operations/settings/verify-storage-driver-connection.md +62 -62
- package/dist/skills/fluentcart-developer/references/restapi/operations/settings/verify-turnstile-keys.md +55 -55
- package/dist/skills/fluentcart-developer/references/restapi/operations/shipping/create-shipping-class.md +73 -73
- package/dist/skills/fluentcart-developer/references/restapi/operations/shipping/create-shipping-method.md +110 -110
- package/dist/skills/fluentcart-developer/references/restapi/operations/shipping/create-shipping-zone.md +56 -56
- package/dist/skills/fluentcart-developer/references/restapi/operations/shipping/delete-shipping-class.md +29 -29
- package/dist/skills/fluentcart-developer/references/restapi/operations/shipping/delete-shipping-method.md +29 -29
- package/dist/skills/fluentcart-developer/references/restapi/operations/shipping/delete-shipping-zone.md +29 -29
- package/dist/skills/fluentcart-developer/references/restapi/operations/shipping/get-shipping-class-profile.md +30 -30
- package/dist/skills/fluentcart-developer/references/restapi/operations/shipping/get-shipping-class.md +29 -29
- package/dist/skills/fluentcart-developer/references/restapi/operations/shipping/get-shipping-packages.md +22 -22
- package/dist/skills/fluentcart-developer/references/restapi/operations/shipping/get-shipping-zone.md +27 -27
- package/dist/skills/fluentcart-developer/references/restapi/operations/shipping/get-zone-countries.md +22 -22
- package/dist/skills/fluentcart-developer/references/restapi/operations/shipping/get-zone-states.md +28 -28
- package/dist/skills/fluentcart-developer/references/restapi/operations/shipping/list-shipping-classes.md +31 -31
- package/dist/skills/fluentcart-developer/references/restapi/operations/shipping/list-shipping-zones.md +31 -31
- package/dist/skills/fluentcart-developer/references/restapi/operations/shipping/save-shipping-packages.md +112 -112
- package/dist/skills/fluentcart-developer/references/restapi/operations/shipping/update-shipping-class.md +79 -79
- package/dist/skills/fluentcart-developer/references/restapi/operations/shipping/update-shipping-method.md +113 -113
- package/dist/skills/fluentcart-developer/references/restapi/operations/shipping/update-shipping-zone.md +62 -62
- package/dist/skills/fluentcart-developer/references/restapi/operations/shipping/update-zone-order.md +52 -52
- package/dist/skills/fluentcart-developer/references/restapi/operations/subscriptions/cancel-auto-renew.md +30 -30
- package/dist/skills/fluentcart-developer/references/restapi/operations/subscriptions/cancel-subscription.md +52 -52
- package/dist/skills/fluentcart-developer/references/restapi/operations/subscriptions/confirm-subscription-switch.md +70 -70
- package/dist/skills/fluentcart-developer/references/restapi/operations/subscriptions/fetch-subscription-remote.md +28 -28
- package/dist/skills/fluentcart-developer/references/restapi/operations/subscriptions/generate-early-payment-link.md +29 -29
- package/dist/skills/fluentcart-developer/references/restapi/operations/subscriptions/get-customer-subscription.md +27 -27
- package/dist/skills/fluentcart-developer/references/restapi/operations/subscriptions/get-or-create-plan.md +69 -69
- package/dist/skills/fluentcart-developer/references/restapi/operations/subscriptions/get-setup-intent-attempts.md +30 -30
- package/dist/skills/fluentcart-developer/references/restapi/operations/subscriptions/get-subscription.md +28 -28
- package/dist/skills/fluentcart-developer/references/restapi/operations/subscriptions/initiate-early-payment.md +31 -31
- package/dist/skills/fluentcart-developer/references/restapi/operations/subscriptions/list-customer-subscriptions.md +27 -27
- package/dist/skills/fluentcart-developer/references/restapi/operations/subscriptions/list-subscriptions.md +39 -39
- package/dist/skills/fluentcart-developer/references/restapi/operations/subscriptions/pause-subscription.md +28 -28
- package/dist/skills/fluentcart-developer/references/restapi/operations/subscriptions/reactivate-subscription.md +28 -28
- package/dist/skills/fluentcart-developer/references/restapi/operations/subscriptions/resume-subscription.md +28 -28
- package/dist/skills/fluentcart-developer/references/restapi/operations/subscriptions/switch-payment-method.md +70 -70
- package/dist/skills/fluentcart-developer/references/restapi/operations/subscriptions/update-payment-method.md +69 -69
- package/dist/skills/fluentcart-developer/references/restapi/operations/subscriptions/update-vendor-ids.md +56 -56
- package/dist/skills/fluentcart-developer/references/restapi/operations/subscriptions/verify-vendor-ids.md +56 -56
- package/dist/skills/fluentcart-developer/references/restapi/operations/tax/create-tax-class.md +51 -51
- package/dist/skills/fluentcart-developer/references/restapi/operations/tax/create-tax-rate.md +117 -117
- package/dist/skills/fluentcart-developer/references/restapi/operations/tax/delete-product-override.md +27 -27
- package/dist/skills/fluentcart-developer/references/restapi/operations/tax/delete-shipping-tax-override.md +27 -27
- package/dist/skills/fluentcart-developer/references/restapi/operations/tax/delete-tax-class.md +28 -28
- package/dist/skills/fluentcart-developer/references/restapi/operations/tax/delete-tax-rate.md +27 -27
- package/dist/skills/fluentcart-developer/references/restapi/operations/tax/get-country-tax-id.md +27 -27
- package/dist/skills/fluentcart-developer/references/restapi/operations/tax/get-country-tax-rates.md +28 -28
- package/dist/skills/fluentcart-developer/references/restapi/operations/tax/get-eu-vat-product-overrides.md +20 -20
- package/dist/skills/fluentcart-developer/references/restapi/operations/tax/get-oss-country-rates.md +20 -20
- package/dist/skills/fluentcart-developer/references/restapi/operations/tax/get-preconfigured-tax-rates.md +20 -20
- package/dist/skills/fluentcart-developer/references/restapi/operations/tax/get-product-overrides.md +27 -27
- package/dist/skills/fluentcart-developer/references/restapi/operations/tax/get-tax-settings.md +20 -20
- package/dist/skills/fluentcart-developer/references/restapi/operations/tax/list-all-tax-rates.md +20 -20
- package/dist/skills/fluentcart-developer/references/restapi/operations/tax/list-tax-classes.md +20 -20
- package/dist/skills/fluentcart-developer/references/restapi/operations/tax/list-tax-records.md +37 -37
- package/dist/skills/fluentcart-developer/references/restapi/operations/tax/mark-taxes-as-filed.md +58 -58
- package/dist/skills/fluentcart-developer/references/restapi/operations/tax/reset-eu-vat-rates.md +21 -21
- package/dist/skills/fluentcart-developer/references/restapi/operations/tax/save-configured-countries.md +57 -57
- package/dist/skills/fluentcart-developer/references/restapi/operations/tax/save-country-tax-id.md +50 -50
- package/dist/skills/fluentcart-developer/references/restapi/operations/tax/save-eu-vat-cross-border-settings.md +127 -127
- package/dist/skills/fluentcart-developer/references/restapi/operations/tax/save-oss-country-rates.md +100 -100
- package/dist/skills/fluentcart-developer/references/restapi/operations/tax/save-product-override.md +110 -110
- package/dist/skills/fluentcart-developer/references/restapi/operations/tax/save-shipping-tax-override.md +52 -52
- package/dist/skills/fluentcart-developer/references/restapi/operations/tax/save-tax-settings.md +166 -166
- package/dist/skills/fluentcart-developer/references/restapi/operations/tax/update-country-status.md +54 -54
- package/dist/skills/fluentcart-developer/references/restapi/operations/tax/update-tax-rate.md +116 -116
- package/dist/skills/fluentcart-developer/references/restapi/order-bumps.md +433 -433
- package/dist/skills/fluentcart-developer/references/restapi/orders.md +1212 -1212
- package/dist/skills/fluentcart-developer/references/restapi/pdf-templates.md +212 -212
- package/dist/skills/fluentcart-developer/references/restapi/products.md +2485 -2485
- package/dist/skills/fluentcart-developer/references/restapi/public-shop.md +191 -191
- package/dist/skills/fluentcart-developer/references/restapi/reports.md +3773 -3773
- package/dist/skills/fluentcart-developer/references/restapi/roles.md +403 -403
- package/dist/skills/fluentcart-developer/references/restapi/saved-views.md +136 -136
- package/dist/skills/fluentcart-developer/references/restapi/settings.md +1423 -1423
- package/dist/skills/fluentcart-developer/references/restapi/shipping.md +905 -905
- package/dist/skills/fluentcart-developer/references/restapi/subscriptions.md +1169 -1169
- package/dist/skills/fluentcart-developer/references/restapi/tax.md +1551 -1551
- package/dist/skills/fluentcart-developer/references/restapi.md +127 -127
- package/dist/skills/fluentcart-developer/scripts/cli.js +1 -1
- package/dist/version.d.ts +1 -1
- package/dist/version.js +1 -1
- package/package.json +66 -65
|
@@ -1,528 +1,528 @@
|
|
|
1
|
-
# Subscription Model
|
|
2
|
-
|
|
3
|
-
| DB Table Name | {wp_db_prefix}_fct_subscriptions |
|
|
4
|
-
| --- | --- |
|
|
5
|
-
| Schema | [Check Schema](/database/schema.md#fct-subscriptions-table) |
|
|
6
|
-
| Source File | fluent-cart/app/Models/Subscription.php |
|
|
7
|
-
| Name Space | FluentCart\App\Models |
|
|
8
|
-
| Class | FluentCart\App\Models\Subscription |
|
|
9
|
-
|
|
10
|
-
## Traits
|
|
11
|
-
|
|
12
|
-
| Trait | Provides |
|
|
13
|
-
| --- | --- |
|
|
14
|
-
| `HasActivity` | `activities()` morphMany relationship to `Activity` model |
|
|
15
|
-
| `CanUpdateBatch` | `scopeBatchUpdate` scope for bulk-updating rows in one query |
|
|
16
|
-
|
|
17
|
-
## Attributes
|
|
18
|
-
|
|
19
|
-
| Attribute | Data Type | Comment |
|
|
20
|
-
| --- | --- | --- |
|
|
21
|
-
| id | Integer | Primary Key |
|
|
22
|
-
| uuid | String | Unique identifier (auto-generated on create via `md5(time() . wp_generate_uuid4())`) |
|
|
23
|
-
| customer_id | Integer | Customer ID |
|
|
24
|
-
| parent_order_id | Integer | Parent order ID |
|
|
25
|
-
| product_id | Integer | Product ID |
|
|
26
|
-
| item_name | String | Item name |
|
|
27
|
-
| variation_id | Integer | Product variation ID |
|
|
28
|
-
| billing_interval | String | Billing interval (daily, weekly, monthly, quarterly, half_yearly, yearly) |
|
|
29
|
-
| signup_fee | Integer | Signup fee in cents |
|
|
30
|
-
| quantity | Integer | Quantity |
|
|
31
|
-
| recurring_amount | Integer | Recurring amount in cents |
|
|
32
|
-
| recurring_tax_total | Integer | Recurring tax total in cents |
|
|
33
|
-
| initial_tax_total | Integer | Tax charged on the first payment, in cents |
|
|
34
|
-
| recurring_total | Integer | Recurring total in cents |
|
|
35
|
-
| bill_times | Integer | Number of times to bill (0 = unlimited) |
|
|
36
|
-
| bill_count | Integer | Number of times billed |
|
|
37
|
-
| expire_at | Date Time | Expiration date |
|
|
38
|
-
| trial_ends_at | Date Time | Trial end date |
|
|
39
|
-
| canceled_at | Date Time | Cancellation date |
|
|
40
|
-
| restored_at | Date Time | Restoration date |
|
|
41
|
-
| collection_method | String | Collection method |
|
|
42
|
-
| trial_days | Integer | Trial days |
|
|
43
|
-
| vendor_customer_id | String | Vendor customer ID |
|
|
44
|
-
| vendor_plan_id | String | Vendor plan ID |
|
|
45
|
-
| vendor_subscription_id | String | Vendor subscription ID |
|
|
46
|
-
| next_billing_date | Date Time | Next billing date |
|
|
47
|
-
| status | String | Subscription status |
|
|
48
|
-
| original_plan | JSON | Original plan data |
|
|
49
|
-
| vendor_response | JSON | Vendor response data |
|
|
50
|
-
| current_payment_method | String | Current payment method |
|
|
51
|
-
| config | JSON | Subscription configuration (auto-encoded/decoded) |
|
|
52
|
-
| created_at | Date Time | Creation timestamp |
|
|
53
|
-
| updated_at | Date Time | Last update timestamp |
|
|
54
|
-
|
|
55
|
-
## Appended Attributes
|
|
56
|
-
|
|
57
|
-
These virtual attributes are automatically appended when the model is serialized to an array or JSON.
|
|
58
|
-
|
|
59
|
-
| Attribute | Type | Description |
|
|
60
|
-
| --- | --- | --- |
|
|
61
|
-
| url | String | Remote subscription URL from payment gateway (via `fluent_cart/subscription/url_{method}` filter) |
|
|
62
|
-
| payment_info | String | Human-readable subscription billing summary (interval, amount, trial) |
|
|
63
|
-
| billingInfo | Array | Active payment method details from subscription meta |
|
|
64
|
-
| overridden_status | String | Display-corrected status (handles simulated trial days and actual trial period detection) |
|
|
65
|
-
| currency | String | Uppercase currency code. A real column, also exposed through an accessor that falls back to config, the parent order, then the base currency |
|
|
66
|
-
| reactivate_url | String | Frontend URL for reactivating a canceled/expired subscription |
|
|
67
|
-
|
|
68
|
-
## Usage
|
|
69
|
-
|
|
70
|
-
Please check [Model Basic](/database/models.md) for Common methods.
|
|
71
|
-
|
|
72
|
-
### Accessing Attributes
|
|
73
|
-
|
|
74
|
-
```
|
|
75
|
-
$subscription = FluentCart\App\Models\Subscription::find(1);
|
|
76
|
-
|
|
77
|
-
$subscription->id; // returns subscription ID
|
|
78
|
-
$subscription->status; // returns subscription status
|
|
79
|
-
$subscription->recurring_total; // returns recurring total in cents
|
|
80
|
-
$subscription->billing_interval; // returns billing interval
|
|
81
|
-
$subscription->next_billing_date; // returns next billing date
|
|
82
|
-
$subscription->currency; // returns currency code (appended attribute)
|
|
83
|
-
$subscription->url; // returns remote subscription URL (appended attribute)
|
|
84
|
-
$subscription->overridden_status; // returns display-corrected status (appended attribute)
|
|
85
|
-
```
|
|
86
|
-
|
|
87
|
-
## Scopes
|
|
88
|
-
|
|
89
|
-
### visibleToCustomer()
|
|
90
|
-
|
|
91
|
-
Limits results to subscriptions a customer should see in their portal. Excludes `pending` and `intended` rows unless they have billed at least once (`bill_count > 0`) or carry a `reactivation_order_id` in `config`.
|
|
92
|
-
|
|
93
|
-
```
|
|
94
|
-
$subscriptions = $customer->subscriptions()->visibleToCustomer()->get();
|
|
95
|
-
```
|
|
96
|
-
|
|
97
|
-
### ofPlanType($planType)
|
|
98
|
-
|
|
99
|
-
Filters by plan shape. `'installment'` matches `bill_times > 0`; `'recurring'` matches `bill_times
|
|
100
|
-
|
|
101
|
-
```
|
|
102
|
-
$subscription = FluentCart\App\Models\Subscription::find(1);
|
|
103
|
-
$subscription->addLog('Status Changed', 'Subscription activated', 'info');
|
|
104
|
-
$subscription->addLog('Payment Failed', 'Card declined', 'error', 'system');
|
|
105
|
-
```
|
|
106
|
-
|
|
107
|
-
### getDownloads()
|
|
108
|
-
|
|
109
|
-
Get downloadable files associated with this subscription's product. Only returns downloads when the subscription has a `variation_id` and status is `active`. Filters downloads by the subscription's variation ID.
|
|
110
|
-
|
|
111
|
-
- Returns `Collection|Array` - Collection of `ProductDownload` models with product and variation titles, or empty array
|
|
112
|
-
|
|
113
|
-
```
|
|
114
|
-
$subscription = FluentCart\App\Models\Subscription::find(1);
|
|
115
|
-
$downloads = $subscription->getDownloads();
|
|
116
|
-
```
|
|
117
|
-
|
|
118
|
-
### getLatestTransaction()
|
|
119
|
-
|
|
120
|
-
Get the most recent charge transaction for this subscription.
|
|
121
|
-
|
|
122
|
-
- Returns `FluentCart\App\Models\OrderTransaction|null` - Latest charge transaction or null
|
|
123
|
-
|
|
124
|
-
```
|
|
125
|
-
$subscription = FluentCart\App\Models\Subscription::find(1);
|
|
126
|
-
$transaction = $subscription->getLatestTransaction();
|
|
127
|
-
```
|
|
128
|
-
|
|
129
|
-
### canUpgrade()
|
|
130
|
-
|
|
131
|
-
Check if the subscription can be upgraded. Requires a `variant_upgrade_path` meta entry for the current variation and the subscription must be `active` or `trialing`.
|
|
132
|
-
|
|
133
|
-
- Returns `Boolean` - True if upgrade path exists and status allows it
|
|
134
|
-
|
|
135
|
-
```
|
|
136
|
-
$subscription = FluentCart\App\Models\Subscription::find(1);
|
|
137
|
-
$canUpgrade = $subscription->canUpgrade();
|
|
138
|
-
```
|
|
139
|
-
|
|
140
|
-
### canUpdatePaymentMethod()
|
|
141
|
-
|
|
142
|
-
Check if the payment method can be updated (card update). The current payment gateway must support the `card_update` feature and the subscription must be in one of the allowed statuses: `active`, `trialing`, `paused`, `intended`, `past_due`, `failing`, or `expiring`.
|
|
143
|
-
|
|
144
|
-
- Returns `Boolean` - True if payment method can be updated
|
|
145
|
-
|
|
146
|
-
```
|
|
147
|
-
$subscription = FluentCart\App\Models\Subscription::find(1);
|
|
148
|
-
$canUpdate = $subscription->canUpdatePaymentMethod();
|
|
149
|
-
```
|
|
150
|
-
|
|
151
|
-
### canSwitchPaymentMethod()
|
|
152
|
-
|
|
153
|
-
Store-billed subscriptions — those where `usesRenewalEngine()` is true, i.e. `collection_method` of `manual` or `system` — always return `false`. Switching moves a subscription onto another gateway's vendor subscription, which would bill it a second time alongside the invoice engine. Those customers change the card on file through `canUpdatePaymentMethod()` instead.
|
|
154
|
-
|
|
155
|
-
Check if the payment method can be switched to a different gateway entirely. The current gateway must support the `switch_payment_method` feature, and the subscription must be `active`, `trialing`, or `paused`.
|
|
156
|
-
|
|
157
|
-
- Returns `Boolean` - True if payment method can be switched
|
|
158
|
-
|
|
159
|
-
```
|
|
160
|
-
$subscription = FluentCart\App\Models\Subscription::find(1);
|
|
161
|
-
$canSwitch = $subscription->canSwitchPaymentMethod();
|
|
162
|
-
```
|
|
163
|
-
|
|
164
|
-
### switchablePaymentMethods()
|
|
165
|
-
|
|
166
|
-
Get the list of payment gateways that can be switched to from the current gateway.
|
|
167
|
-
|
|
168
|
-
- Returns `Array` - Array of supported gateway identifiers, or empty array if switching is not supported
|
|
169
|
-
|
|
170
|
-
```
|
|
171
|
-
$subscription = FluentCart\App\Models\Subscription::find(1);
|
|
172
|
-
$methods = $subscription->switchablePaymentMethods();
|
|
173
|
-
// e.g., ['stripe', 'paypal']
|
|
174
|
-
```
|
|
175
|
-
|
|
176
|
-
### canReactivate()
|
|
177
|
-
|
|
178
|
-
Check if the subscription can be reactivated. Returns empty string (falsy) if:
|
|
179
|
-
|
|
180
|
-
- FluentCart Pro is not active
|
|
181
|
-
- The subscription was upgraded to another subscription
|
|
182
|
-
- The recurring amount is zero or negative
|
|
183
|
-
- The cancellation reason is `refunded`
|
|
184
|
-
|
|
185
|
-
Otherwise checks if status is one of: `canceled`, `failing`, `expired`, `paused`, `expiring`, or `past_due`.
|
|
186
|
-
|
|
187
|
-
- Returns `Mixed` - Filtered boolean/string value (empty string if cannot reactivate, truthy if can). Result is filtered via `fluent_cart/subscription/can_reactivate`.
|
|
188
|
-
|
|
189
|
-
```
|
|
190
|
-
$subscription = FluentCart\App\Models\Subscription::find(1);
|
|
191
|
-
if ($subscription->canReactivate()) {
|
|
192
|
-
// subscription can be reactivated
|
|
193
|
-
}
|
|
194
|
-
```
|
|
195
|
-
|
|
196
|
-
### getReactivateUrl()
|
|
197
|
-
|
|
198
|
-
Get the frontend URL for reactivating a canceled or expired subscription. Returns empty string if the subscription cannot be reactivated.
|
|
199
|
-
|
|
200
|
-
- Returns `String` - Reactivation URL with `fluent-cart=reactivate-subscription` query parameter, or empty string
|
|
201
|
-
|
|
202
|
-
```
|
|
203
|
-
$subscription = FluentCart\App\Models\Subscription::find(1);
|
|
204
|
-
$reactivateUrl = $subscription->getReactivateUrl();
|
|
205
|
-
```
|
|
206
|
-
|
|
207
|
-
### getViewUrl($type = 'customer')
|
|
208
|
-
|
|
209
|
-
Get the subscription view URL for the customer portal or admin dashboard.
|
|
210
|
-
|
|
211
|
-
- Parameters: `$type` (String) - View type: `'customer'` (default) for the customer portal, or `'admin'` for the admin dashboard
|
|
212
|
-
- Returns `String` - View URL
|
|
213
|
-
|
|
214
|
-
```
|
|
215
|
-
$subscription = FluentCart\App\Models\Subscription::find(1);
|
|
216
|
-
$customerUrl = $subscription->getViewUrl(); // customer portal URL
|
|
217
|
-
$adminUrl = $subscription->getViewUrl('admin'); // admin dashboard URL
|
|
218
|
-
```
|
|
219
|
-
|
|
220
|
-
### hasAccessValidity()
|
|
221
|
-
|
|
222
|
-
Check if the subscription currently grants access. Returns true for `active`, `trialing`, and `completed` statuses. Returns false for `expired`, `past_due`, `intended`, and `pending`. For other statuses (e.g., `canceled`, `failing`, `paused`, `expiring`), checks whether the next billing date (or guessed billing date) is still in the future.
|
|
223
|
-
|
|
224
|
-
- Returns `Boolean` - True if the subscription has valid access
|
|
225
|
-
|
|
226
|
-
```
|
|
227
|
-
$subscription = FluentCart\App\Models\Subscription::find(1);
|
|
228
|
-
$hasAccess = $subscription->hasAccessValidity();
|
|
229
|
-
```
|
|
230
|
-
|
|
231
|
-
### reSyncFromRemote()
|
|
232
|
-
|
|
233
|
-
Re-sync subscription data from the remote payment gateway. The gateway must support the `subscriptions` feature.
|
|
234
|
-
|
|
235
|
-
- Returns `Mixed` - Sync result from the gateway, or `WP_Error` if the payment method does not support remote resync
|
|
236
|
-
|
|
237
|
-
```
|
|
238
|
-
$subscription = FluentCart\App\Models\Subscription::find(1);
|
|
239
|
-
$result = $subscription->reSyncFromRemote();
|
|
240
|
-
if (is_wp_error($result)) {
|
|
241
|
-
// handle error
|
|
242
|
-
}
|
|
243
|
-
```
|
|
244
|
-
|
|
245
|
-
### cancelRemoteSubscription($args = [])
|
|
246
|
-
|
|
247
|
-
Cancel the subscription both remotely (at the payment gateway) and locally. Updates the status to `canceled`, sets `canceled_at`, stores the cancellation reason in config, and dispatches the `SubscriptionCanceled` event.
|
|
248
|
-
|
|
249
|
-
- Parameters: `$args` (Array) - Cancellation arguments: `reason` (String) - Cancellation reason (stored in config, default: `''`)
|
|
250
|
-
- `fire_hooks` (Boolean) - Whether to dispatch the `SubscriptionCanceled` event (default: `true`)
|
|
251
|
-
- `note` (String) - Cancellation note (saved to order, default: `''`)
|
|
252
|
-
|
|
253
|
-
Returns `Array|WP_Error` - Array with `subscription` and `vendor_result` keys on success
|
|
254
|
-
|
|
255
|
-
```
|
|
256
|
-
$subscription = FluentCart\App\Models\Subscription::find(1);
|
|
257
|
-
$result = $subscription->cancelRemoteSubscription([
|
|
258
|
-
'reason' => 'Customer request',
|
|
259
|
-
'fire_hooks' => true,
|
|
260
|
-
'note' => 'Cancelled by customer'
|
|
261
|
-
]);
|
|
262
|
-
```
|
|
263
|
-
|
|
264
|
-
### getCurrentRenewalAmount()
|
|
265
|
-
|
|
266
|
-
Get the current renewal amount. Checks `config.current_renewal_amount` first (used when the renewal amount differs from the base recurring total, e.g., after a plan change), then falls back to `recurring_total`.
|
|
267
|
-
|
|
268
|
-
- Returns `Integer` - Current renewal amount in cents
|
|
269
|
-
|
|
270
|
-
```
|
|
271
|
-
$subscription = FluentCart\App\Models\Subscription::find(1);
|
|
272
|
-
$amount = $subscription->getCurrentRenewalAmount();
|
|
273
|
-
```
|
|
274
|
-
|
|
275
|
-
### getRequiredBillTimes()
|
|
276
|
-
|
|
277
|
-
Get the number of remaining billing cycles. If `bill_times` is 0, returns 0 (unlimited). If the calculated remaining count is zero or negative, it re-verifies against actual successful transactions and early payment history, correcting `bill_count` if needed. Returns -1 if billing is truly complete after verification.
|
|
278
|
-
|
|
279
|
-
- Returns `Integer` - Remaining bill times (0 = unlimited, -1 = completed)
|
|
280
|
-
|
|
281
|
-
```
|
|
282
|
-
$subscription = FluentCart\App\Models\Subscription::find(1);
|
|
283
|
-
$billTimes = $subscription->getRequiredBillTimes();
|
|
284
|
-
```
|
|
285
|
-
|
|
286
|
-
### getReactivationTrialDays()
|
|
287
|
-
|
|
288
|
-
Get the number of trial days to apply when reactivating this subscription. If the subscription still has valid access (i.e., the billing period has not fully elapsed), the remaining days are returned as trial days so the customer is not double-charged.
|
|
289
|
-
|
|
290
|
-
- Returns `Integer` - Number of trial days for reactivation (0 if no remaining validity)
|
|
291
|
-
|
|
292
|
-
```
|
|
293
|
-
$subscription = FluentCart\App\Models\Subscription::find(1);
|
|
294
|
-
$trialDays = $subscription->getReactivationTrialDays();
|
|
295
|
-
```
|
|
296
|
-
|
|
297
|
-
### guessNextBillingDate($forced = false)
|
|
298
|
-
|
|
299
|
-
Calculate the next billing date when it is not already set (or when forced). Uses the last successful order's creation date plus the billing interval. For initial orders with trial days, adds trial days instead.
|
|
300
|
-
|
|
301
|
-
- Parameters: `$forced` (Boolean) - Force recalculation even if `next_billing_date` is already set (default: `false`)
|
|
302
|
-
- Returns `String` - Next billing date in `Y-m-d H:i:s` GMT format
|
|
303
|
-
|
|
304
|
-
```
|
|
305
|
-
$subscription = FluentCart\App\Models\Subscription::find(1);
|
|
306
|
-
$nextBillingDate = $subscription->guessNextBillingDate();
|
|
307
|
-
$forcedDate = $subscription->guessNextBillingDate(true); // force recalculation
|
|
308
|
-
```
|
|
309
|
-
|
|
310
|
-
### checkAndExpireSubscriptions($batchSize = 100) (static)
|
|
311
|
-
|
|
312
|
-
Check and expire subscriptions that have missed payments beyond their grace period. Called by the hourly scheduler. Processes `active`, `trialing`, and `canceled` subscriptions whose `next_billing_date` is past the grace period threshold. Grace periods vary by billing interval (e.g., 1 day for daily, 3 for weekly, 7 for monthly, 15 for quarterly/half_yearly/yearly).
|
|
313
|
-
|
|
314
|
-
For active/trialing subscriptions, status is changed to `expired`. For canceled subscriptions, only `next_billing_date` is cleared (status remains canceled). Dispatches `SubscriptionValidityExpired` event for each affected subscription.
|
|
315
|
-
|
|
316
|
-
- Parameters: `$batchSize` (Integer) - Number of subscriptions to process per batch (default: `100`)
|
|
317
|
-
- Returns `Array` - Statistics with keys: `checked`, `validity_expired`, `batches`
|
|
318
|
-
|
|
319
|
-
```
|
|
320
|
-
use FluentCart\App\Models\Subscription;
|
|
321
|
-
|
|
322
|
-
$stats = Subscription::checkAndExpireSubscriptions(50);
|
|
323
|
-
// $stats = ['checked' => 200, 'validity_expired' => 5, 'batches' => 4]
|
|
324
|
-
```
|
|
325
|
-
|
|
326
|
-
## Relations
|
|
327
|
-
|
|
328
|
-
This model has the following relationships that you can use.
|
|
329
|
-
|
|
330
|
-
### meta
|
|
331
|
-
|
|
332
|
-
Access the subscription metadata.
|
|
333
|
-
|
|
334
|
-
- Relation type: `HasMany`
|
|
335
|
-
- Returns `Collection` of `FluentCart\App\Models\SubscriptionMeta`
|
|
336
|
-
|
|
337
|
-
```
|
|
338
|
-
$subscription = FluentCart\App\Models\Subscription::find(1);
|
|
339
|
-
$meta = $subscription->meta;
|
|
340
|
-
```
|
|
341
|
-
|
|
342
|
-
### customer
|
|
343
|
-
|
|
344
|
-
Access the customer.
|
|
345
|
-
|
|
346
|
-
- Relation type: `BelongsTo`
|
|
347
|
-
- Foreign key: `customer_id`
|
|
348
|
-
- Returns `FluentCart\App\Models\Customer`
|
|
349
|
-
|
|
350
|
-
```
|
|
351
|
-
$subscription = FluentCart\App\Models\Subscription::find(1);
|
|
352
|
-
$customer = $subscription->customer;
|
|
353
|
-
```
|
|
354
|
-
|
|
355
|
-
### product
|
|
356
|
-
|
|
357
|
-
Access the product.
|
|
358
|
-
|
|
359
|
-
- Relation type: `BelongsTo`
|
|
360
|
-
- Foreign key: `product_id` -> `ID`
|
|
361
|
-
- Returns `FluentCart\App\Models\Product`
|
|
362
|
-
|
|
363
|
-
```
|
|
364
|
-
$subscription = FluentCart\App\Models\Subscription::find(1);
|
|
365
|
-
$product = $subscription->product;
|
|
366
|
-
```
|
|
367
|
-
|
|
368
|
-
### variation
|
|
369
|
-
|
|
370
|
-
Access the product variation.
|
|
371
|
-
|
|
372
|
-
- Relation type: `BelongsTo`
|
|
373
|
-
- Foreign key: `variation_id`
|
|
374
|
-
- Returns `FluentCart\App\Models\ProductVariation`
|
|
375
|
-
|
|
376
|
-
```
|
|
377
|
-
$subscription = FluentCart\App\Models\Subscription::find(1);
|
|
378
|
-
$variation = $subscription->variation;
|
|
379
|
-
```
|
|
380
|
-
|
|
381
|
-
### labels
|
|
382
|
-
|
|
383
|
-
Access the subscription labels.
|
|
384
|
-
|
|
385
|
-
- Relation type: `MorphMany`
|
|
386
|
-
- Returns `Collection` of `FluentCart\App\Models\LabelRelationship`
|
|
387
|
-
|
|
388
|
-
```
|
|
389
|
-
$subscription = FluentCart\App\Models\Subscription::find(1);
|
|
390
|
-
$labels = $subscription->labels;
|
|
391
|
-
```
|
|
392
|
-
|
|
393
|
-
### license
|
|
394
|
-
|
|
395
|
-
Access the subscription license (single). Only available when FluentCart Pro with the Licensing module is active.
|
|
396
|
-
|
|
397
|
-
- Relation type: `HasOne` (nullable -- returns `null` if `License` class does not exist)
|
|
398
|
-
- Returns `FluentCartPro\App\Modules\Licensing\Models\License|null`
|
|
399
|
-
|
|
400
|
-
```
|
|
401
|
-
$subscription = FluentCart\App\Models\Subscription::find(1);
|
|
402
|
-
$license = $subscription->license;
|
|
403
|
-
```
|
|
404
|
-
|
|
405
|
-
### licenses
|
|
406
|
-
|
|
407
|
-
Access all subscription licenses. Only available when FluentCart Pro with the Licensing module is active.
|
|
408
|
-
|
|
409
|
-
- Relation type: `HasMany` (nullable -- returns `null` if `License` class does not exist)
|
|
410
|
-
- Returns `Collection` of `FluentCartPro\App\Modules\Licensing\Models\License|null`
|
|
411
|
-
|
|
412
|
-
```
|
|
413
|
-
$subscription = FluentCart\App\Models\Subscription::find(1);
|
|
414
|
-
$licenses = $subscription->licenses;
|
|
415
|
-
```
|
|
416
|
-
|
|
417
|
-
### transactions
|
|
418
|
-
|
|
419
|
-
Access the subscription transactions.
|
|
420
|
-
|
|
421
|
-
- Relation type: `HasMany`
|
|
422
|
-
- Returns `Collection` of `FluentCart\App\Models\OrderTransaction`
|
|
423
|
-
|
|
424
|
-
```
|
|
425
|
-
$subscription = FluentCart\App\Models\Subscription::find(1);
|
|
426
|
-
$transactions = $subscription->transactions;
|
|
427
|
-
```
|
|
428
|
-
|
|
429
|
-
### billing_addresses
|
|
430
|
-
|
|
431
|
-
Access the billing addresses for the subscription's customer.
|
|
432
|
-
|
|
433
|
-
- Relation type: `HasMany` (scoped to `type = 'billing'`)
|
|
434
|
-
- Foreign key: `customer_id` -> `customer_id`
|
|
435
|
-
- Returns `Collection` of `FluentCart\App\Models\CustomerAddresses`
|
|
436
|
-
|
|
437
|
-
```
|
|
438
|
-
$subscription = FluentCart\App\Models\Subscription::find(1);
|
|
439
|
-
$addresses = $subscription->billing_addresses;
|
|
440
|
-
```
|
|
441
|
-
|
|
442
|
-
### product_detail
|
|
443
|
-
|
|
444
|
-
Access the product detail (variation details).
|
|
445
|
-
|
|
446
|
-
- Relation type: `BelongsTo`
|
|
447
|
-
- Foreign key: `variation_id` -> `id`
|
|
448
|
-
- Returns `FluentCart\App\Models\ProductDetail`
|
|
449
|
-
|
|
450
|
-
```
|
|
451
|
-
$subscription = FluentCart\App\Models\Subscription::find(1);
|
|
452
|
-
$productDetail = $subscription->product_detail;
|
|
453
|
-
```
|
|
454
|
-
|
|
455
|
-
### order
|
|
456
|
-
|
|
457
|
-
Access the parent order.
|
|
458
|
-
|
|
459
|
-
- Relation type: `BelongsTo`
|
|
460
|
-
- Foreign key: `parent_order_id` -> `id`
|
|
461
|
-
- Returns `FluentCart\App\Models\Order`
|
|
462
|
-
|
|
463
|
-
```
|
|
464
|
-
$subscription = FluentCart\App\Models\Subscription::find(1);
|
|
465
|
-
$order = $subscription->order;
|
|
466
|
-
```
|
|
467
|
-
|
|
468
|
-
### activities (via HasActivity trait)
|
|
469
|
-
|
|
470
|
-
Access the activity logs for this subscription.
|
|
471
|
-
|
|
472
|
-
- Relation type: `MorphMany` (ordered by `created_at DESC`, `id DESC`)
|
|
473
|
-
- Returns `Collection` of `FluentCart\App\Models\Activity`
|
|
474
|
-
|
|
475
|
-
```
|
|
476
|
-
$subscription = FluentCart\App\Models\Subscription::find(1);
|
|
477
|
-
$activities = $subscription->activities;
|
|
478
|
-
```
|
|
479
|
-
|
|
480
|
-
## Usage Examples
|
|
481
|
-
|
|
482
|
-
### Creating a Subscription
|
|
483
|
-
|
|
484
|
-
```
|
|
485
|
-
use FluentCart\App\Models\Subscription;
|
|
486
|
-
|
|
487
|
-
$subscription = Subscription::create([
|
|
488
|
-
'customer_id' => 1,
|
|
489
|
-
'parent_order_id' => 1,
|
|
490
|
-
'product_id' => 1,
|
|
491
|
-
'variation_id' => 1,
|
|
492
|
-
'billing_interval' => 'monthly',
|
|
493
|
-
'recurring_total' => 2999, // $29.99 in cents
|
|
494
|
-
'status' => 'active'
|
|
495
|
-
]);
|
|
496
|
-
// uuid is auto-generated on create
|
|
497
|
-
```
|
|
498
|
-
|
|
499
|
-
### Retrieving Subscriptions
|
|
500
|
-
|
|
501
|
-
```
|
|
502
|
-
// Get subscription by ID
|
|
503
|
-
$subscription = Subscription::find(1);
|
|
504
|
-
|
|
505
|
-
// Get subscription with customer and product
|
|
506
|
-
$subscription = Subscription::with(['customer', 'product'])->find(1);
|
|
507
|
-
|
|
508
|
-
// Get active subscriptions
|
|
509
|
-
$subscriptions = Subscription::where('status', 'active')->get();
|
|
510
|
-
```
|
|
511
|
-
|
|
512
|
-
### Updating a Subscription
|
|
513
|
-
|
|
514
|
-
```
|
|
515
|
-
$subscription = Subscription::find(1);
|
|
516
|
-
$subscription->status = 'canceled';
|
|
517
|
-
$subscription->canceled_at = gmdate('Y-m-d H:i:s');
|
|
518
|
-
$subscription->save();
|
|
519
|
-
```
|
|
520
|
-
|
|
521
|
-
### Deleting a Subscription
|
|
522
|
-
|
|
523
|
-
```
|
|
524
|
-
$subscription = Subscription::find(1);
|
|
525
|
-
$subscription->delete();
|
|
526
|
-
```
|
|
527
|
-
|
|
528
|
-
---
|
|
1
|
+
# Subscription Model
|
|
2
|
+
|
|
3
|
+
| DB Table Name | {wp_db_prefix}_fct_subscriptions |
|
|
4
|
+
| --- | --- |
|
|
5
|
+
| Schema | [Check Schema](/database/schema.md#fct-subscriptions-table) |
|
|
6
|
+
| Source File | fluent-cart/app/Models/Subscription.php |
|
|
7
|
+
| Name Space | FluentCart\App\Models |
|
|
8
|
+
| Class | FluentCart\App\Models\Subscription |
|
|
9
|
+
|
|
10
|
+
## Traits
|
|
11
|
+
|
|
12
|
+
| Trait | Provides |
|
|
13
|
+
| --- | --- |
|
|
14
|
+
| `HasActivity` | `activities()` morphMany relationship to `Activity` model |
|
|
15
|
+
| `CanUpdateBatch` | `scopeBatchUpdate` scope for bulk-updating rows in one query |
|
|
16
|
+
|
|
17
|
+
## Attributes
|
|
18
|
+
|
|
19
|
+
| Attribute | Data Type | Comment |
|
|
20
|
+
| --- | --- | --- |
|
|
21
|
+
| id | Integer | Primary Key |
|
|
22
|
+
| uuid | String | Unique identifier (auto-generated on create via `md5(time() . wp_generate_uuid4())`) |
|
|
23
|
+
| customer_id | Integer | Customer ID |
|
|
24
|
+
| parent_order_id | Integer | Parent order ID |
|
|
25
|
+
| product_id | Integer | Product ID |
|
|
26
|
+
| item_name | String | Item name |
|
|
27
|
+
| variation_id | Integer | Product variation ID |
|
|
28
|
+
| billing_interval | String | Billing interval (daily, weekly, monthly, quarterly, half_yearly, yearly) |
|
|
29
|
+
| signup_fee | Integer | Signup fee in cents |
|
|
30
|
+
| quantity | Integer | Quantity |
|
|
31
|
+
| recurring_amount | Integer | Recurring amount in cents |
|
|
32
|
+
| recurring_tax_total | Integer | Recurring tax total in cents |
|
|
33
|
+
| initial_tax_total | Integer | Tax charged on the first payment, in cents |
|
|
34
|
+
| recurring_total | Integer | Recurring total in cents |
|
|
35
|
+
| bill_times | Integer | Number of times to bill (0 = unlimited) |
|
|
36
|
+
| bill_count | Integer | Number of times billed |
|
|
37
|
+
| expire_at | Date Time | Expiration date |
|
|
38
|
+
| trial_ends_at | Date Time | Trial end date |
|
|
39
|
+
| canceled_at | Date Time | Cancellation date |
|
|
40
|
+
| restored_at | Date Time | Restoration date |
|
|
41
|
+
| collection_method | String | Collection method |
|
|
42
|
+
| trial_days | Integer | Trial days |
|
|
43
|
+
| vendor_customer_id | String | Vendor customer ID |
|
|
44
|
+
| vendor_plan_id | String | Vendor plan ID |
|
|
45
|
+
| vendor_subscription_id | String | Vendor subscription ID |
|
|
46
|
+
| next_billing_date | Date Time | Next billing date |
|
|
47
|
+
| status | String | Subscription status |
|
|
48
|
+
| original_plan | JSON | Original plan data |
|
|
49
|
+
| vendor_response | JSON | Vendor response data |
|
|
50
|
+
| current_payment_method | String | Current payment method |
|
|
51
|
+
| config | JSON | Subscription configuration (auto-encoded/decoded) |
|
|
52
|
+
| created_at | Date Time | Creation timestamp |
|
|
53
|
+
| updated_at | Date Time | Last update timestamp |
|
|
54
|
+
|
|
55
|
+
## Appended Attributes
|
|
56
|
+
|
|
57
|
+
These virtual attributes are automatically appended when the model is serialized to an array or JSON.
|
|
58
|
+
|
|
59
|
+
| Attribute | Type | Description |
|
|
60
|
+
| --- | --- | --- |
|
|
61
|
+
| url | String | Remote subscription URL from payment gateway (via `fluent_cart/subscription/url_{method}` filter) |
|
|
62
|
+
| payment_info | String | Human-readable subscription billing summary (interval, amount, trial) |
|
|
63
|
+
| billingInfo | Array | Active payment method details from subscription meta |
|
|
64
|
+
| overridden_status | String | Display-corrected status (handles simulated trial days and actual trial period detection) |
|
|
65
|
+
| currency | String | Uppercase currency code. A real column, also exposed through an accessor that falls back to config, the parent order, then the base currency |
|
|
66
|
+
| reactivate_url | String | Frontend URL for reactivating a canceled/expired subscription |
|
|
67
|
+
|
|
68
|
+
## Usage
|
|
69
|
+
|
|
70
|
+
Please check [Model Basic](/database/models.md) for Common methods.
|
|
71
|
+
|
|
72
|
+
### Accessing Attributes
|
|
73
|
+
|
|
74
|
+
```
|
|
75
|
+
$subscription = FluentCart\App\Models\Subscription::find(1);
|
|
76
|
+
|
|
77
|
+
$subscription->id; // returns subscription ID
|
|
78
|
+
$subscription->status; // returns subscription status
|
|
79
|
+
$subscription->recurring_total; // returns recurring total in cents
|
|
80
|
+
$subscription->billing_interval; // returns billing interval
|
|
81
|
+
$subscription->next_billing_date; // returns next billing date
|
|
82
|
+
$subscription->currency; // returns currency code (appended attribute)
|
|
83
|
+
$subscription->url; // returns remote subscription URL (appended attribute)
|
|
84
|
+
$subscription->overridden_status; // returns display-corrected status (appended attribute)
|
|
85
|
+
```
|
|
86
|
+
|
|
87
|
+
## Scopes
|
|
88
|
+
|
|
89
|
+
### visibleToCustomer()
|
|
90
|
+
|
|
91
|
+
Limits results to subscriptions a customer should see in their portal. Excludes `pending` and `intended` rows unless they have billed at least once (`bill_count > 0`) or carry a `reactivation_order_id` in `config`.
|
|
92
|
+
|
|
93
|
+
```
|
|
94
|
+
$subscriptions = $customer->subscriptions()->visibleToCustomer()->get();
|
|
95
|
+
```
|
|
96
|
+
|
|
97
|
+
### ofPlanType($planType)
|
|
98
|
+
|
|
99
|
+
Filters by plan shape. `'installment'` matches `bill_times > 0`; `'recurring'` matches `bill_times
|
|
100
|
+
|
|
101
|
+
```
|
|
102
|
+
$subscription = FluentCart\App\Models\Subscription::find(1);
|
|
103
|
+
$subscription->addLog('Status Changed', 'Subscription activated', 'info');
|
|
104
|
+
$subscription->addLog('Payment Failed', 'Card declined', 'error', 'system');
|
|
105
|
+
```
|
|
106
|
+
|
|
107
|
+
### getDownloads()
|
|
108
|
+
|
|
109
|
+
Get downloadable files associated with this subscription's product. Only returns downloads when the subscription has a `variation_id` and status is `active`. Filters downloads by the subscription's variation ID.
|
|
110
|
+
|
|
111
|
+
- Returns `Collection|Array` - Collection of `ProductDownload` models with product and variation titles, or empty array
|
|
112
|
+
|
|
113
|
+
```
|
|
114
|
+
$subscription = FluentCart\App\Models\Subscription::find(1);
|
|
115
|
+
$downloads = $subscription->getDownloads();
|
|
116
|
+
```
|
|
117
|
+
|
|
118
|
+
### getLatestTransaction()
|
|
119
|
+
|
|
120
|
+
Get the most recent charge transaction for this subscription.
|
|
121
|
+
|
|
122
|
+
- Returns `FluentCart\App\Models\OrderTransaction|null` - Latest charge transaction or null
|
|
123
|
+
|
|
124
|
+
```
|
|
125
|
+
$subscription = FluentCart\App\Models\Subscription::find(1);
|
|
126
|
+
$transaction = $subscription->getLatestTransaction();
|
|
127
|
+
```
|
|
128
|
+
|
|
129
|
+
### canUpgrade()
|
|
130
|
+
|
|
131
|
+
Check if the subscription can be upgraded. Requires a `variant_upgrade_path` meta entry for the current variation and the subscription must be `active` or `trialing`.
|
|
132
|
+
|
|
133
|
+
- Returns `Boolean` - True if upgrade path exists and status allows it
|
|
134
|
+
|
|
135
|
+
```
|
|
136
|
+
$subscription = FluentCart\App\Models\Subscription::find(1);
|
|
137
|
+
$canUpgrade = $subscription->canUpgrade();
|
|
138
|
+
```
|
|
139
|
+
|
|
140
|
+
### canUpdatePaymentMethod()
|
|
141
|
+
|
|
142
|
+
Check if the payment method can be updated (card update). The current payment gateway must support the `card_update` feature and the subscription must be in one of the allowed statuses: `active`, `trialing`, `paused`, `intended`, `past_due`, `failing`, or `expiring`.
|
|
143
|
+
|
|
144
|
+
- Returns `Boolean` - True if payment method can be updated
|
|
145
|
+
|
|
146
|
+
```
|
|
147
|
+
$subscription = FluentCart\App\Models\Subscription::find(1);
|
|
148
|
+
$canUpdate = $subscription->canUpdatePaymentMethod();
|
|
149
|
+
```
|
|
150
|
+
|
|
151
|
+
### canSwitchPaymentMethod()
|
|
152
|
+
|
|
153
|
+
Store-billed subscriptions — those where `usesRenewalEngine()` is true, i.e. `collection_method` of `manual` or `system` — always return `false`. Switching moves a subscription onto another gateway's vendor subscription, which would bill it a second time alongside the invoice engine. Those customers change the card on file through `canUpdatePaymentMethod()` instead.
|
|
154
|
+
|
|
155
|
+
Check if the payment method can be switched to a different gateway entirely. The current gateway must support the `switch_payment_method` feature, and the subscription must be `active`, `trialing`, or `paused`.
|
|
156
|
+
|
|
157
|
+
- Returns `Boolean` - True if payment method can be switched
|
|
158
|
+
|
|
159
|
+
```
|
|
160
|
+
$subscription = FluentCart\App\Models\Subscription::find(1);
|
|
161
|
+
$canSwitch = $subscription->canSwitchPaymentMethod();
|
|
162
|
+
```
|
|
163
|
+
|
|
164
|
+
### switchablePaymentMethods()
|
|
165
|
+
|
|
166
|
+
Get the list of payment gateways that can be switched to from the current gateway.
|
|
167
|
+
|
|
168
|
+
- Returns `Array` - Array of supported gateway identifiers, or empty array if switching is not supported
|
|
169
|
+
|
|
170
|
+
```
|
|
171
|
+
$subscription = FluentCart\App\Models\Subscription::find(1);
|
|
172
|
+
$methods = $subscription->switchablePaymentMethods();
|
|
173
|
+
// e.g., ['stripe', 'paypal']
|
|
174
|
+
```
|
|
175
|
+
|
|
176
|
+
### canReactivate()
|
|
177
|
+
|
|
178
|
+
Check if the subscription can be reactivated. Returns empty string (falsy) if:
|
|
179
|
+
|
|
180
|
+
- FluentCart Pro is not active
|
|
181
|
+
- The subscription was upgraded to another subscription
|
|
182
|
+
- The recurring amount is zero or negative
|
|
183
|
+
- The cancellation reason is `refunded`
|
|
184
|
+
|
|
185
|
+
Otherwise checks if status is one of: `canceled`, `failing`, `expired`, `paused`, `expiring`, or `past_due`.
|
|
186
|
+
|
|
187
|
+
- Returns `Mixed` - Filtered boolean/string value (empty string if cannot reactivate, truthy if can). Result is filtered via `fluent_cart/subscription/can_reactivate`.
|
|
188
|
+
|
|
189
|
+
```
|
|
190
|
+
$subscription = FluentCart\App\Models\Subscription::find(1);
|
|
191
|
+
if ($subscription->canReactivate()) {
|
|
192
|
+
// subscription can be reactivated
|
|
193
|
+
}
|
|
194
|
+
```
|
|
195
|
+
|
|
196
|
+
### getReactivateUrl()
|
|
197
|
+
|
|
198
|
+
Get the frontend URL for reactivating a canceled or expired subscription. Returns empty string if the subscription cannot be reactivated.
|
|
199
|
+
|
|
200
|
+
- Returns `String` - Reactivation URL with `fluent-cart=reactivate-subscription` query parameter, or empty string
|
|
201
|
+
|
|
202
|
+
```
|
|
203
|
+
$subscription = FluentCart\App\Models\Subscription::find(1);
|
|
204
|
+
$reactivateUrl = $subscription->getReactivateUrl();
|
|
205
|
+
```
|
|
206
|
+
|
|
207
|
+
### getViewUrl($type = 'customer')
|
|
208
|
+
|
|
209
|
+
Get the subscription view URL for the customer portal or admin dashboard.
|
|
210
|
+
|
|
211
|
+
- Parameters: `$type` (String) - View type: `'customer'` (default) for the customer portal, or `'admin'` for the admin dashboard
|
|
212
|
+
- Returns `String` - View URL
|
|
213
|
+
|
|
214
|
+
```
|
|
215
|
+
$subscription = FluentCart\App\Models\Subscription::find(1);
|
|
216
|
+
$customerUrl = $subscription->getViewUrl(); // customer portal URL
|
|
217
|
+
$adminUrl = $subscription->getViewUrl('admin'); // admin dashboard URL
|
|
218
|
+
```
|
|
219
|
+
|
|
220
|
+
### hasAccessValidity()
|
|
221
|
+
|
|
222
|
+
Check if the subscription currently grants access. Returns true for `active`, `trialing`, and `completed` statuses. Returns false for `expired`, `past_due`, `intended`, and `pending`. For other statuses (e.g., `canceled`, `failing`, `paused`, `expiring`), checks whether the next billing date (or guessed billing date) is still in the future.
|
|
223
|
+
|
|
224
|
+
- Returns `Boolean` - True if the subscription has valid access
|
|
225
|
+
|
|
226
|
+
```
|
|
227
|
+
$subscription = FluentCart\App\Models\Subscription::find(1);
|
|
228
|
+
$hasAccess = $subscription->hasAccessValidity();
|
|
229
|
+
```
|
|
230
|
+
|
|
231
|
+
### reSyncFromRemote()
|
|
232
|
+
|
|
233
|
+
Re-sync subscription data from the remote payment gateway. The gateway must support the `subscriptions` feature.
|
|
234
|
+
|
|
235
|
+
- Returns `Mixed` - Sync result from the gateway, or `WP_Error` if the payment method does not support remote resync
|
|
236
|
+
|
|
237
|
+
```
|
|
238
|
+
$subscription = FluentCart\App\Models\Subscription::find(1);
|
|
239
|
+
$result = $subscription->reSyncFromRemote();
|
|
240
|
+
if (is_wp_error($result)) {
|
|
241
|
+
// handle error
|
|
242
|
+
}
|
|
243
|
+
```
|
|
244
|
+
|
|
245
|
+
### cancelRemoteSubscription($args = [])
|
|
246
|
+
|
|
247
|
+
Cancel the subscription both remotely (at the payment gateway) and locally. Updates the status to `canceled`, sets `canceled_at`, stores the cancellation reason in config, and dispatches the `SubscriptionCanceled` event.
|
|
248
|
+
|
|
249
|
+
- Parameters: `$args` (Array) - Cancellation arguments: `reason` (String) - Cancellation reason (stored in config, default: `''`)
|
|
250
|
+
- `fire_hooks` (Boolean) - Whether to dispatch the `SubscriptionCanceled` event (default: `true`)
|
|
251
|
+
- `note` (String) - Cancellation note (saved to order, default: `''`)
|
|
252
|
+
|
|
253
|
+
Returns `Array|WP_Error` - Array with `subscription` and `vendor_result` keys on success
|
|
254
|
+
|
|
255
|
+
```
|
|
256
|
+
$subscription = FluentCart\App\Models\Subscription::find(1);
|
|
257
|
+
$result = $subscription->cancelRemoteSubscription([
|
|
258
|
+
'reason' => 'Customer request',
|
|
259
|
+
'fire_hooks' => true,
|
|
260
|
+
'note' => 'Cancelled by customer'
|
|
261
|
+
]);
|
|
262
|
+
```
|
|
263
|
+
|
|
264
|
+
### getCurrentRenewalAmount()
|
|
265
|
+
|
|
266
|
+
Get the current renewal amount. Checks `config.current_renewal_amount` first (used when the renewal amount differs from the base recurring total, e.g., after a plan change), then falls back to `recurring_total`.
|
|
267
|
+
|
|
268
|
+
- Returns `Integer` - Current renewal amount in cents
|
|
269
|
+
|
|
270
|
+
```
|
|
271
|
+
$subscription = FluentCart\App\Models\Subscription::find(1);
|
|
272
|
+
$amount = $subscription->getCurrentRenewalAmount();
|
|
273
|
+
```
|
|
274
|
+
|
|
275
|
+
### getRequiredBillTimes()
|
|
276
|
+
|
|
277
|
+
Get the number of remaining billing cycles. If `bill_times` is 0, returns 0 (unlimited). If the calculated remaining count is zero or negative, it re-verifies against actual successful transactions and early payment history, correcting `bill_count` if needed. Returns -1 if billing is truly complete after verification.
|
|
278
|
+
|
|
279
|
+
- Returns `Integer` - Remaining bill times (0 = unlimited, -1 = completed)
|
|
280
|
+
|
|
281
|
+
```
|
|
282
|
+
$subscription = FluentCart\App\Models\Subscription::find(1);
|
|
283
|
+
$billTimes = $subscription->getRequiredBillTimes();
|
|
284
|
+
```
|
|
285
|
+
|
|
286
|
+
### getReactivationTrialDays()
|
|
287
|
+
|
|
288
|
+
Get the number of trial days to apply when reactivating this subscription. If the subscription still has valid access (i.e., the billing period has not fully elapsed), the remaining days are returned as trial days so the customer is not double-charged.
|
|
289
|
+
|
|
290
|
+
- Returns `Integer` - Number of trial days for reactivation (0 if no remaining validity)
|
|
291
|
+
|
|
292
|
+
```
|
|
293
|
+
$subscription = FluentCart\App\Models\Subscription::find(1);
|
|
294
|
+
$trialDays = $subscription->getReactivationTrialDays();
|
|
295
|
+
```
|
|
296
|
+
|
|
297
|
+
### guessNextBillingDate($forced = false)
|
|
298
|
+
|
|
299
|
+
Calculate the next billing date when it is not already set (or when forced). Uses the last successful order's creation date plus the billing interval. For initial orders with trial days, adds trial days instead.
|
|
300
|
+
|
|
301
|
+
- Parameters: `$forced` (Boolean) - Force recalculation even if `next_billing_date` is already set (default: `false`)
|
|
302
|
+
- Returns `String` - Next billing date in `Y-m-d H:i:s` GMT format
|
|
303
|
+
|
|
304
|
+
```
|
|
305
|
+
$subscription = FluentCart\App\Models\Subscription::find(1);
|
|
306
|
+
$nextBillingDate = $subscription->guessNextBillingDate();
|
|
307
|
+
$forcedDate = $subscription->guessNextBillingDate(true); // force recalculation
|
|
308
|
+
```
|
|
309
|
+
|
|
310
|
+
### checkAndExpireSubscriptions($batchSize = 100) (static)
|
|
311
|
+
|
|
312
|
+
Check and expire subscriptions that have missed payments beyond their grace period. Called by the hourly scheduler. Processes `active`, `trialing`, and `canceled` subscriptions whose `next_billing_date` is past the grace period threshold. Grace periods vary by billing interval (e.g., 1 day for daily, 3 for weekly, 7 for monthly, 15 for quarterly/half_yearly/yearly).
|
|
313
|
+
|
|
314
|
+
For active/trialing subscriptions, status is changed to `expired`. For canceled subscriptions, only `next_billing_date` is cleared (status remains canceled). Dispatches `SubscriptionValidityExpired` event for each affected subscription.
|
|
315
|
+
|
|
316
|
+
- Parameters: `$batchSize` (Integer) - Number of subscriptions to process per batch (default: `100`)
|
|
317
|
+
- Returns `Array` - Statistics with keys: `checked`, `validity_expired`, `batches`
|
|
318
|
+
|
|
319
|
+
```
|
|
320
|
+
use FluentCart\App\Models\Subscription;
|
|
321
|
+
|
|
322
|
+
$stats = Subscription::checkAndExpireSubscriptions(50);
|
|
323
|
+
// $stats = ['checked' => 200, 'validity_expired' => 5, 'batches' => 4]
|
|
324
|
+
```
|
|
325
|
+
|
|
326
|
+
## Relations
|
|
327
|
+
|
|
328
|
+
This model has the following relationships that you can use.
|
|
329
|
+
|
|
330
|
+
### meta
|
|
331
|
+
|
|
332
|
+
Access the subscription metadata.
|
|
333
|
+
|
|
334
|
+
- Relation type: `HasMany`
|
|
335
|
+
- Returns `Collection` of `FluentCart\App\Models\SubscriptionMeta`
|
|
336
|
+
|
|
337
|
+
```
|
|
338
|
+
$subscription = FluentCart\App\Models\Subscription::find(1);
|
|
339
|
+
$meta = $subscription->meta;
|
|
340
|
+
```
|
|
341
|
+
|
|
342
|
+
### customer
|
|
343
|
+
|
|
344
|
+
Access the customer.
|
|
345
|
+
|
|
346
|
+
- Relation type: `BelongsTo`
|
|
347
|
+
- Foreign key: `customer_id`
|
|
348
|
+
- Returns `FluentCart\App\Models\Customer`
|
|
349
|
+
|
|
350
|
+
```
|
|
351
|
+
$subscription = FluentCart\App\Models\Subscription::find(1);
|
|
352
|
+
$customer = $subscription->customer;
|
|
353
|
+
```
|
|
354
|
+
|
|
355
|
+
### product
|
|
356
|
+
|
|
357
|
+
Access the product.
|
|
358
|
+
|
|
359
|
+
- Relation type: `BelongsTo`
|
|
360
|
+
- Foreign key: `product_id` -> `ID`
|
|
361
|
+
- Returns `FluentCart\App\Models\Product`
|
|
362
|
+
|
|
363
|
+
```
|
|
364
|
+
$subscription = FluentCart\App\Models\Subscription::find(1);
|
|
365
|
+
$product = $subscription->product;
|
|
366
|
+
```
|
|
367
|
+
|
|
368
|
+
### variation
|
|
369
|
+
|
|
370
|
+
Access the product variation.
|
|
371
|
+
|
|
372
|
+
- Relation type: `BelongsTo`
|
|
373
|
+
- Foreign key: `variation_id`
|
|
374
|
+
- Returns `FluentCart\App\Models\ProductVariation`
|
|
375
|
+
|
|
376
|
+
```
|
|
377
|
+
$subscription = FluentCart\App\Models\Subscription::find(1);
|
|
378
|
+
$variation = $subscription->variation;
|
|
379
|
+
```
|
|
380
|
+
|
|
381
|
+
### labels
|
|
382
|
+
|
|
383
|
+
Access the subscription labels.
|
|
384
|
+
|
|
385
|
+
- Relation type: `MorphMany`
|
|
386
|
+
- Returns `Collection` of `FluentCart\App\Models\LabelRelationship`
|
|
387
|
+
|
|
388
|
+
```
|
|
389
|
+
$subscription = FluentCart\App\Models\Subscription::find(1);
|
|
390
|
+
$labels = $subscription->labels;
|
|
391
|
+
```
|
|
392
|
+
|
|
393
|
+
### license
|
|
394
|
+
|
|
395
|
+
Access the subscription license (single). Only available when FluentCart Pro with the Licensing module is active.
|
|
396
|
+
|
|
397
|
+
- Relation type: `HasOne` (nullable -- returns `null` if `License` class does not exist)
|
|
398
|
+
- Returns `FluentCartPro\App\Modules\Licensing\Models\License|null`
|
|
399
|
+
|
|
400
|
+
```
|
|
401
|
+
$subscription = FluentCart\App\Models\Subscription::find(1);
|
|
402
|
+
$license = $subscription->license;
|
|
403
|
+
```
|
|
404
|
+
|
|
405
|
+
### licenses
|
|
406
|
+
|
|
407
|
+
Access all subscription licenses. Only available when FluentCart Pro with the Licensing module is active.
|
|
408
|
+
|
|
409
|
+
- Relation type: `HasMany` (nullable -- returns `null` if `License` class does not exist)
|
|
410
|
+
- Returns `Collection` of `FluentCartPro\App\Modules\Licensing\Models\License|null`
|
|
411
|
+
|
|
412
|
+
```
|
|
413
|
+
$subscription = FluentCart\App\Models\Subscription::find(1);
|
|
414
|
+
$licenses = $subscription->licenses;
|
|
415
|
+
```
|
|
416
|
+
|
|
417
|
+
### transactions
|
|
418
|
+
|
|
419
|
+
Access the subscription transactions.
|
|
420
|
+
|
|
421
|
+
- Relation type: `HasMany`
|
|
422
|
+
- Returns `Collection` of `FluentCart\App\Models\OrderTransaction`
|
|
423
|
+
|
|
424
|
+
```
|
|
425
|
+
$subscription = FluentCart\App\Models\Subscription::find(1);
|
|
426
|
+
$transactions = $subscription->transactions;
|
|
427
|
+
```
|
|
428
|
+
|
|
429
|
+
### billing_addresses
|
|
430
|
+
|
|
431
|
+
Access the billing addresses for the subscription's customer.
|
|
432
|
+
|
|
433
|
+
- Relation type: `HasMany` (scoped to `type = 'billing'`)
|
|
434
|
+
- Foreign key: `customer_id` -> `customer_id`
|
|
435
|
+
- Returns `Collection` of `FluentCart\App\Models\CustomerAddresses`
|
|
436
|
+
|
|
437
|
+
```
|
|
438
|
+
$subscription = FluentCart\App\Models\Subscription::find(1);
|
|
439
|
+
$addresses = $subscription->billing_addresses;
|
|
440
|
+
```
|
|
441
|
+
|
|
442
|
+
### product_detail
|
|
443
|
+
|
|
444
|
+
Access the product detail (variation details).
|
|
445
|
+
|
|
446
|
+
- Relation type: `BelongsTo`
|
|
447
|
+
- Foreign key: `variation_id` -> `id`
|
|
448
|
+
- Returns `FluentCart\App\Models\ProductDetail`
|
|
449
|
+
|
|
450
|
+
```
|
|
451
|
+
$subscription = FluentCart\App\Models\Subscription::find(1);
|
|
452
|
+
$productDetail = $subscription->product_detail;
|
|
453
|
+
```
|
|
454
|
+
|
|
455
|
+
### order
|
|
456
|
+
|
|
457
|
+
Access the parent order.
|
|
458
|
+
|
|
459
|
+
- Relation type: `BelongsTo`
|
|
460
|
+
- Foreign key: `parent_order_id` -> `id`
|
|
461
|
+
- Returns `FluentCart\App\Models\Order`
|
|
462
|
+
|
|
463
|
+
```
|
|
464
|
+
$subscription = FluentCart\App\Models\Subscription::find(1);
|
|
465
|
+
$order = $subscription->order;
|
|
466
|
+
```
|
|
467
|
+
|
|
468
|
+
### activities (via HasActivity trait)
|
|
469
|
+
|
|
470
|
+
Access the activity logs for this subscription.
|
|
471
|
+
|
|
472
|
+
- Relation type: `MorphMany` (ordered by `created_at DESC`, `id DESC`)
|
|
473
|
+
- Returns `Collection` of `FluentCart\App\Models\Activity`
|
|
474
|
+
|
|
475
|
+
```
|
|
476
|
+
$subscription = FluentCart\App\Models\Subscription::find(1);
|
|
477
|
+
$activities = $subscription->activities;
|
|
478
|
+
```
|
|
479
|
+
|
|
480
|
+
## Usage Examples
|
|
481
|
+
|
|
482
|
+
### Creating a Subscription
|
|
483
|
+
|
|
484
|
+
```
|
|
485
|
+
use FluentCart\App\Models\Subscription;
|
|
486
|
+
|
|
487
|
+
$subscription = Subscription::create([
|
|
488
|
+
'customer_id' => 1,
|
|
489
|
+
'parent_order_id' => 1,
|
|
490
|
+
'product_id' => 1,
|
|
491
|
+
'variation_id' => 1,
|
|
492
|
+
'billing_interval' => 'monthly',
|
|
493
|
+
'recurring_total' => 2999, // $29.99 in cents
|
|
494
|
+
'status' => 'active'
|
|
495
|
+
]);
|
|
496
|
+
// uuid is auto-generated on create
|
|
497
|
+
```
|
|
498
|
+
|
|
499
|
+
### Retrieving Subscriptions
|
|
500
|
+
|
|
501
|
+
```
|
|
502
|
+
// Get subscription by ID
|
|
503
|
+
$subscription = Subscription::find(1);
|
|
504
|
+
|
|
505
|
+
// Get subscription with customer and product
|
|
506
|
+
$subscription = Subscription::with(['customer', 'product'])->find(1);
|
|
507
|
+
|
|
508
|
+
// Get active subscriptions
|
|
509
|
+
$subscriptions = Subscription::where('status', 'active')->get();
|
|
510
|
+
```
|
|
511
|
+
|
|
512
|
+
### Updating a Subscription
|
|
513
|
+
|
|
514
|
+
```
|
|
515
|
+
$subscription = Subscription::find(1);
|
|
516
|
+
$subscription->status = 'canceled';
|
|
517
|
+
$subscription->canceled_at = gmdate('Y-m-d H:i:s');
|
|
518
|
+
$subscription->save();
|
|
519
|
+
```
|
|
520
|
+
|
|
521
|
+
### Deleting a Subscription
|
|
522
|
+
|
|
523
|
+
```
|
|
524
|
+
$subscription = Subscription::find(1);
|
|
525
|
+
$subscription->delete();
|
|
526
|
+
```
|
|
527
|
+
|
|
528
|
+
---
|