Skip to main content

Step 3: Use WebViewPaymentActivity Directly

If you need more control over how the checkout activity is launched, you can start WebViewPaymentActivity directly instead of using WePaySDK.openCheckoutUrl().


Starting the Activity Directly​

import com.wepay.sdk.payment.WebViewPaymentActivity

val intent = WebViewPaymentActivity.createIntent(
context = this,
checkoutUrl = checkoutUrl,
)
startActivity(intent)

When to Use This Approach​

ScenarioRecommended Approach
Simple integration, default behaviorWePaySDK.openCheckoutUrl()
Need to use registerForActivityResult for result callbacksWebViewPaymentActivity directly
Custom launch flags or task stack managementWebViewPaymentActivity directly
Back-stack or navigation component integrationWebViewPaymentActivity directly

Next Step​

Proceed to Configuration to add the required Android permissions.