Class: DnaPaymentsPartnerReportingSettlementApIs::EcommerceTransactionsApi
- Inherits:
-
BaseApi
- Object
- BaseApi
- DnaPaymentsPartnerReportingSettlementApIs::EcommerceTransactionsApi
- Defined in:
- lib/dna_payments_partner_reporting_settlement_ap_is/apis/ecommerce_transactions_api.rb
Overview
EcommerceTransactionsApi
Constant Summary
Constants inherited from BaseApi
Instance Attribute Summary
Attributes inherited from BaseApi
Instance Method Summary collapse
-
#get_ecommerce_transaction_by_id(transaction_id) ⇒ ApiResponse
Query a single Ecommerce transaction processed by any of your merchants, using the transaction ID returned from a previous list query.
-
#get_ecommerce_transactions(from, to, page: 1, size: 50, merchant_id: nil, status: nil, processor: nil, search_by: nil) ⇒ ApiResponse
Query Ecommerce 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_ecommerce_transaction_by_id(transaction_id) ⇒ ApiResponse
Query a single Ecommerce transaction processed by any of your merchants, using the transaction ID returned from a previous list query. as returned by GET Transactions.
82 83 84 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 |
# File 'lib/dna_payments_partner_reporting_settlement_ap_is/apis/ecommerce_transactions_api.rb', line 82 def get_ecommerce_transaction_by_id(transaction_id) @api_call .request(new_request_builder(HttpMethodEnum::GET, '/v1/partners/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(EcommerceTransaction.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)) .execute end |
#get_ecommerce_transactions(from, to, page: 1, size: 50, merchant_id: nil, status: nil, processor: nil, search_by: nil) ⇒ ApiResponse
Query Ecommerce 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.
Multiple statuses may be supplied, comma separated. See the Ecommerce
Reference documentation for the full list of statuses (not available at
spec-generation time).
the platform responsible for processing the transaction.
transactions by the field used to match the from/to date range (as
documented, this parameter mirrors the processor filtering behaviour
described in the source docs).
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 |
# File 'lib/dna_payments_partner_reporting_settlement_ap_is/apis/ecommerce_transactions_api.rb', line 35 def get_ecommerce_transactions(from, to, page: 1, size: 50, merchant_id: nil, status: nil, processor: nil, search_by: nil) @api_call .request(new_request_builder(HttpMethodEnum::GET, '/v1/partners/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')) .query_param(new_parameter(processor, key: 'processor')) .query_param(new_parameter(search_by, key: 'searchBy')) .header_param(new_parameter('application/json', key: 'accept')) .auth(Single.new('BearerAuth'))) .response(new_response_handler .deserializer(APIHelper.method(:custom_type_deserializer)) .deserialize_into(EcommerceTransactionsResponse.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)) .execute end |