Class: DnaPaymentsPartnerReportingSettlementApIs::MerchantsApi
- Defined in:
- lib/dna_payments_partner_reporting_settlement_ap_is/apis/merchants_api.rb
Overview
MerchantsApi
Constant Summary
Constants inherited from BaseApi
Instance Attribute Summary
Attributes inherited from BaseApi
Instance Method Summary collapse
-
#get_merchants_v1 ⇒ ApiResponse
Returns the merchants available to the authenticated partner.
-
#get_merchants_v2(processor: nil, page: 1, size: 1000) ⇒ ApiResponse
Returns the merchants available to the authenticated partner, including terminal configuration for each merchant.
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_merchants_v1 ⇒ ApiResponse
Returns the merchants available to the authenticated partner.
Deprecated — use V2 (/v2/partners/merchants) instead.
12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 |
# File 'lib/dna_payments_partner_reporting_settlement_ap_is/apis/merchants_api.rb', line 12 def get_merchants_v1 warn 'Endpoint get_merchants_v1 in MerchantsApi is deprecated' @api_call .request(new_request_builder(HttpMethodEnum::GET, '/v1/partners/merchants', Server::DEFAULT) .header_param(new_parameter('application/json', key: 'accept')) .auth(Single.new('BearerAuth'))) .response(new_response_handler .deserializer(APIHelper.method(:custom_type_deserializer)) .deserialize_into(MerchantV1.method(:from_hash)) .is_api_response(true) .is_response_array(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 |
#get_merchants_v2(processor: nil, page: 1, size: 1000) ⇒ ApiResponse
Returns the merchants available to the authenticated partner, including terminal configuration for each merchant. Supports pagination and filtering by processor. processor used for transactions. to retrieve. page will be returned.
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 |
# File 'lib/dna_payments_partner_reporting_settlement_ap_is/apis/merchants_api.rb', line 49 def get_merchants_v2(processor: nil, page: 1, size: 1000) @api_call .request(new_request_builder(HttpMethodEnum::GET, '/v2/partners/merchants', Server::DEFAULT) .query_param(new_parameter(processor, key: 'processor')) .query_param(new_parameter(page, key: 'page')) .query_param(new_parameter(size, key: 'size')) .header_param(new_parameter('application/json', key: 'accept')) .auth(Single.new('BearerAuth'))) .response(new_response_handler .deserializer(APIHelper.method(:custom_type_deserializer)) .deserialize_into(MerchantsV2Response.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 |