How do I checkout a product (e.g. car hire) using services running locally, when paying for them using vouchers or a credit account?


159
views
0
15 months ago by

Running services locally and checking out products from the basket using Postman works fine for a payment card when only Travel, Payments and Wire services are running. But checking out products using vouchers or credit accounts require a different checkout JSON and 3 more services to be running, plus a bunch of properties to be set appropriately.

1 Answer


0
15 months ago by

For a vouchers checkout it was necessary to run the following services locally:

travel
payments
wire
virtual-cards
purchasing

Invoicing is probably not necessary, although I did have it running too.

The dev stacks for virtual-cards / purchasing will need to be created if they don't already exist, as described here: https://sites.google.com/a/clicktravel.com/software-engineering/technical-areas/deployment-pipeline--new/provisioning/provisioning-developer-cf-stack

Some properties in the local environmental properties file will need setting too (e.g. in /etc/clicktravel/properties/com.clicktravel.services.env.properties):

purchasing.default.user.id=purchasing

virtual-cards.aida.company=MISSMARPLE
virtual-cards.aida.password=Clicktravel2
virtual-cards.aida.user=T3HV3AW8
virtual-cards.aida.endpoint=https://aida2.airplus.com/Athena2/XMLServlet

To add voucher-spend for the test user, login to UAT with the demo.person@clicktravel.com user, and select the Vouchers app, then click on the "Add voucher" button and search for the user to add vouchers to (the user your bearer token in the local properties file relates to). Since the IAM->Users change, probably more than one result will appear (personal + team(s)). Not all of those identical-looking results will necessarily work, as the Vouchers app needs updating to only show the results which will.

The checkout/confirm basket JSON for using vouchers is of this form:

{
   "desiredVoucherSpend": {
      "amount": "27.27",
      "currency": "GBP"
   },
   "products": [
      {
         "id": "f0ad6d54-6ec8-48de-a90a-29060798c8c4",
         "bookingDetails": {
            "type": "VehicleProductBookingDetails"
         }
      }
   ]
}

The checkout/confirm basket JSON for a credit account has this form:

{
   "products": [
      {
         "id": "622e370d-f5fe-4091-b31d-476c10a7ff8b",
         "formOfPayment": {
            "id": "a2dad5c8-b1b8-4553-8cee-94eac2e942ea"
         },
         "bookingDetails": {
            "type": "VehicleProductBookingDetails"
         }
      }
   ]
}

 

The formOfPayment id above (i.e. 'a2dad5c8-b1b8-4553-8cee-94eac2e942ea') relates to a credit account listed in the formOfPaymentItems array for the user's entry in travel.user in DEV. e.g. this one borrowed from Chau :-)

{
   "@class": "com.clicktravel.services.travel.infrastructure.persistence.model.CreditAccountFormOfPaymentItem",
   "creditAccountId": "chauTestCustomerAccount",
   "creditAccountName": "ChauTestAccount",
   "id": "a2dad5c8-b1b8-4553-8cee-94eac2e942ea",
   "type": "CREDIT_ACCOUNT"
}

Please login to add an answer/comment or follow this question.

Similar posts:
Search »