Skip to content

Commit

Permalink
Fix markown diff
Browse files Browse the repository at this point in the history
  • Loading branch information
sarahkoop committed Oct 10, 2023
1 parent 9bee3a3 commit 41c02b1
Showing 1 changed file with 13 additions and 14 deletions.
27 changes: 13 additions & 14 deletions v5_MIGRATION_GUIDE.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,17 +33,16 @@ must be instantiated in the `OnCreate` method of your Activity or Fragment.
need to be instantiated in `OnCreate`.

```diff

class MyActivity : FragmentActivity() {

+ private lateinit var venmoLauncher: VenmoLauncher
+ private lateinit var venmoLauncher: VenmoLauncher
private lateinit var braintreeClient: BraintreeClient
private lateinit var venmoClient: VenmoClient

@override fun onCreate(savedInstanceState: Bundle?) {
- initializeClients()
+ // can initialize clients outside of onCreate if desired
+ venmoLauncher = VenmoLauncher(this) { authChallengeResult ->
- initializeClients()
+ // can initialize clients outside of onCreate if desired
+ venmoLauncher = VenmoLauncher(this) { authChallengeResult ->
venmoClient.tokenizeVenmoAccount(authChallengeResult) { venmoAccountNonce, error ->
error?.let { /* handle error */ }
venmoAccountNonce?.let { /* handle Venmo account nonce */ }
Expand All @@ -53,26 +52,26 @@ class MyActivity : FragmentActivity() {

fun initializeClients() {
braintreClient = BraintreeClient(context, "TOKENIZATION_KEY_OR_CLIENT_TOKEN")
- venmoClient = VenmoClient(this, braintreeClient)
+ venmoClient = VenmoClient(braintreeClient)
- venmoClient.setListener(this)
- venmoClient = VenmoClient(this, braintreeClient)
+ venmoClient = VenmoClient(braintreeClient)
- venmoClient.setListener(this)
}

fun onVenmoButtonClick() {
- venmoClient.tokenizeVenmoAccount(activity, request)
+ venmoClient.requestAuthChallenge(this, venmoRequest) { authChallenge, error ->
- venmoClient.tokenizeVenmoAccount(activity, request)
+ venmoClient.requestAuthChallenge(this, venmoRequest) { authChallenge, error ->
error?.let { /* handle error */ }
authChallenge?.let { venmoLauncher.launch(it) }
}
}

- override fun onVenmoSuccess(venmoAccountNonce: VenmoAccountNonce) {
- override fun onVenmoSuccess(venmoAccountNonce: VenmoAccountNonce) {
// handle Venmo account nonce
}
}

- override fun onVenmoFailure(error: java.lang.Exception) {
- override fun onVenmoFailure(error: java.lang.Exception) {
// handle error
}
}
}
```

0 comments on commit 41c02b1

Please sign in to comment.