Flow

Flow is initiated by Merchant.

Merchant

The payment process from the Merchant’s point of view:

blockdiag Merchant Payment Processor MQTT Broker (2) SUBSCRIBE to "acks/{session_id}" PUBLISH on "merchant_order_request/{application_id}" PUBLISH on "acks/{session_id}" PUBLISH on "acks/{session_id}" (6) UNSUBSCRIBE to "acks/{session_id}" (3) MerchantOrderRequest (4) Ack[status = new] (5) Ack[status = paid]
  1. Merchant generates a random session_id.

  2. Merchant subscribes to the topic acks/{session_id}.

  3. Merchant create a MerchantOrderRequestMessage and publishes on topic merchant_order_request/{application_id}.

    crypto_currency field should be empty if customer wants to pay with Manta.

  4. Merchant receives an AckMessage with status == “new” on topic acks/{session_id}.

    Merchant can create QR code/NDEF Message with URL data

  5. Merchant will receive an AckMessage messages as payment changes state. With status == “paid” the transaction is completed.

  6. Merchant unsubscribes from the topic acks/{session_id}.

Payment Processor

The payment process from the Payment Processor’s side:

blockdiag Merchant Payment Processor Wallet MQTT Broker (1a) SUBSCRIBE to "merchant_order_request/+" (1a) SUBSCRIBE to "merchant_order_cancel/+" PUBLISH on "certificate" PUBLISH on "merchant_order_request/{application_id}" PUBLISH on "acks/{session_id}" (2c) SUBSCRIBE to "payments/{session_id}" (2c) SUBSCRIBE to "payment_requests/{session_id}/+" (3) PUBLISH on "payment_requests/{session_id}/{crypto_currency}" PUBLISH on "payment_requests/{session_id}" PUBLISH on "payments/{session_id}" PUBLISH on "acks/{session_id}" PUBLISH on "acks/{session_id}" (1b) Manta CA certificate (2) MerchantOrderRequest (2b) Ack[status = new] (3a) PaymentRequestEnvelope (4a) PaymentMessage (4b) Ack[status = paid] (4b) Ack[status = paid] initialization complete crypto_currency == null
  1. When it starts:

    1. it subscribes to merchant_order_request/{application_id} and merchant_order_cancel/{session_id} topics;
    2. it publishes the Manta CA certificate to certificate topic, with retention.
  2. On message MerchantOrderRequestMessage on a specific merchant_order_request/{application_id} topic:

    1. generates an AckMessage with status == “new”. The url field is in manta format if field crypto_currency is null (manta protocol), otherwise url format will depend on the crypto_currency;
    2. publishes this the AckMessage on the acks/{session_id} topic;

    If manta protocol is used:

    1. It subscribes to payments/{session_id} and payment_requests/{session_id}/{crypto_currency} topics.
  3. On an event on payment_requests/{session_id}/{crypto_currency} without any payload:

    1. creates a new PaymentRequestMessage and publishes it on payment_requests/{session_id} wrapped into a PaymentRequestEnvelope with retention.

    {crypto_currency} parameter can be “all” to request multiple cryptos.

    Destination should be specific to {crypto_currency} field.

  4. On message (a) PaymentMessage on payments/{session_id} it starts monitoring blockchain and on progress publishes (b) AckMessage on acks/{session_id}.

Manta enabled wallet

The payment process from the Wallet point of view:

blockdiag Wallet Payment Processor MQTT Broker read manta URL (1) SUBSCRIBE to "payment_requests/{session_id}" (2) PUBLISH on "payment_request_message/{session_id}/{crypto_currency}" PUBLISH on "payment_requests/{session_id}" PUBLISH on "payments/{session_id}" (6) SUBSCRIBE to "acks/{session_id}" PUBLISH on "acks/{session_id}" (3) PaymentRequest (5) Payment (7) Ack[status = paid]
  1. After receiving a Manta URL via QR code or NFC it subscribes to payment_requests/{session_id}.

  2. Publishes on payment_requests/{session_id}/{crypto_currency}.

    {crypto_currency} can be “all” to request multiple cryptos.

  3. On PaymentRequestMessage on topic payment_requests/{session_id} if destinations field does not contain desired crypto, check supported_cryptos and eventually go back to 2).

  4. Verifies PaymentRequestMessage signature.

  5. After payment on blockchain publishes a PaymentMessage on payments/{session_id} topic.

  6. Subscribes to the topic named acks/{session_id}

  7. Wallet will receive an AckMessage messages as payment changes state. With status == “paid” the transaction is completed.

Complete Manta flow diagram

../_images/manta-protocol-full.svg

Detailed Manta Protocol flow

You can Open diagram in new window.