Messages

Messages are object that are use used to store and communicate the data of the Merchant order and the correspondent Wallet payment. They are serialize to/from term:JSON for transmission using MQTT protocol.

Ack

class manta.messages.AckMessage(txid, status, url=None, amount=None, transaction_hash=None, transaction_currency=None, memo=None, version='1.6')[source]

Ack Message

Order progress message.

Published by the Payment Processor on acks/{session_id}.

Parameters:
  • txid (str) – progressive transaction ID generated by Merchant
  • status (Status) – ack type
  • url (Optional[str]) – url to be used for QR Code or NFC. Used in NEW
  • amount (Optional[Decimal]) – amount in crypto currency. Used in NEW
  • transaction_hash (Optional[str]) – hash of transaction. After PENDING
  • memo (Optional[str]) – extra text field
  • version (Optional[str]) – Manta protocol version
class manta.messages.Status[source]

Status for ack messages

CANCELED = 'canceled'

Order has been canceled

INVALID = 'invalid'

Order invalid - Ex timeout. Additional info can be specified in Ack Memo field

NEW = 'new'

Created after accepting Merchant Order

PAID = 'paid'

Created after blockchain confirmation

PENDING = 'pending'

Created after receiving payment from wallet

Merchant Order Request

class manta.messages.MerchantOrderRequestMessage(amount, session_id, fiat_currency, crypto_currency=None, version='1.6')[source]

Merchant Order Request

Published by Merchant on merchant_order_request/{application_id}.

Parameters:
  • amount (Decimal) – amount in fiat currency
  • fiat_currency (str) – fiat currency
  • session_id (str) – random uuid base64 safe
  • crypto_currency (Optional[str]) – None for manta protocol. Specified for legacy
  • version (Optional[str]) – Manta protocol version

Payment Request Message

class manta.messages.PaymentRequestMessage(merchant, amount, fiat_currency, destinations, supported_cryptos)[source]

Payment Request

Generated after request on payment_requests/{session_id}/{crypto_currency}.

Published in Envelope to Payment Processor on payment_requests/{session_id}.

Parameters:
  • merchant (Merchant) – merchant data
  • amount (Decimal) – amount in fiat currency
  • fiat_currency (str) – fiat currency
  • destinations (List[Destination]) – list of destination addresses
  • supported_cryptos (Set[str]) – list of supported crypto currencies
class manta.messages.Merchant(name, address=None)[source]
Parameters:
  • name (str) – merchant name
  • address (Optional[str]) – merchant address
class manta.messages.Destination(amount, destination_address, crypto_currency)[source]
Parameters:
  • amount (Decimal) – amount in crypto currency
  • destination_address (str) – destination address for payment
  • crypto_currency (str) – crypto_currency (ex. NANO, BTC…)mo
class manta.messages.PaymentRequestEnvelope(message, signature, version='1.6')[source]

Payment Request Envelope

Envelope with PaymentRequestMessage and signature

Published by Payment Processor on payment_requests/{session_id}.

Parameters:
  • message (str) – message as json string
  • signature (str) – PKCS#1 v1.5 signature of the message field
  • version (Optional[str]) – Manta protocol version

Payment

class manta.messages.PaymentMessage(crypto_currency, transaction_hash, version='1.6')[source]

Payment Message

Published by Wallet on payments/{session_id}

Parameters:
  • crypto_currency (str) – crypto currency used for payment
  • transaction_hash (str) – hash of transaction
  • version (Optional[str]) – Manta protocol version