Skip to content

Commit

Permalink
Initial scaffolding commit #1
Browse files Browse the repository at this point in the history
  • Loading branch information
Kazanir committed Sep 26, 2017
0 parents commit 056e389
Show file tree
Hide file tree
Showing 30 changed files with 1,081 additions and 0 deletions.
14 changes: 14 additions & 0 deletions commerce_recurring.info.yml
@@ -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

3 changes: 3 additions & 0 deletions commerce_recurring.module
@@ -0,0 +1,3 @@
<?php


11 changes: 11 additions & 0 deletions commerce_recurring.services.yml
@@ -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

6 changes: 6 additions & 0 deletions commerce_recurring.workflow_groups.yml
@@ -0,0 +1,6 @@
commerce_subscription:
label: Subscription
entity_type: commerce_subscription
commerce_recurring_cycle:
label: Recurring cycle
entity_type: commerce_recurring_cycle
45 changes: 45 additions & 0 deletions commerce_recurring.workflows.yml
@@ -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


@@ -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 config/install/commerce_order.commerce_order_type.recurring.yml
@@ -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: ''

@@ -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
@@ -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

0 comments on commit 056e389

Please sign in to comment.