@@ -190,28 +190,33 @@ We refactored the `PayPalWebClient` API to improve the developer experience. Use
190190 private fun launchPayPalCheckout() {
191191 val checkoutRequest: PayPalWebCheckoutRequest = TODO("Create a PayPal checkout request.")
192192- payPalClient.start(checkoutRequest)
193- + when (val result = paypalClient.start(this, checkoutRequest)) {
194- + is PayPalPresentAuthChallengeResult.Success -> {
195- + // Auth Challenge presentation succeeded. Once the user has completed the auth challenge and
196- + // the merchant app has re-entered the foreground via onResume() or onNewIntent(), make a
197- + // balancing call to finishStart()
193+ + paypalClient.start(this, checkoutRequest) { result ->
194+ + when (result) {
195+ + is PayPalPresentAuthChallengeResult.Success -> {
196+ + // Auth Challenge presentation succeeded. Once the user has completed the auth challenge and
197+ + // the merchant app has re-entered the foreground via onResume() or onNewIntent(), make a
198+ + // balancing call to finishStart()
199+ + }
200+ + is PayPalPresentAuthChallengeResult.Failure -> TODO("Handle Present Auth Challenge Failure")
198201+ }
199- + is PayPalPresentAuthChallengeResult.Failure -> TODO("Handle Present Auth Challenge Failure")
200202+ }
201203 }
202204
203205 private fun launchPayPalVault() {
204206 val vaultRequest: PayPalWebVaultRequest = TODO("Create a card vault request.")
205207- payPalClient.vault(vaultRequest)
206- + when (val result = paypalClient.vault(this, vaultRequest)) {
207- + is PayPalPresentAuthChallengeResult.Success -> {
208- + // Auth Challenge presentation succeeded. Once the user has completed the auth challenge and
209- + // the merchant app has re-entered the foreground via onResume() or onNewIntent(), make a
210- + // balancing call to finishVault()
208+ + paypalClient.vault(this, vaultRequest) { result ->
209+ + when (result) {
210+ + is PayPalPresentAuthChallengeResult.Success -> {
211+ + // Auth Challenge presentation succeeded. Once the user has completed the auth challenge and
212+ + // the merchant app has re-entered the foreground via onResume() or onNewIntent(), make a
213+ + // balancing call to finishVault()
214+ + }
215+ + is PayPalPresentAuthChallengeResult.Failure -> TODO("Handle Present Auth Challenge Failure")
211216+ }
212- + is PayPalPresentAuthChallengeResult.Failure -> TODO("Handle Present Auth Challenge Failure")
213217+ }
214218 }
219+ }
215220
216221+ fun checkForPayPalAuthCompletion(intent: Intent) {
217222+ // check for checkout completion
0 commit comments