Open the payment UI

Create Pay Station Intent

To open the payment UI, pass the token obtained in the previous step to the XPayments.createIntentBuilder SDK method.

Copy
Full screen
Small screen
val intent = XPayments.createIntentBuilder(getContext())
            .accessToken(AccessToken(token))
            .isSandbox(BuildConfig.IS_SANDBOX)
            .build()

Start activity using created Intent

Copy
Full screen
Small screen
startActivityForResult(intent, RC_PAYSTATION)

Parse activity result

Copy
Full screen
Small screen
override fun onActivityResult(requestCode: Int, resultCode: Int, data: Intent?) {
       super.onActivityResult(requestCode, resultCode, data)
       if (requestCode == RC_PAYSTATION) {
           val result = XPayments.Result.fromResultIntent(data)
       }
   }

Was this article helpful?
Thank you!
Is there anything we can improve? Message
We're sorry to hear that
Please explain why this article wasn't helpful to you. Message
Thank you for your feedback!
We'll review your message and use it to help us improve your experience.

Continue reading