Sale with Lodging Details {#pax-aio-pymnt-txn-sale-lodging-details}
===================================================================

Use this information to process a sale with lodging details. This transaction includes required lodging details in the payment request.  
Follow these steps to process a sale with lodging details.

1. Create an `AdditionalDetails` object and set one or more lodging fields.

   ```
   val lodgingDetails = AdditionalDetailsBuilder()
           .lodgingDetails(
               // Set value of the builder to the duration of stay
               LodgingDetailsBuilder(3)
                   .checkInDate("030125")
                   .checkOutDate("030425")
                   .guestSmokingPreference("N")
                   .numberOfGuests(2)
                   .numberOfRoomsBooked(1)
                   .guestName("John Doe")
                   .roomLocation("Ocean View")
                   .roomTaxElements("VAT")
                   .roomBedType("KING")
                   .roomRateType("CORPORATE")
                   .specialProgramCode("1")
                   .dailyRoomRate1(BigDecimal("150.00"))
                   .dailyRoomRate2(BigDecimal("160.00"))
                   .dailyRoomRate3(BigDecimal("170.00"))
                   .roomNights1(1)
                   .roomNights2(1)
                   .roomNights3(1)
                   .corporateClientCode("CORP123456")
                   .promotionalCode("PROMO2025")
                   .additionalCoupon("DISCOUNT10")
                   .travelAgencyCode("TA789")
                   .travelAgencyName("Premium Travel Agency")
                   .customerServicePhoneNumber("1-800-555-0199")
                   .tax(BigDecimal("45.00"))
                   .prepaidCost(BigDecimal("200.00"))
                   .foodAndBeverageCost(BigDecimal("125.00"))
                   .roomTax(BigDecimal("30.00"))
                   .adjustmentAmount(BigDecimal("15.00"))
                   .phoneCost(BigDecimal("8.00"))
                   .restaurantCost(BigDecimal("95.00"))
                   .roomServiceCost(BigDecimal("40.00"))
                   .miniBarCost(BigDecimal("25.00"))
                   .laundryCost(BigDecimal("18.00"))
                   .miscellaneousCost(BigDecimal("12.00"))
                   .giftShopCost(BigDecimal("35.00"))
                   .movieCost(BigDecimal("10.00"))
                   .healthClubCost(BigDecimal("20.00"))
                   .valetParkingCost(BigDecimal("30.00"))
                   .cashDisbursementCost(BigDecimal("5.00"))
                   .nonRoomCost(BigDecimal("40.00"))
                   .businessCenterCost(BigDecimal("15.00"))
                   .loungeBarCost(BigDecimal("55.00"))
                   .transportationCost(BigDecimal("75.00"))
                   .gratuityCost(BigDecimal("45.00"))
                   .conferenceRoomCost(BigDecimal("120.00"))
                   .audioVisualCost(BigDecimal("65.00"))
                   .banquetCost(BigDecimal("180.00"))
                   .internetAccessCost(BigDecimal("12.00"))
                   .earlyCheckOutCost(BigDecimal("20.00"))
                   .nonRoomTax(BigDecimal("25.00"))
                   .build()
           )
           .build()
   ```
2. Create a `TransactionParameters` object and provide the required information for the payment.

3. Retrieve the `transactionIntent` variable from the `mposUi` object and use the `startActivity` method to initiate the transaction flow.

   ```
   val transactionParameters = TransactionParameters.Builder()
               .charge(BigDecimal("1.00"), Currency.EUR)
               .customIdentifier("yourReferenceForTheTransaction")
               .additionalDetails(lodgingDetails)
               .build()

   val transactionIntent = mposUi.createTransactionIntent(transactionParameters)
   startActivityForResult(transactionIntent, MposUi.REQUEST_CODE_PAYMENT)
   ```
4. After the transaction is complete and the Summary screen is dismissed, the `onActivityResult` method is triggered. This action returns information about the last transaction.

   ```
   override fun onActivityResult(requestCode: Int, resultCode: Int, data: Intent?)
   {
       super.onActivityResult(requestCode, resultCode, data)

       if (requestCode == MposUi.REQUEST_CODE_PAYMENT) {
           when (resultCode) {
               // Result code from a successful transaction
               MposUi.RESULT_CODE_APPROVED -&gt; {
                  val transactionIdentifier = data?.getStringExtra(MposUi.RESULT_EXTRA_TRANSACTION_IDENTIFIER)
                  Toast.makeText(findViewById(android.R.id.content),"Transaction approved!\nIdentifier: $transactionIdentifier", Toast.LENGTH_LONG).show()
               }
               // Result code from a declined, aborted or failed transaction
               MposUi.RESULT_CODE_FAILED -&gt; {
                  Toast.makeText(findViewById(android.R.id.content), "Transaction was declined, aborted, or failed", Toast.LENGTH_LONG).show()
               }
           }
       }
   }
   ```
5. Get the full transaction object by retrieving the `latestTransaction` property from the `mposUi` object.

   ```
   val transactionObject = mposUi.latestTransaction
   ```

