--- title: "Pay Monthly at Checkout" slug: "pay-monthly-at-checkout" updated: 2026-05-22T16:18:54Z published: 2026-05-22T16:18:54Z canonical: "developer.upgrade.com/pay-monthly-at-checkout" --- > ## Documentation Index > Fetch the complete documentation index at: https://developer.upgrade.com/llms.txt > Use this file to discover all available pages before exploring further. # Pay Monthly at Checkout ### Requesting an offer from Uplift To request an offer at checkout, call `setTripInfoForCheckout` with an up-to-date `ULPMTripInfo`. Every time the trip itinerary has changed/updated, simply call the same method with the new `ULPMTripInfo` to update the offer displayed. An `ULPMPrice` object can be optionally passed as a parameter to the `setTripInfoForCheckout` call, which pre-calculates an offer. The result of this calculation is sent back through the `ULCheckoutCallback.offerStatusReceived` delegate method. If the `ULPMPrice` object is not passed, the `payMonthlyAmount` will be 0, and the `hasOffer` will return false, but everything else functions correctly. The Flex Pay SDK maintains the current order. If there is need to reset and remove the existing order, call the same method with the `ULPMTripInfo` as well as a `renewOrderId` flag set to true/yes. This will refresh the order id and restart the Pay Monthly application. For all other cases, this flag should be set to false/no. ``` val trip: ULPMTripInfo = your_trip_info runCatching { ULOrderManager.getInstance().setTripInfoForCheckout(trip, false) }.onFailure { Log.d("UpliftSDK", "SDK has not been initialized properly.") } ``` `setTripInfoForCheckout` method can throw an `ULError` exception in case of error happens in the body, eg.: calling it without initializing the **SDK**. To be able to get any feedback about the offer status `ULCheckoutCallback` need to be provided to the `ULOrderManager`. ### Checkout Flow callback In order to receive information about the checkout flow, you need to provide a `ULCheckoutCallback` to the `ULOrderManager`. This callback will delegate every important piece of information to the host application. When the offer status changes, `offerStatusReceived` will be called with the corresponding state and monthly amount. If the `ULPMTripInfo` qualifies, the `hasOffer` boolean will be set to true. In this case, Flex Pay's checkout flow should be presented. If `hasOffer` boolean is false/no, the trip does not qualify and Flex Pay's checkout flow should not be presented. Please contact your Flex Pay representative to discuss why a trip might not qualify. ``` val callback = object : ULCheckoutCallback { override fun viewCreated() { // Callback method which is be called after the checkout view has created. } override fun viewDestroyed() { // Callback method which is be called after the checkout view has destroyed. } override fun offerStatusReceived(hasOffer: Boolean, payMonthlyAmount: Int?) { // Callback method which is called when an offer update is received. } override fun virtualCardReceived(virtualCard: ULPMVirtualCard) { // Callback method which is called when the checkout is finished successfully. } override fun onError(error: ULError) { // Callback method which is called when an error has happened during the checkout flow. } } runCatching { ULOrderManager.getInstance().setCheckoutCallback(callback) }.onFailure { Log.d("UpliftSDK", "SDK has not been initialized properly.") } ``` ### Presenting the Checkout Flow There are two ways to present the checkout flow. #### Embed Mode Presenting the checkout flow in a container. ``` val checkoutFragmentResult = runCatching { ULOrderManager.getInstance().getCheckoutFragment() } if (checkoutFragmentResult.isSuccess) { supportFragmentManager.beginTransaction() .replace(R.id.container, checkoutFragmentResult.getOrThrow()) .commit() } else { Log.d("UpliftSDK", "SDK has not been initialized properly.") } ``` `getCheckoutFragment` method can throw an `ULError` exception in case of error happens in the body, eg.: calling it without initializing the **SDK**. #### Full Screen Mode Presenting the checkout flow in full screen mode in an activity. **Deprecated solution, the preferred way to present the checkout is by using getCheckoutFragment.** ``` runCatching { ULOrderManager.getInstance().presentCheckoutFullScreen(this) }.onFailure { Log.d("UpliftSDK", "SDK has not been initialized properly.") } ``` presentCheckoutFullScreen `presentCheckoutFullScreen` method can throw an `ULError` exception in case of error happens in the body, eg.: calling it without initializing the **SDK**. ### Configuration of the Checkout flow There are several options available to customize the checkout flow and improve the user experience. These options can be found in the `ULCheckoutConfiguration` class. To set a configuration, you can set up the API's `ULConfiguration` with an `ULCheckoutConfiguration` object. ``` val apikey = "your api key goes here" val upCode = "UP-xxxxxx-xx" val checkoutConfiguration = ULCheckoutConfiguration( showCloseButton = true, screenTimeOut = 30L ) val configuration = ULConfiguration( upCode = upCode, apiKey = apikey, checkoutConfiguration = checkoutConfiguration, apiTimeout = 30L ) ULUpliftSDK.getInstance().setConfiguration(context, configuration, object : ConfigurationCallback { override fun onSuccess() { // This method will triggered when the initialize method succeeded } override fun onError(error: ULError) { // This method will triggered when the initialize method failed } }) ```