Skip to content

Commit

Permalink
Merge pull request #232 from checkout/feature/PIMOB-2118_update_reame
Browse files Browse the repository at this point in the history
PIMOB:2118: Clean up archive old readme files and update existing Read me file for prefill data
  • Loading branch information
chintan-soni-cko authored Aug 31, 2023
2 parents 8ae6bdc + 89b6217 commit 58e0323
Show file tree
Hide file tree
Showing 4 changed files with 28 additions and 518 deletions.
30 changes: 28 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -102,18 +102,44 @@ val paymentFlowHandler = object : PaymentFlowHandler {
}
```

### Step 2: Create a configuration object for your Payment form
### Step 2: Prepare your object responsible for the Frames configuration
```kotlin
/*
Providing PrefillData is optional. However, using this can increase the speed of the checkout experience for your users by pre-filling non-sensitive information.
*/
val userPrefillData = PrefillData(
cardHolderName = "Test Name", // represent the cardHolderName in PaymentDetail form
billingFormAddress = BillingFormAddress(
name = "UserName", // represent the cardHolderName in Billing form
address = Address(
addressLine1 = "Hill road",
addressLine2 = "90 Tottenham Court Road",
city = "London",
state = "England",
zip = "W1T 4PY",
country = Country.from(iso3166Alpha2 = "GB")
),
phone = Phone("7405987323", Country.UNITED_KINGDOM)
)
)

// Create a configuration object for your Payment form
val paymentFormConfig = PaymentFormConfig(
publicKey = PUBLIC_KEY, // set your public key
context = context, // set context
environment = Environment.SANDBOX, // set the environment
paymentFlowHandler = paymentFlowHandler, // set the callback
style = PaymentFormStyle(), // set the style
supportedCardSchemeList = emptyList() // set supported card schemes, by default uses all schemes
supportedCardSchemeList = emptyList(), // set supported card schemes, by default uses all schemes
prefillData = userPrefillData // set prefill data for user to improve their checkout experience
)
```

#### A note on `cardHolderName` and `name` in `PrefillData`
Please note that `cardHolderName` in the payment form and `name` in the billing form represent the same info, so you should only include this either in the payment or billing form, not both. If you do include it in both places, we will prioritise passing cardholderName in the Tokenisation request.

Additionally, if you hide these fields on the actual payment and billing forms, but include them in the `PrefillData` object, we will still pass them in the Tokenisation request. You may want to do this if you want to include this information in the Tokenisation request, but do not want the user to fill it out on the UI.

### Step 3: Create a Payment mediator
```kotlin
val paymentFormMediator = PaymentFormMediator(paymentFormConfig)
Expand Down
Loading

0 comments on commit 58e0323

Please sign in to comment.