PayProtocol (P3) Usage and Message Flow

This page describes a few common scenarios one encounters when using the P3 protocol and Pay Server. All the messages used are described on the message specification page.

Simple Transactions

This diagram demonstrates a simple, successful transaction.

After logging the merchant in, the client should remember the list of the devices and their components in order to be able to send the execute transaction request message to the correct resource. If the device has only one transaction component, this information doesn't have to be displayed to the user, but the client still needs to store it.

Aborting a Transaction

This diagram demonstrates a transaction with an abort.

The merchant should only have the option to abort a transaction if the previous transaction update indicated that the transaction is currently abortable.

After sending in the abort operation request, the client should wait not only for the abort operation response, but also for the execute transaction response. Aborting a transaction might take a moment, depending on its state. Do not assume that the transaction is over after you send or receive the abort operation messages. There will always be a proper execute transaction response.

Transaction Actions

Sometimes, during an ongoing transaction process, the Pay Server asks you to do some additional actions, e.g. ask the shopper for a signature. When this happens the ongoing process stops and won't continue until you submit the correct message or, potentially, abort the process.

Submit Signature Action

In this case the Pay Server is asking you to submit the customer's signature. You can do this by making a SUBMIT_SIGNATURE_REQUEST, in which you can either submit a digital signature or tell the transaction process that the shopper will sign the printed receipt. To keep the standard request-response flow, the Pay Server responds to this by sending a SUBMIT_SIGNATURE_RESPONSE, which can have "status": "error" in case something was wrong with the request.

Aborting a Transaction during Action

When the Pay Server indicates an action, you can also respond with a normal abort flow. This diagram demonstrates the message flow in this case: