Class: WalmartApIs::DisputesApi

Inherits:
BaseApi
  • Object
show all
Defined in:
lib/walmart_ap_is/apis/disputes_api.rb

Overview

DisputesApi

Constant Summary

Constants inherited from BaseApi

BaseApi::GLOBAL_ERRORS

Instance Attribute Summary

Attributes inherited from BaseApi

#config, #http_call_back

Instance Method Summary collapse

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 WalmartApIs::BaseApi

Instance Method Details

#check_dispute_eligibilityApiResponse

Returns whether the authenticated seller is eligible to raise a payment dispute and, if not, the reason for ineligibility. Delegates to GMPPaymentsPlatform (Phase 5).

Returns:

  • (ApiResponse)

    Complete http response with raw body and status code.



13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
# File 'lib/walmart_ap_is/apis/disputes_api.rb', line 13

def check_dispute_eligibility
  @api_call
    .request(new_request_builder(HttpMethodEnum::GET,
                                 '/disbursements/v4/payment/disputeEligibilityCheck',
                                 Server::DEFAULT1)
               .header_param(new_parameter('application/json', key: 'accept'))
               .auth(Single.new('walletAuth')))
    .response(new_response_handler
                .deserializer(APIHelper.method(:custom_type_deserializer))
                .deserialize_into(DisputeEligibilityResponse.method(:from_hash))
                .is_api_response(true)
                .local_error('400',
                             'Bad Request',
                             ErrorListErrorException)
                .local_error('401',
                             'Unauthorized — missing, expired, or invalid OAuth2 token',
                             ErrorListErrorException)
                .local_error('500',
                             'Internal Server Error',
                             ErrorListErrorException))
    .execute
end