Please find attached scripts generated with the token mentioned above for your convenience. With them you can generate a simulated e2e checkout flow at AiFi.

   1. test-customer.sh: example to create a shopper, please note that you can now ignore the email and password fields
   2. test-product.sh: example to add a product
   3. test-set-entry-code.sh: example on how to create an entry code for a given customer
   4. ALTERNATIVE:
        4.A. test-validate-code.sh: to simulate AiFi validating the qr code - when AiFi owns the qr scanner
        4.B. test-manual-check-in.sh: to simulate Retailer owning the qr code scanner (or payment terminal, or other authentication device)
            WARNING: this call only works in environments that have Store services attached or simulated.
   5. test-checkout.sh: example to send the checkout call

Note for loyalty integration:
Before running any end to end flow, remember to register your loyalty provider once.
Prerequisite: Test-customer.sh

❯❯❯ ./test-register-loyalty-provider.sh MyProvider https://example.com/ MySecret


Here is an example on how to use the end-to-end flow with the responses (see script contents and check the responses to see where different ids come from):

 

1. Test-customer.sh

❯❯❯ ./test-customer.sh test+bartek@aifi.io

{"email":"test+bartek@aifi.io","firstName":null,"lastName":null,"phone":null,"externalId":null,"id":49}%

2. Test-product.sh

❯❯❯ ./test-product.sh

{"name":"coca-cola","quantity":1,"price":"1.00","thumbnail":"https://spozywczo.pl/environment/cache/images/0_0_productGfx_4ee109d2feff567be1290bfaa14be1a7.jpg","weight":"1000.00","barcode":"00112233445","id":"44","productId":null,"invento
ryItemId":null,"storeId":1,"createdAt":"2021-03-04T13:42:18.724Z","updatedAt":"2021-03-04T13:42:18.724Z","category":null,"sku":null,"externalId":null}%

3. Test-set-entry-code.sh

❯❯❯ ./test-set-entry-code.sh bartek-test-code-5 49

{"code":"bartek-test-code-5"}%

4.A. Test-validate-code.sh

❯❯❯ ./test-validate-code.sh bartek-test-code-5

{"status":"OK","groupSize":1,"sessionId":"65ee3c4b-2657-4cff-9a6b-68fd8b04694a"}%

4.B. Test-manual-check-in.sh

❯❯❯ ./test-manual-check-in.sh bartek-test-code-5

{"status":"OK","groupSize":1,"sessionId":"65ee3c4b-2657-4cff-9a6b-68fd8b04694a","role":"customer"}%

5. Test-loyalty-code-scan.sh

❯❯❯ ./test-loyalty-code-scan.sh my-loyalty-qr-code

6. Test-checkout.sh

❯❯❯ ./test-checkout.sh 1 5 65ee3c4b-2657-4cff-9a6b-68fd8b04694a 44 my-loyalty-qr-code

{"storeId":1,"locationId":"gid://a/b/1","orderId":3,"paymentTransactionId":"some-id","paymentFailed":false,"shopifyTransactionId":null,"fulfillmentId":"","draftOrderId":"3","totalPrice":"5.00"}%

