How to set up CCBill FlexForm (Scrile Connect)

 

Setting up a CCBill account

  1. Optional: create 2 different subaccounts if you need to split one time and recurring transactions between different subaccounts.

  2. Configure FlexForm

    1. Go to FlexForms Systems → FlexForms Payment Links;

    2. Create a FlexForm with Dynamic Price. (Dynamic Price should be activated by CCBill support);

    3. Configure Approve redirect;
      Approve URL: https://your-domain/payments/ccbillflexform/thankyou.html?result=success
      // Replace your-domain with your actual domain address;

    4. You need to open a FlexForm in a Sandbox, and then click “Promote to Live”

  3. Configure Webhooks

    1. For every subaccount configure Webhooks here: Account Info → Sub Account Admin → Webhooks;

    2. You need to add three webhooks

      • Webhook URL - https://your-domain/api/payment-systems/ccbill-flexform/webhook/sale
        Webhook Format - JSON;
        Event types - CrossSaleSuccess, NewSaleSuccess, UpSaleSuccess;

      • Webhook URL - https://your-domain/api/payment-systems/ccbill-flexform/webhook/rebill
        Webhook Format - JSON;
        Event types - RenewalSuccess;

      • Webhook URL - https://your-domain/api/payment-systems/ccbill-flexform/webhook/cancel
        Webhook Format - JSON;
        Event types - Cancellation, Expiration;


        // Replace your-domain with your exact domain address that is configured to run your website. If your site open with www in domain name, use domain with www at ccbill side also.

  4. Configure DataLink user to manage subscriptions from your site

    1. For recurring subaccount create DataLink user here: Account Info → Data Link Service Suit → Add User

    2. Fill in Username and Password fields

    3. Select in Subsystems two SMS Services: SMS - cancelSubscription and SMS - viewSubscriptionStatus
      // If you don’t have these options please request CCBill Support to enable SMS Services

    4. Enter next IPs
      62.138.2.50 62.138.2.51 62.138.3.14 62.138.7.186 62.138.2.147 62.138.8.201
      62.138.2.185 62.138.2.189 62.138.2.191 62.138.7.67 62.138.7.192 62.138.16.253
      62.138.14.224 62.138.14.231

       

  5. If you use CloudFlare for your site, be sure to add firewall rule to not block requests from CCBill.

    1. Go to CloudFlare → your site → Security → WAF and click “Create firewall rule”

    2. Fill in
      Rule name - CCBill
      Field - URI Path
      Operator - Contains
      Value - /api/payment-systems/ccbill-flexform/webhook
      Choose an action - Skip
      Choose WAF components to skip (by clicking “More components to skip”) - User Agent Blocking, Browser Integrity Check, Hotlink Protection, Security Level, Rate Limiting

    3. Click “Deploy firewall rule”

Setting up a CCBill account in the website settings:

  1. In the website settings your-domain/admin/settings/payments add a new Payment method CCBillFlexForm;

  2. Fill in:
    a. Account ID;
    b. One time Sub Account ID;
    c. Recurring Sub Account ID; (could be same as one time or separate depending on your needs)
    d. FlexForm ID;
    e. Salt Key (you can find it in your CCBill settings Account Info → Sub Account Admin → --Advanced → Encryption Key);
    f. API user - username of Datalink user
    g. API password - password of Datalink user

  3. Click “Save”;

  4. FlexForm is configured.

In case of any errors if you see error code, following link will help to determine the reason https://ccbill.com/doc/ccbill-api-guide#error_codes