diff --git a/README.md b/README.md index 40accf7d..b3966ac3 100644 --- a/README.md +++ b/README.md @@ -13,8 +13,8 @@ The Afterpay Android SDK makes it quick and easy to provide an excellent payment - [Features](#features) - [Getting Started](#getting-started) - [Configuring the SDK](#configuring-the-sdk) - - [Launching the Checkout (v1)](#launching-the-checkout-(v1)) - - [Launching the Checkout (v2)](#launching-the-checkout-(v2)) + - [Launching the Checkout (v1)](#launching-the-checkout-v1) + - [Launching the Checkout (v2)](#launching-the-checkout-v2) - [UI Components](#ui-components) - [Widget](#widget) - [Badge](#badge) @@ -55,9 +55,9 @@ The SDK provides easy integration of the Afterpay web login and checkout process ### Configuring the SDK -Each merchant has configuration specific to their account which is accessible from the `/configuration` API endpoint. This configuration is used by the SDK for rendering UI components and is applied globally using the [`Afterpay.setConfiguration`][docs-configuration] method. +Each merchant has configuration specific to their account which is accessible from the `/configuration` API endpoint. This configuration is used by the SDK for rendering UI components with the correct branding and assets, T&Cs, web links, and currency formatting, and is applied globally using the [`Afterpay.setConfiguration`][docs-configuration] method. -The following sample demonstrates how the SDK can be configured using the data supplied by the Afterpay API. It is up to you to decide how to best supply the locale which will determine the terms and conditions provided and currency formatting of the SDK. +The following sample demonstrates how the SDK can be configured using the data supplied by the Afterpay API. It is up to you to decide how best to supply the locale. Environment is required only for checkout v2; it's recommended to use `AfterpayEnvironment.PRODUCTION` for release builds and `AfterpayEnvironment.SANDBOX` for all others. @@ -73,7 +73,10 @@ Afterpay.setConfiguration( ) ``` -> **NOTE:** The merchant account is subject to change and it is recommended to update this configuration **once per day**. The example project provides a [reference][example-configuration] demonstrating how this may be implemented. +> **NOTES:** +> - The configuration must always be set when using the SDK, and before any included components are initialised. +> - The merchant account is subject to change and it is recommended to update this configuration **once per day**. The example project provides a [reference][example-configuration] demonstrating how this may be implemented. +> - Configuring the SDK with a UK locale will display Clearpay assets and branding, T&Cs, and currency formatting. ### Launching the Checkout (v1) @@ -115,9 +118,7 @@ class ExampleActivity: Activity { ### Launching the Checkout (v2) -Launch the Afterpay express checkout flow by starting the intent provided by the SDK for the given options. For more information on express checkout, including the available options and callbacks, please check the [API reference][express-checkout]. - -> **NOTE:** Configuration must always be set before calling checkout v2. +Launch the Afterpay checkout v2 flow by starting the intent provided by the SDK for the given options. For more information on express checkout, including the available options and callbacks, please check the [API reference][express-checkout]. ```kotlin class ExampleActivity: Activity { @@ -126,7 +127,7 @@ class ExampleActivity: Activity { } override fun onCreate(savedInstanceState: Bundle?) { - super.onCreate(savedInstanceState) + // ... Afterpay.setCheckoutV2Handler(object : AfterpayCheckoutV2Handler { override fun didCommenceCheckout(onTokenLoaded: (Result) -> Unit) { @@ -144,10 +145,6 @@ class ExampleActivity: Activity { TODO("Optionally update your application model with the selected shipping option") } }) - } - - override fun onCreate(savedInstanceState: Bundle) { - // ... val afterpayCheckoutButton = findViewById