Glase Unattended Payments Service introduction
Glase Unattended Payments Service (UPS) is service that allows your unattended POS to integrate with Glase. On this page you will find information how to proceed with UPS integration.
Actors
- Glase user - Glase’s and self-service machine user
- reseller - your backend maintaining self-service machines
- Glase Unattended Payments service - Glase service that will initiate purchase process on reseller side
- Glase - Glase backend
- Glase app - Glase mobile application
Flow diagram
All starts with user scanning QR code on your unattended POS.
method/service | exposed by | part of API | description |
---|---|---|---|
createPurchase | reseller | Glase Unattended Payment Service | REST service called by Glase Unattended Payment Service once user scanned QR Code on unattended POS. URL has to be HTTPS and end with “createPurchase” (for example https://yourdomain.name.com/seqr/createPurchase). |
sendInvoice | Glase | Glase Payment | SOAP method called by reseller backend triggered by createPurchase request. This method creates invoice on Glase side and returns it’s reference number (invoiceReference). By calling this method reseller provides also notificationUrl to be used for callbacks. |
notification callback service | reseller | Glase Payment | notificationUrl will be called (empty HTTPS POST responded with HTTP 200 OK code) by Glase once customer confirmed or cancelled payment. |
getPaymentStatus | Glase | Glase Payment | SOAP method called by reseller backend triggered by notification callback. Returns payment status - RESERVED or CANCELLED. |
updateInvoice | Glase | Glase Payment | SOAP method called by reseller after user choose products from self-service machine to update rows and totalAmount of final invoice. |
commitReservation | Glase | Glase Payment | SOAP method called by reseller to finalise payment process. |
All above methods/services are mandatory to implement.
Flow description
- Customer scanns QRCode placed on sel-service machine using Glase app.
- Glase Unattended Payments service calls createPurchase exposed by reseller sending JSON with token (machine id).
- Reseller calls sendInvoice exposed by Glase and returns the invoice reference to Glase Unattended Payments service.
- Reservation details are presented to customer.
- Customer confirms or cancels reservation with PIN number.
- Glase calls notificationUrl provided in sendInvoice request.
- Reseller calls getPaymentStatus and retrieves reservation status. If RESERVED merchants proceeds to next steps.
- Reseller unlocks self-service machine allowing user to choose the products.
- Customer chooses products from self-service machine.
- Reseller calls updateInvoice exposed by Glase to change details of invoice that user will see in Glase app.
- Reseller calls commitReservation to commit transaction with final amount.
Glase Unattended Payment Service QR code scheme
Qr code should have scheme:
where:
- w - merchantId sent in start-up kit (usually the same as resellerId)
- t - token (machine id) that will be passed in createPurchase request to merchant
Glase Unattended Payment Service API
At this point our Glase Unattended Payment Service API is based on one REST method - createPurchase which is required to be exposed by reseller.
createPurchase method
This method will be called by Glase Unattended Payment Service once customer scanned Glase QR Code on unattended POS. Glase Unattended Payment Service service will sent below values to reseller’s backend.
createPurchase request
parameter | description |
---|---|
token | This is identifier of self-service machine or purchase. |
amount | Max reservation amount for which invoice should be created by reseller. |
currency | Currency of reservation amount. |
msisdn | Customer’s phone number. |
createPurchase response
parameter | description |
---|---|
invoiceReferenceId | invoiceReference from sendInvoice response see Glase Payment API. |
Error createPurchase response
parameter | description |
---|---|
errorCode | Error code specifying the error on reseller’s backend. |
Possible values of error code
parameter | description |
---|---|
INSUFFICIENT_FUNDS | amount is to low to start the payment flow on reseller’s side. Eg. reservationAmount is lower than cheapest product in self-service machine. |
DEVICE_IN_USE | Device is already used by another customer. Someone else scanned qrCode, agreed for purchase but didn’t choose the product yet. |
DEVICE_UNAVAILABLE | Self-service machine is out of service. |
INVOICING_ERROR | Error occurred while calling sendInvoice exposed by Glase (Glase Payment API). |
SYSTEM_ERROR | Generic error. |