How do I checkout a product (e.g. car hire) using services running locally, when paying for them using vouchers or a credit account?
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.
For a vouchers checkout it was necessary to run the following services locally:
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):
To add voucher-spend for the test user, login to UAT with the firstname.lastname@example.org 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:
The checkout/confirm basket JSON for a credit account has this form:
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 :-)