forked from dawehner/commerce_recurring
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
0 parents
commit 056e389
Showing
30 changed files
with
1,081 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
name: Commerce Recurring | ||
type: module | ||
description: Recurring orders and subscriptions | ||
core: 8.x | ||
package: Commerce | ||
configure: entity.commerce_recurring_cycle.collection | ||
configure: entity.commerce_subscription.collection | ||
dependencies: | ||
- commerce | ||
- commerce_checkout | ||
- commerce_product | ||
- state_machine | ||
- recurring_period | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
<?php | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
services: | ||
plugin.manager.commerce_subscription_type: | ||
class: Drupal\commerce_recurring\SubscriptionTypeManager | ||
parent: default_plugin_manager | ||
plugin.manager.commerce_recurring_engine: | ||
class: Drupal\commerce_recurring\RecurringEngineManager | ||
parent: default_plugin_manager | ||
plugin.manager.commerce_recurring_usage_group: | ||
class: Drupal\commerce_recurring\RecurringUsageGroupManager | ||
parent: default_plugin_manager | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
commerce_subscription: | ||
label: Subscription | ||
entity_type: commerce_subscription | ||
commerce_recurring_cycle: | ||
label: Recurring cycle | ||
entity_type: commerce_recurring_cycle |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
subscription_default: | ||
id: subscription_default | ||
group: commerce_subscription | ||
label: 'Default' | ||
states: | ||
pending: | ||
# A subscription which has been created but for some reason not yet | ||
# attached to an order. | ||
label: Pending | ||
active: | ||
# A subscription which is active and attached to an order. | ||
label: Active | ||
suspended: | ||
# A subscription which is suspended, meaning that it will renew normally | ||
# but not attach order items to an order. | ||
label: Suspended | ||
expired: | ||
# A subscription which has expired naturally. | ||
label: Expired | ||
canceled: | ||
# A subscription which was canceled (i.e. before automatic expiration, by the user or an administrator.) | ||
label: Canceled | ||
transitions: | ||
activate: | ||
label: Activate | ||
from: [pending] | ||
to: active | ||
suspend: | ||
label: Suspend | ||
from: [active] | ||
to: suspended | ||
reactivate: | ||
label: Reactivate | ||
from: [suspended, expired] | ||
to: active | ||
expire: | ||
label: Expire | ||
from: [active, suspended] | ||
to: expired | ||
cancel: | ||
label: Cancel | ||
from: [active, suspended] | ||
to: canceled | ||
|
||
|
17 changes: 17 additions & 0 deletions
17
config/install/commerce_order.commerce_order_item_type.recurring.yml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
langcode: en | ||
status: true | ||
dependencies: | ||
enforced: | ||
module: | ||
- commerce_recurring | ||
label: 'Recurring' | ||
id: recurring | ||
# @TODO: I think this is enough and we don't need a subscription | ||
# reference field...right? | ||
purchasableEntityType: commerce_subscription | ||
orderType: recurring | ||
# @TODO: We might want a plugin field for usage groups here? | ||
traits: { } | ||
# @TODO: We might also want a way to record the charge object | ||
# responsible for this order item. It has come up before... | ||
|
12 changes: 12 additions & 0 deletions
12
config/install/commerce_order.commerce_order_type.recurring.yml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
langcode: en | ||
status: true | ||
label: Recurring | ||
id: recurring | ||
# @TODO: Figure out if we need a custom workflow, leaning yes. | ||
workflow: order_validation_fulfillment | ||
traits: { } | ||
refresh_mode: recurring | ||
refresh_frequency: 300 | ||
sendReceipt: true | ||
receiptBcc: '' | ||
|
20 changes: 20 additions & 0 deletions
20
config/install/field.field.commerce_order.recurring.order_subscriptions.yml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
langcode: en | ||
status: true | ||
dependencies: | ||
config: | ||
- commerce_order.commerce_order_type.recurring | ||
- field.storage.commerce_order.order_subscriptions | ||
id: commerce_order.recurring.order_subscriptions | ||
field_name: order_subscriptions | ||
entity_type: commerce_order | ||
bundle: recurring | ||
label: 'Subscriptions' | ||
description: '' | ||
required: true | ||
translatable: false | ||
default_value: { } | ||
default_value_callback: '' | ||
settings: | ||
handler: 'default:commerce_subscription' | ||
handler_settings: { } | ||
field_type: entity_reference |
19 changes: 19 additions & 0 deletions
19
config/install/field.storage.commerce_order.order_subscriptions.yml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
langcode: en | ||
status: true | ||
dependencies: | ||
module: | ||
- commerce_order | ||
id: commerce_order.order_subscriptions | ||
field_name: order_subscriptions | ||
entity_type: commerce_subscription | ||
type: entity_reference | ||
settings: | ||
target_type: commerce_subscription | ||
module: core | ||
locked: true | ||
cardinality: -1 | ||
translatable: false | ||
indexes: { } | ||
persist_with_no_fields: false | ||
custom_storage: false | ||
|
Oops, something went wrong.