Class: WalmartApIs::FinalPayoutApi

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

Overview

FinalPayoutApi

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

#get_final_payout_case_statusApiResponse

Returns the current state, case ID, and payable amount for the authenticated seller's final payout case (used when a seller account is being offboarded). Delegates to GMPPaymentsPlatform (Phase 5).

Returns:

  • (ApiResponse)

    Complete http response with raw body and status code.



15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
# File 'lib/walmart_ap_is/apis/final_payout_api.rb', line 15

def get_final_payout_case_status
  @api_call
    .request(new_request_builder(HttpMethodEnum::GET,
                                 '/disbursements/v4/finalPayout/case/status',
                                 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(FinalPayoutCaseStatusResponse.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('404',
                             'Not Found',
                             ErrorListErrorException)
                .local_error('500',
                             'Internal Server Error',
                             ErrorListErrorException))
    .execute
end

#update_final_payout_case_status(body) ⇒ ApiResponse

Transitions the authenticated seller's final payout case to Resolved or Closed, optionally including resolution notes. Requires "disbursements:write" scope. Delegates to GMPPaymentsPlatform (Phase 5). parameter: TODO: type description here

Parameters:

Returns:

  • (ApiResponse)

    Complete http response with raw body and status code.



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
# File 'lib/walmart_ap_is/apis/final_payout_api.rb', line 48

def update_final_payout_case_status(body)
  @api_call
    .request(new_request_builder(HttpMethodEnum::PUT,
                                 '/disbursements/v4/finalPayout/case/updateStatus',
                                 Server::DEFAULT1)
               .header_param(new_parameter('application/json', key: 'Content-Type'))
               .body_param(new_parameter(body)
                            .is_required(true))
               .header_param(new_parameter('application/json', key: 'accept'))
               .body_serializer(proc do |param| param.to_json unless param.nil? end)
               .auth(Single.new('walletAuth')))
    .response(new_response_handler
                .deserializer(APIHelper.method(:custom_type_deserializer))
                .deserialize_into(FinalPayoutCaseStatusResponse.method(:from_hash))
                .is_api_response(true)
                .local_error('400',
                             'Bad Request',
                             ErrorListErrorException)
                .local_error('404',
                             'Not Found',
                             ErrorListErrorException)
                .local_error('500',
                             'Internal Server Error',
                             ErrorListErrorException))
    .execute
end