Skip to content

Commit

Permalink
Update CHANGELOG and migration guide
Browse files Browse the repository at this point in the history
  • Loading branch information
sarahkoop committed Dec 14, 2023
1 parent d814dc3 commit bfb7b59
Show file tree
Hide file tree
Showing 2 changed files with 40 additions and 1 deletion.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,10 @@
* American Express
* Change parameters of `AmericanExpressGetRewardsBalanceCallback`
* Add `AmericanExpressResult`
* Visa Checkout
* Change parameters of `VisaCheckoutCreateProfileBuilderCallback` and
`VisaCheckoutTokenizeCallback`
* Add `VisaCheckoutProfileBuilderResult` and `VisaCheckoutTokenizeResult`

## 4.40.1 (2023-12-13)

Expand Down
37 changes: 36 additions & 1 deletion v5_MIGRATION_GUIDE.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ basics for updating your Braintree integration from v4 to v5.
1. [PayPal](#paypal)
1. [Local Payment](#local-payment)
1. [SEPA Direct Debit](#sepa-direct-debit)
1. [Visa Checkout](#visa-checkout)

## Android API

Expand Down Expand Up @@ -508,4 +509,38 @@ class MyActivity : FragmentActivity() {
- override fun onSEPADirectDebitFailure(error: java.lang.Exception) {
- // handle error
- }
}
}
```

## Visa Checkout

The Visa Checkout integration has been updated to improve result handling.

```diff
class MyActivity : FragmentActivity() {

- private lateinit var braintreeClient: BraintreeClient
private lateinit var visaCheckoutClient: VisaCheckoutClient

fun initializeClients() {
- braintreeClient = BraintreeClient(context, "TOKENIZATION_KEY_OR_CLIENT_TOKEN")
- visaCheckoutClient = VisaCheckoutClient(braintreeClient)
+ visaCheckoutClient = visaCheckoutClient(context, "TOKENIZATION_KEY_OR_CLIENT_TOKEN")
}

fun onPaymentButtonClick() {
- visaCheckoutClient.tokenize(request)
+ sepaDirectDebitClient.tokenize(request) { visaCheckoutResult ->
+ when(visaCheckoutResult) {
+ is (VisaCheckoutResult.Failure) -> {
+ // handle visaCheckoutResult.error
+ is (VisaCheckoutResult.Success) -> {
+ // handle visaCheckoutResult.nonce
+ }
+ }
+ }
}
}
```


0 comments on commit bfb7b59

Please sign in to comment.