Recurring Payment Process, Stripe Payment

Recurring Payment Process, Stripe Payment 20211120
This workflow accepts subscription applications online. The customer makes a provisional application online using the trial version ID as a key. After the provisional subscription, the customer enters credit card information to make a full subscription. Billing is done periodically via Stripe.
Worker (#of Swimlane: 3)
  • Reception Desk
    • Receptionist for the purchase process
  • License Updater
    • Person in charge of renewing product licenses
  • Sales Staff
    • Purchaser’s sales representative
Business Flow (Complexity of Workflow: 44)
  • 451. License update
    • The person in charge of license renewal will renew the license based on the order details.
  • 432. Charge cancellation decision
    • A sales representative will decide whether to cancel Charge. (If there is no judgment for 3 hours, Charge will be automatically executed)
  • 65Annual payment: billing period
    • The workflow platform sets the next billing period (for annual payments).
  • 55Charging Stop
    • The workflow platform waits for notifications from the cancellation process/contract change process.
  • 52Fee calculation
    • The workflow platform calculates the charges.
  • 1Get trial version information
    • The workflow platform retrieves customer information from the trial version registration DB (Google Sheets).
  • 63Monthly payment: billing period
    • The workflow platform sets the next billing period (for monthly payments).
  • 26Purchase procedure book application
    • The workflow platform will generate this application form.
  • 23Set Title
    • The workflow platform sets the subject.
  • 25Set Title
    • The workflow platform sets the subject.
  • 28Set Title
    • The workflow platform sets the subject.
  • 50Set Title
    • The workflow platform sets the subject.
  • 58Set Title
    • The workflow platform sets the subject.
  • 60Set Title
    • The workflow platform sets the subject.
  • 70Set Title
    • The workflow platform sets the subject.
  • 40Set procedure details
    • The workflow platform will set the procedure details that will be displayed on the main application screen.
  • 42Stripe Charge
    • The workflow infrastructure uses the Stripe service to perform billing.
  • 41Stripe Customer ID generation
    • The workflow platform retrieves the Customer ID from the Stripe service.
  • 6Trial version information/billing period set
    • The workflow platform analyzes the trial version information and stores it in a data item.
Business Process Variables (#of Data Item: 32)
  • ◆ Temporary Application Guidance 25
  • ◆ Main Application Guidance 29
  • Application Dateq_registration_date12
    • Stores the application date.
    • processInstanceStartDatetime
  • Trial Version IDq_contract_number0
    • Stores the customer-entered trial version ID.
  • Contract Email Addressq_contracted_email8
    • Stores the customer-entered email address.
  • Payment Methodq_payment_method27*
    • The payment method selected by the customer (monthly payment/yearly payment) is stored.
  • Preferred Planq_plan26*
    • Stores customer-selected service plans.
  • Procedure Detailsq_guidance_Massage33
    • Information necessary for confirmation of this application will be stored.
  • Price Tableq_price_table38
    • The charges for the selected payment method/plan are stored.
  • Subtotalq_subtotal_amount39
    • Stores the price excluding tax.
  • Consumption Taxq_tax40
    • Contains the consumption tax of the charge.
  • Totalq_total_amount41
    • Stores the price including tax.
  • ◆ Enter Payment Information I/F (create Stripe token)30
    • Contains credit card information registration I/F. (Please obtain and reflect the “pk_test_*****” string from the Stripe service settings)
  • Stripe Tokenq_stripeToken31*
    • Stores the token required for Stripe payment.
  • Last 4 Digitsq_last432*
    • Stores part of the credit card (the last 4 digits of the number).
  • Noticesq_message11
    • Special notes for customer input are stored.
  • ◆ Trial Version Usage Information 9
  • Company Nameq_corprate_name2
    • Company name (contract information DB Google sheet) is stored.
  • Customer Nameq_customer_name3
    • Stores the name of the person in charge (contract information DB Google sheet).
  • Customer Email Addressq_customer_email4
    • The email address of the person in charge (contract information DB Google sheet) is stored.
  • ◆ Charge Information 10
  • Payment Start Dateq_payment_start_date6
    • The billing start date (the day after the application date) is stored.
    • processInstanceStartDatetime.addDays(1)
  • Payment End Dateq_payment_end_date5
    • The billing end date is stored.
  • STRIPE CUSTOMER IDq_STRIPE_CUSTOMER_ID34
    • Stores notifications (Customer ID) from the Stripe service.
  • STRIPE CHARGE IDq_STRIPE_CHARGE_ID7
    • Stores notifications (Charge ID) from the Stripe service.
  • STRIPE CARD BRANDq_STRIPE_CARD_BRAND35
    • Stores notifications (credit card brand names) from the Stripe service.
  • STRIPE LAST 4 DIGITSq_STRIPE_LAST436
    • Stores notifications from the Stripe service (part of the credit card number, last 4 digits).
  • STRIPE EXPq_STRIPE_EXP37
    • Stores notifications (credit card expiration dates) from the Stripe service.
  • ◆ System Information 13
  • Trial Registration Informationq_contract_information1
    • Stores the registration information record linked to the trial ID.
  • API Key (for this application)q_api_key28
    • Stores the API key required to access this application form.
    • #{#randomString(16)}
  • API Key (for Charge Stop)q_api_key_for_charge_stop42
    • Stores the API key required by the Charge Stop web hook.
    • #{#randomString(16)}

Field Name, num, Initial Value

Download

This archive contains the BPMN icon, which is only available in the Professional edition.

Notes

  • You need to associate the Swimlane settings according to your organizational structure upon import
  • FILE-ID in the [Get trial version information] step refers to the Google Sheet URL, etc.
  • HTTP authentication settings for [Stripe Customer ID generation] and [Stripe Charge] steps
    • Get the information from Stripe service content and configure it.
    • Token example: sk_live_***

Arrangement Tips

Trial version information/billing period set auto step script (click to open)
// q_contract_information Data format
// Format example: Company name, Operator, Operator's Email address, Organization
// Example: Acme Co., Ltd., James McGill, james@sample2.com, Operations Department
const info = engine.findDataByVarName("q_contract_information");

const plan = engine.findDataByVarName("q_plan").get(0).getValue();
const method = engine.findDataByVarName("q_payment_method").get(0).getValue();
const startDate = engine.findDataByVarName("q_payment_start_date");
let endDate;
engine.log("q_plan: " + plan);
engine.log("q_payment_method: " + method);

main();

function main(){
	if (info !== null){
		const cols = info.split(" ");
		engine.setDataByVarName("q_corprate_name",cols[0]);
		engine.setDataByVarName("q_customer_name",cols[1]);
		engine.setDataByVarName("q_customer_email",cols[2]);
		engine.setDataByVarName("q_price_table",[plan]);
		if (method === "Monthly"){
		   endDate = startDate.addMonths(1).addDays(-1);
		}else{
		   endDate = startDate.addMonths(12).addDays(-1);
		}
		engine.setDataByVarName("q_payment_end_date",endDate);
	}
}
Fee calculation auto step script (click to open)
const taxRate = 0.1; // Consumption tax 10%
const subtotal = Number(engine.findDataByVarName("q_price_table").get(0).getDisplay());
const tax = subtotal * taxRate;
const total = subtotal + tax;

engine.setDataByVarName("q_subtotal_amount",new java.math.BigDecimal(subtotal));
engine.setDataByVarName("q_tax",new java.math.BigDecimal(tax));
engine.setDataByVarName("q_total_amount",new java.math.BigDecimal(total));

Capture

Trial version registration database example

See also

Discover more from Questetra Support

Subscribe now to keep reading and get access to the full archive.

Continue reading