Class: DnaPaymentsPartnerReportingSettlementApIs::PosTransactionsApi
- Inherits:
-
BaseApi
- Object
- BaseApi
- DnaPaymentsPartnerReportingSettlementApIs::PosTransactionsApi
- Defined in:
- lib/dna_payments_partner_reporting_settlement_ap_is/apis/pos_transactions_api.rb
Overview
PosTransactionsApi
Constant Summary
Constants inherited from BaseApi
Instance Attribute Summary
Attributes inherited from BaseApi
Instance Method Summary collapse
-
#get_pos_transaction_by_id(transaction_id) ⇒ ApiResponse
Query a single POS transaction processed by any of your merchants, using the transaction ID returned from a previous list query.
-
#get_pos_transactions(from, to, page: 1, size: 50, merchant_id: nil, status: nil) ⇒ ApiResponse
Query all POS transactions processed by your merchants.
Methods inherited from BaseApi
#initialize, #new_parameter, #new_request_builder, #new_response_handler, user_agent, user_agent_parameters
Constructor Details
This class inherits a constructor from DnaPaymentsPartnerReportingSettlementApIs::BaseApi
Instance Method Details
#get_pos_transaction_by_id(transaction_id) ⇒ ApiResponse
Query a single POS transaction processed by any of your merchants, using the transaction ID returned from a previous list query. as returned by GET POS Transactions.
85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 |
# File 'lib/dna_payments_partner_reporting_settlement_ap_is/apis/pos_transactions_api.rb', line 85 def get_pos_transaction_by_id(transaction_id) @api_call .request(new_request_builder(HttpMethodEnum::GET, '/v1/partners/pos/transactions/{transactionId}', Server::DEFAULT) .template_param(new_parameter(transaction_id, key: 'transactionId') .is_required(true) .should_encode(true)) .header_param(new_parameter('application/json', key: 'accept')) .auth(Single.new('BearerAuth'))) .response(new_response_handler .deserializer(APIHelper.method(:custom_type_deserializer)) .deserialize_into(PosTransaction.method(:from_hash)) .is_api_response(true) .local_error('400', 'Bad Request — request format is invalid.', ErrorException) .local_error('401', 'Unauthorized — invalid authentication credentials have been'\ ' supplied.', ErrorException) .local_error('403', 'Forbidden — authorisation has failed due to insufficient'\ ' permissions.', ErrorException) .local_error('404', 'Not Found — the requested resource does not exist.', ErrorException) .local_error('422', 'Unprocessable Entity — the API cannot complete the requested'\ ' action.', ErrorException) .local_error('500', 'Internal Server Error — an internal error has occurred, please'\ ' try again later.', ErrorException) .local_error('503', 'Service Unavailable — API is temporarily offline for'\ ' maintenance, please try again later.', ErrorException)) .execute end |
#get_pos_transactions(from, to, page: 1, size: 50, merchant_id: nil, status: nil) ⇒ ApiResponse
Query all POS transactions processed by your merchants. Transactions are
available for 365 days; a maximum span of 30 days can be specified per
request via from/to.
transactions. Transactions are available for 365 days and a maximum of 30
days can be specified per request. ISO 8601 format.
Transactions are available for 365 days and a maximum of 30 days can be
specified per request. ISO 8601 format.
merchant, allocated by DNA Payments and returned in GET Merchants. Up to
10 IDs may be submitted, comma separated. Specifying an id will only
return results for that merchant.
transaction status.
27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 |
# File 'lib/dna_payments_partner_reporting_settlement_ap_is/apis/pos_transactions_api.rb', line 27 def get_pos_transactions(from, to, page: 1, size: 50, merchant_id: nil, status: nil) @api_call .request(new_request_builder(HttpMethodEnum::GET, '/v1/partners/pos/transactions', Server::DEFAULT) .query_param(new_parameter(from, key: 'from') .is_required(true)) .query_param(new_parameter(to, key: 'to') .is_required(true)) .query_param(new_parameter(page, key: 'page')) .query_param(new_parameter(size, key: 'size')) .query_param(new_parameter(merchant_id, key: 'merchantId')) .query_param(new_parameter(status, key: 'status')) .header_param(new_parameter('application/json', key: 'accept')) .auth(Single.new('BearerAuth'))) .response(new_response_handler .deserializer(APIHelper.method(:custom_type_deserializer)) .deserialize_into(PosTransactionsResponse.method(:from_hash)) .is_api_response(true) .local_error('400', 'Bad Request — request format is invalid.', ErrorException) .local_error('401', 'Unauthorized — invalid authentication credentials have been'\ ' supplied.', ErrorException) .local_error('403', 'Forbidden — authorisation has failed due to insufficient'\ ' permissions.', ErrorException) .local_error('404', 'Not Found — the requested resource does not exist.', ErrorException) .local_error('422', 'Unprocessable Entity — the API cannot complete the requested'\ ' action.', ErrorException) .local_error('500', 'Internal Server Error — an internal error has occurred, please'\ ' try again later.', ErrorException) .local_error('503', 'Service Unavailable — API is temporarily offline for'\ ' maintenance, please try again later.', ErrorException)) .execute end |