Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 2 Next »

If you do not already have a 1account account please sign up before proceeding.

1account is an age and identify verification platform. The service is tightly integrated with CheckoutChamp to verify consumers who purchase regulated products. The service is targeted to United Kingdom merchants and consumers.

Plugin Activation

  • Go to CRM. Navigate to Admin → Plugins → Data Sources

  • Click on the 1account tile and then the green “Activate” button

  • clientId - retrieved from 1account

  • complianceLevel - choose level 1-4

  • productTags - Optional. Enter one or more values separated by commas. Age verification will take effect if at least one product on the order has the entered tag(s).

  • retryUrl - Required. The URL to which the consumer will be directed to complete the age verification. If using Checkout Champ hosted pages this must be a Thank You page.

  • emailServer - Required. Choose the SMTP server from which to send age verification reminder emails to customers. STMP servers are configured at Admin > Plugins > SMTP Maintenance.

  • autoCancelDays - Optional. The number of days after which to automatically cancel the order if age verification is not complete. Valid values are between 5 and 30. Enter 0 to clear. If this value is not entered then unverified orders will remain in a pending state indefinitely.

  • FriendlyName - Optional. Enter a name to identify this plugin throughout the app.

Click the green “Connect” button to complete the plugin activation

Callback URL

Edit the plugin to view the callback URL. Share this URL with 1account for webhook setup.

Orders

Age verification is triggered for Complete new sales only.

Age verification is triggered once per customer. Once age is verified then subsequent orders from that customer will not require additional verification.

Checkout Champ pages

This section applies to CheckoutChamp hosted pages only. If using a Direct API integration then proceed to the next section.

  • Edit the funnel on which to enable 1account

  • Copy the live URL of the Thank You page that will be used for customer verification

  • Go to Settings > Add Ons

  • Choose 1account

  • Select the 1account plugin. Add or edit a plugin as necessary. Paste the Thank You page live URL into the retryUrl input on the plugin. Save the plugin.

  • Save & Continue

  • Publish the funnel

Direct API Integration

This section should be skipped if using CheckoutChamp hosted pages

  1. Edit the plugin and note the 1AccountID. Pass this on the Order Import API call as the custom_order_1Account parameter. Also pass this on the Confirm PayPal API if using the PayPal legacy workflow.

  2. Use orderId returned from the Order Import API call as "authCode" in the 1account page script

  3. Trigger the age verification flow when the "reviewStatus" is marked as "AGE".

Here is sample script to be placed on the retryUrl page

<!DOCTYPE html>
<html>

<head>
  <title>1Account Push API examples</title>
</head>
<body>

  <!-- Example Script to demo 1Account push API validte function data keys -->
  <script type="text/javascript">
      function collectData(argument) {
        try {
          const ageVerificationLevel = 1 // Could be 2, 3 and 4 based on merchant need.
          // Replace below object value with buyer information.
          // All key values are of type string.
          // If any information is not available pass value as empty string. Values which are passed as empty string will be requested on 1Account popup.
          // If is advised to pass user information to reduce friction for seamless checkout.
          const valudationData = {
            msisdn: "", // Buyer valid phone number
            email: "", // Buyer email
            forename: "", // Buyer first name
            surname: "", // Buyer last name
            country: "", // Buyer country should be UK (United Kingdom), GB (Great Britain) or IE (Ireland).
            city: "",
            street: "",
            building: "", 
            postCode: "", 
          }
          // Add DOB information for validation if age verification level is greater than 2.
          // If DOB information is not available pass "dobDay" key as empty string and skip adding "dobMonth" and "dobYear".
          if (ageVerificationLevel > 2) {
            valudationData["dobDay"] = "";
            valudationData["dobMonth"] = "";
            valudationData["dobYear"] = "";
          }
          return valudationData;
        } catch (err) {
          console.log(err);
          return null;
        }
      }
  </script>


  <!-- Example Starts: Show 1Account Popup on page load -->
  <script id="one-account-push-api" src="https://www.1account.net/pushApi/index.js"></script>
  <script type="text/javascript">
    try {
      PUSH_API.init({
        authCode: "CRM_ORDER_ID", // CRM Order ID
        avLevel: "YOUR_AV_LEVEL", // '3'
        clientId: "YOUR_CLIENT_ID", // '75412d2-72a1-14e2-1'
        onComplete: function (response) {
          // CUSTOMER journey is finished at this
          // step and here you can call API GET request
          // to your storage to receive information
          // Or write custom logic based on response status
          if (response.status === "AV_SUCCESS") {
            console.log("AV_SUCCESS")
          } else {
            console.log("AV_FAIL")
          }
        },
        onClose: function () {
          // Add custom code to alert or record consumer action
        }
      });
      const iframe = document.querySelector('iframe#one-account-push-api');
      // Adding event listener on load of iframe to trigger 1Account Popup after all assest are loaded.
      iframe && iframe.addEventListener("load", function () {
        if (window.PUSH_API) {
          // Call collectData function to get user details.
          const userData = collectData();
          // Push API validate function with user data will show 1Account popup.
          userData && PUSH_API.validate(userData);
        }
      });
    } catch (err) {
      console.log(err);
    }
  </script>
  <!-- Example Ends -->
</body>
</html>
  • No labels