Requests

Realtime Payments, or RTP are handled both as an adapter through the Online Banking interface, as well as through inbound calls from an outside institution.

If a end user at a Q2 institution is kicking off the flow through their Online Banking, then it uses the adapter flow. However, they are sending the money somewhere, perhaps another institution. That other institution needs to accept the request and do something on its end. That’s the other flow, handling the inbound calls.

In both cases, we use the Request objects in here enumerated in the RequestType class in this file. Insantiating these objects can be done with .from_hq_request or .from_external_request. Both take in a dictionary (or json blob) and hydrate into the object. For inbound calls, these have a .store_in_hq method that will fill the Q2_RealtimePaymentExternal table in the database, which is viewable in the Online Banking interface as well.

class q2_sdk.models.adapters.instant_payments.requests.Agent(routing_number=None)[source]

Agent(routing_number: ‘str’ = None)

routing_number: str = None
class q2_sdk.models.adapters.instant_payments.requests.Q2Entity(phone_number, organization, agent=None, account_number=None, name=None, address=None, email=None, country_of_residence=None)[source]

Q2Entity(phone_number: ‘str’, organization: ‘dict’, agent: ‘Agent’ = None, account_number: ‘str’ = None, name: ‘str’ = None, address: ‘Address’ = None, email: ‘str’ = None, country_of_residence: ‘str’ = None)

phone_number: str
organization: dict
agent: Agent = None
account_number: str = None
name: str = None
address: Address = None
email: str = None
country_of_residence: str = None
class q2_sdk.models.adapters.instant_payments.requests.OtherParty(phone_number, organization, agent=None, account_number=None, name=None, address=None, email=None, country_of_residence=None)[source]

OtherParty(phone_number: ‘str’, organization: ‘dict’, agent: ‘Agent’ = None, account_number: ‘str’ = None, name: ‘str’ = None, address: ‘Address’ = None, email: ‘str’ = None, country_of_residence: ‘str’ = None)

phone_number: str
organization: dict
agent: Agent = None
account_number: str = None
name: str = None
address: Address = None
email: str = None
country_of_residence: str = None
class q2_sdk.models.adapters.instant_payments.requests.InstantPaymentsIdentification(end_to_end_identification=None, instruction_identification=None, transaction_identification=None)[source]

InstantPaymentsIdentification(end_to_end_identification: ‘str’ = None, instruction_identification: ‘str’ = None, transaction_identification: ‘str’ = None)

end_to_end_identification: str = None
instruction_identification: str = None
transaction_identification: str = None
class q2_sdk.models.adapters.instant_payments.requests.CommonRequestData(generated_transaction_id, user_id, customer_id, debtor_address, creditor_address)[source]

CommonRequestData(generated_transaction_id: ‘int’, user_id: ‘int’, customer_id: ‘int’, debtor_address: ‘Address’, creditor_address: ‘Address’)

generated_transaction_id: int
user_id: int
customer_id: int
debtor_address: Address
creditor_address: Address
static _from_hq_request(inp)[source]
Return type:

CommonRequestData

static _get_address_obj(inp, address_loc)[source]
Return type:

Address

static _get_payment_identification(inp)[source]
Return type:

InstantPaymentsIdentification

class q2_sdk.models.adapters.instant_payments.requests.CreditTransferRequest(generated_transaction_id, user_id, customer_id, debtor, amount, currency_code, creditor, settlement_date, payment_identification=None, remittance_information=None)[source]

CreditTransferRequest(generated_transaction_id: ‘int’, user_id: ‘int’, customer_id: ‘int’, debtor: ‘OtherParty’, amount: ‘Decimal’, currency_code: ‘str’, creditor: ‘Q2Entity’, settlement_date: ‘Optional[datetime]’, payment_identification: ‘InstantPaymentsIdentification’ = None, remittance_information: ‘dict’ = None)

generated_transaction_id: int
user_id: int
customer_id: int
debtor: OtherParty
amount: Decimal
currency_code: str
creditor: Q2Entity
settlement_date: Optional[datetime]
payment_identification: InstantPaymentsIdentification = None
remittance_information: dict = None
static from_external_request(inp)[source]
Return type:

CreditTransferRequest

static from_hq_request(inp)[source]
Return type:

CreditTransferRequest

async store_in_hq(vendor_name)[source]
Param:

vendor_name: Matches Q2_RTPVendor.ShortName

Return type:

HqResponse

class q2_sdk.models.adapters.instant_payments.requests.RequestForPaymentRequest(generated_transaction_id, user_id, customer_id, debtor, amount, currency, condition, creditor, expiry, payment_identification, remittance_information=None)[source]

RequestForPaymentRequest(generated_transaction_id: ‘int’, user_id: ‘int’, customer_id: ‘int’, debtor: ‘Q2Entity’, amount: ‘Decimal’, currency: ‘str’, condition: ‘dict’, creditor: ‘OtherParty’, expiry: ‘Optional[datetime]’, payment_identification: ‘InstantPaymentsIdentification’, remittance_information: ‘dict’ = None)

generated_transaction_id: int
user_id: int
customer_id: int
debtor: Q2Entity
amount: Decimal
currency: str
condition: dict
creditor: OtherParty
expiry: Optional[datetime]
payment_identification: InstantPaymentsIdentification
remittance_information: dict = None
static from_external_request(inp)[source]
Return type:

RequestForPaymentRequest

static from_hq_request(inp)[source]
Return type:

RequestForPaymentRequest

async store_in_hq(vendor_name)[source]
Parameters:

vendor_name (str) – Matches Q2_RTPVendor.ShortName

Return type:

HqResponse

enum q2_sdk.models.adapters.instant_payments.requests.RequestType(value)[source]

Valid values are as follows:

CreditTransferRequest = <RequestType.CreditTransferRequest: <class 'q2_sdk.models.adapters.instant_payments.requests.CreditTransferRequest'>>
RealtimePaymentRequest = <RequestType.RealtimePaymentRequest: <class 'q2_sdk.models.adapters.instant_payments.requests.RequestForPaymentRequest'>>
class q2_sdk.models.adapters.instant_payments.requests.InstantPaymentsResponse(success, external_id, exception_message='')[source]

InstantPaymentsResponse(success: ‘bool’, external_id: ‘str’, exception_message: ‘str’ = ‘’)

success: bool
external_id: str
exception_message: str = ''
serialize_as_q2msg()[source]
Return type:

Message

serialize_as_dict()[source]
q2_sdk.models.adapters.instant_payments.requests._get_unique_identifier(payment_identification)[source]
q2_sdk.models.adapters.instant_payments.requests.CreditTransferResponse

alias of InstantPaymentsResponse

q2_sdk.models.adapters.instant_payments.requests.RequestForPaymentResponse

alias of InstantPaymentsResponse