Checkout Feature
This document will guide you on how to correctly integrate the Checkout feature via PowerBoard.
This document will guide you on how to correctly integrate the Checkout feature via PowerBoard.
The Checkout feature revolutionizes the merchant's checkout process by offering a user-friendly, adaptable, and easily customisable checkout solution. This innovative approach streamlines transactions and provides a seamless experience for both merchants and customers. Through available customisation options, merchants can align the checkout interface with their brand identity, making it appear native to their e-commerce ecosystem. This includes matching colour schemes and fonts to create a cohesive shopping experience from browsing to purchase completion.
Current Supported Services and Flows
Card Payments Flows:
- Card Payments with 3D Secure (Recommended)
- Card Payments without 3D Secure
Alternate Payment Methods:
- Afterpay v1 Direct Charge
- Zip Direct Charge
Before you begin:
When utilising the Checkout feature you will be required to create and use an Access Token.
Access Tokens are generated via PowerBoard’s Merchant Dashboard, in a few easy steps:
- Login to the PowerBoard Merchant Dashboard.
- Click on the ‘Access Tokens’ link in the navigation dropdown.
- On screen, select the 'Create New' button.
- Select the following permissions
- checkouts:create-intent
- checkouts:search
- checkouts:get
- checkouts:get-versions
- checkouts-templates:get
- checkouts-templates:search
- checkouts-templates:create
- checkouts-templates:update
- checkouts-templates:get-schemas
- Click Save
- Copy your Access Token and store it somewhere secure as once it has been generated it can no longer be accessed.
You will need
Before beginning setup, ensure you grab your Gateway IDs for the relevant payment types as you will need these to complete setup.
Log into the PowerBoard Merchant Dashboard
Navigate to 'Checkout' in the navigation section
Select ' Create New'
From the 'Select Template Options' you will get the choice of
Select the template that you wish, for a first-time setup, we recommend using the Configuration & Customisation option.
On the next step, you will get the option to label your templates, we recommend that you keep these unique and call out if the template is for configuration or customisation. On configuration you will also get the option to select which version of the configuration template you want to create.
After selecting your API version this will bring up a list of services, for the service you wish to enable select a transaction flow associated with the service you wish to enable and add in the Service ID which you can find in the 'Services' screen
Once you have selected your workflows and entered the Service ID associated with each service, click 'Save and Next' (You will also have the ability to update an existing configuration template once it has been created)
You will need to label your customisation template, similar to Step 5, we recommend you keep the label for your configuration template unique and identify that it is a Configuration Template.
You will have the ability to customise the look and feel of your Checkout Widget via the following fields:
Apply and customization settings and click 'Save' (You will also have the ability to update an existing customisation template once it has been created)
You will now see the templates you just created appear in your Templates list with an associated ID which can be used in your integration.
If you wish to preview the templates that you have created, you can select the 'Preview' option on the Checkout page which will give you the ability to add some configuration data to render the widget within the Merchant Dashboard. (Note: Preview option is only currently available in the PreProduction environment)
Enter information into the provided fields and select the Configuration and Customisation templates you have just created. Once the information has been entered, hit 'Create' and this will render the widget into the 'Preview' column.
Note
In the PreProduction environment the preview tab will allow you to run test transactions using your created templates you have created. For testing Card Payments, you can use our PowerBoard Test Cards
Refer to the 'How to Setup Checkout' part of this guide to see how this can be done.
The Intent encapsulates the payment context for the transaction.
Note:
The intent call must also include customer specific information (collected during checkout or from
their customer profile) such as contact and address details.
API Endpoint | <https://api.preproduction.powerboard.commbank.com.au/v1/checkouts/intent> |
---|---|
HTTP Method | POST |
Headers | x-access-token- POWERBOARD_ACCESS_TOKEN - This is your PowerBoard API Access Token. Content-Type - application/jsonContent - Type will always be application/json. |
Request Parameters | customisation.template_id - string - Your previously created Customisation ID for the Checkout Widget configuration.template_id - string - Your previously created Configuration ID for the Checkout Widget customer.email - string - Customers Email Address customer.phone - string - Phone Number of Customer customer.billing_address.first_name - string - First Name of Customer. customer.billing_address.last_name - string - Last Name of Customer. customer.billing_address.address_line1 - string - Customer Address Line 1 customer.billing_address.address_line2 - string - Customer Address Line 2. customer.billing_address.address_city - string - Customers City. customer.billing_address.address_state - string - Customers State. customer.billing_address.address_country - string - Customers Country customer.billing_address.address_postcode - string - Customers Postcode amount - string - Total amount for the transaction. version - string - The version of Checkout API being used. currency - string. Always set to 'AUD' reference - string. A unique reference for the transaction |
{
"customisation": {
"template_id": "YOUR_CUSTOMISATION_TEMPLATE_ID",
},
"configuration": {
"template_id": "YOUR_CUSTOMISATION_TEMPLATE_ID",
},
"customer": {
"email": "[email protected]",
"phone": "+6141111111",
"billing_address": {
"first_name": "Test",
"last_name": "User",
"address_line1": "123 Test Street",
"address_line2": "Unit 123",
"address_city": "Sydney",
"address_state": "NSW",
"address_country": "AU",
"address_postcode": "2000",
}
},
"amount": 120,
"version": 1,
"currency": "AUD",
"reference": "Order 12345678"
}
{
"status": 201,
"error": null,
"resource": {
"type": "checkout",
"data": {
"_id": "67107db89d218493ecc4e082",
"version": 1,
"status": "active",
"reason": null,
"amount": 120,
"currency": "AUD",
"reference": "Order 12345678",
"journey": [
{
"sense": "info",
"title": "Workflow created",
"message": "Checkout process created ....",
"thread": "main",
"context": null,
"_id": "67107db89d218493ecc4e085",
"created_at": "2024-10-17T03:00:08.850Z",
"updatedAt": "2024-10-17T03:00:08.850Z"
}
],
"created_at": "2024-10-17T03:00:08.759Z",
"updated_at": "2024-10-17T03:00:08.850Z",
"token": "YOUR_INTENT_TOKEN"
}
}
}
Store the returned intent_token to utilise in the next step.
Note:'customisation.template_ID' and 'reference' fields are optional.
Use the returned intent_token from the previous step and use it to render the Checkout Widget to the end-user.
<div id="widget"></div>
<script
src="https://widget.preproduction.powerboard.commbank.com.au/sdk/latest/widget.umd.js"></script>
<script>
var widget = new cba.Checkout('#widget',"{{intent_token}}");
The Master Widget in the checkout process sends specific notifications to merchants about their customers' checkout status. These notifications are crucial for managing the cardholder experience, addressing various checkout outcomes including:
onPaymentSuccessful
This event is triggered when a payment is completed successfully. It allows the merchant to
execute specific actions, such as updating the order status, notifying the customer of the
successful transaction, and/or redirecting the customer to a confirmation page
onPaymentError
This event is triggered when a payment fails. Merchants can use this event to handle payment
errors, such as displaying error messages to customers or logging the error details.
onPaymentExpired
This event is triggered when a payment workflow session expires. This typically happens if the
customer takes too long to complete the payment (e.g after 15 minutes of inactivity).
Example below:
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Checkout</title>
<style></style>
</head>
<body>
<h1>Widget</h1>
<div id="widget"></div>
<script src="https://widget.preproduction.powerboard.commbank.com.au/sdk/latest/widget.umd.js"></script>
<script>
var widget = new cba.Checkout('#widget', "{{intent_token}}");
widget.onPaymentSuccessful(function(data) {
console.log("success: ", data)
});
widget.onPaymentFailure(function(error) {
console.log("failure: ", error)
});
widget.onPaymentExpired(function(data) {
console.log("expired: ", data)
})
</script>
</body>
</html>
PowerBoard provides you with the ability to review the history of your users checkout experience by providing insights into the steps taken for your user to complete their checkout process. This includes:
Selecting Actions --> View logs will provide you with further insights to exactly what payment methods were selected and details around the outcome of these actions. These have been categorised into colour statuses, which are:
When a merchant creates Configuration or Customisation templates
in the Dashboard, they will see the 'Version' field. This field is important because it allows them
to manage and apply different versions of their templates across various checkout workflows.
● Version Transparency:
Each version of a template corresponds to a specific set of
features and behaviours. By specifying the version in the template, merchants can
ensure that the same configuration is applied consistently across all their checkouts.
● Backward Compatibility:
If the merchant updates a template to a new version, previous
versions remain supported. This means they can maintain older checkout workflows
without disruption while taking advantage of new features in updated versions.
When generating an intent using the /intent API
endpoint, merchants need to explicitly pass the version of the workflow that they want to use.
This is key to maintaining consistency between the API and the Master Widget.
● Explicit Versioning:
By specifying the workflow version in merchants' API request, they
ensure that the API and the Master Widget are aligned. This removes any ambiguity
about which version of the checkout process is being used, reducing the risk of
inconsistencies.
● Stability
During updates, even as PowerBoard releases updates to the API and Master
Widget, their integration remains stable. Merchants only move to a new version of the
workflow when they are ready, giving them control over the timing of any changes.