Android
1.Create a Customer
// Use your customerId
var customerId = "cus_1452880617225281538"2.Construct data, and pay in PaymentSheet model
//RequestCreatePayment object
var testRequestPayment = TestRequestData.testRequestPayment
//RequestConfirmPayment object
var testConfirmPayment = TestRequestData.testConfirmPayment
//RequestPaymentMethod object
var testRequestPaymentMethod = TestRequestData.testRequestPaymentMethod
//support payment credit card
var testBankIvList = TestRequestData.testBankIvList
//customerId
var customerId = TestRequestData.customerId
//build Bundle object
var bundle = Bundle()
//pass currentPaymentModel
bundle.putSerializable(Constant.CURRENT_PAYMENT_MODEL,currentPaymentModel)
//pass RequestCreatePayment
bundle.putParcelable(Constant.CREATE_PAYMENT_REQUEST_TAG,testRequestPayment)
//pass RequestConfirmPayment
bundle.putParcelable(Constant.CONFIRM_PAYMENT_REQUEST_TAG,testConfirmPayment)
//pass customerId
bundle.putString(Constant.CUSTOMER_ID_TAG,TestRequestData.customerId)
//pass default RequestPaymentMethod
bundle?.putParcelable(Constant.CREATE_PAYMENT_METHOD_REQUEST_TAG,testRequestPaymentMethod)
//pass default supportBankList
bundle?.putSerializable(Constant.SUPPORT_BANK_LIST_TAG, testBankIvList)
//PayCardActivity contain SaveWithPaymentCardFragment and AddWithPaymentFragment,Support them to switch to each other
var intent = Intent(this, PayCardActivity::class.java)
intent.putExtra(CURRENT_PAYMENT_BUNDLE, bundle)
//start payment
startActivityLauncher.launch(intent)3.Pay in Hosted Payment Page Mode

4.Customer selects "save this card" during payment

5.Return the payment result
Last updated

