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
| Scenario | Recommended Approach |
|---|---|
| Simple integration, default behavior | WePaySDK.openCheckoutUrl() |
Need to use registerForActivityResult for result callbacks | WebViewPaymentActivity directly |
| Custom launch flags or task stack management | WebViewPaymentActivity directly |
| Back-stack or navigation component integration | WebViewPaymentActivity directly |
Next Step
Proceed to Configuration to add the required Android permissions.