Managing subscriptions
Understand how the Salesforce B2B Commerce App supports the processing of recurring installment payments.
A subscription is an arrangement for providing, receiving, or making use of something of a continuing or periodic nature on a (pre)payment plan. The Salesforce B2B Commerce App currently supports the processing of recurring installment payments.
The app comes with two batch jobs to process recurring installment payments.
DR Batch Subscription Processor job
Runs on a schedule and picks the CC Subscription records for which recurring Installment payment needs to be processed.
Creates a CC Cart and adds the subscription product that is stamped on the CC Subscription record.
The Cart status will be set to the Custom Digital River status "Open-DR" so that it is not visible in the Storefront when the user logs in.
Updates the Subscription Installment Count and Installment Next Run date on the CC Subscription record.
Creates a DR Subscription Process Data record and populates it with Cart, Cart Item, Parent Order Id, Transaction Payment, Stored Payment, Subscribed Product, User, Contact, Account, and other information required for DR Order submission.
Notes: The number of CC Subscription records processed per batch run is specified in the Metadata Record "CC_Subscriptions_Batch_Query_Limit" under Custom Metadata Type "DR Application Configuration".
The Batch Scope size is specified in the Metadata Record "CC_Subscription_Processor_Batch_Size" under Custom Metadata Type "DR Application Configuration".
DR Recurring Payment Processor job
Query all DR Subscription Process Data records whose
Is Recurring Payment Processed
flag isFalse
and the Subscription Job Run status field is set toOpen
ordered by Installment Run date.This job goes through the entire checkout flow. That is, it makes calls to Digital River to get Tax, Create DR Order and Populate the DR Order information in Salesforce.
If this job is successful, then it sets the
Is Recurring Payment Processed
flag totrue
and Subscription Job Run Status toSuccessful
.If this job fails, then it sets the
Is Recurring Payment Processed
flag tofalse
and SubscriptionJob Run Status
toOpen
orFailed
depending on the Subscription Retry Count value on this record.
Subscription Retry Count Settings
If the Subscription Retry count field on this record exceeds the maximum retry count set in the configuration, then the
Subscription Job Run Status
is set toFailed
.If the Subscription Retry count field on this record is less than the maximum Retry count set in the Configuration, then the
Subscription Job Run Status
is set toOpen
so that this record is processed again next time.
Note: The number of DR Subscription Process Data records processed per batch run is specified in the Metadata Record "Recurring_Payment_Process_Query_Limit" under Custom Metadata Type "DR Application Configuration".
The Batch Scope size is specified in the Metadata Record "Recurring_Payment_Batch_Size" under Custom Metadata Type "DR Application Configuration".
The Subscription Retry Count is specified in the Metadata Record "Subscription_Retry_Count" under Custom Metadata Type "DR Application Configuration"
Sequence diagram
The following sequence diagram explains the Recurring Installment Subscription Payment Process supported by the connector.
Last updated