Module: PaymentServiceProviderClient

Included in:
AmazonPayClient
Defined in:
lib/amazon-pay-api-sdk-ruby/payment_service_provider_client.rb

Instance Method Summary collapse

Instance Method Details

#contest_dispute(dispute_id, payload, headers: {}) ⇒ HTTPResponse

API to contest dispute. The contestDispute operation is used by the partner, on behalf of the merchant, to formally contest a dispute managed by Amazon, requiring the submission of necessary evidence files within the specified Dispute Window (11 days for Chargeback, 7 days for A-Z Claims).

Parameters:

  • dispute_id (String)
    • The unique ID of the dispute to retrieve.

  • payload (Object)
    • The payload containing statusDetails.

  • headers (Object) (defaults to: {})
    • Optional headers for the request, such as x-amz-pay-idempotency-key, authorization tokens or custom headers.

Returns:

  • (HTTPResponse)

    The response from the API call, which includes details of the dispute.

See Also:



34
35
36
# File 'lib/amazon-pay-api-sdk-ruby/payment_service_provider_client.rb', line 34

def contest_dispute(dispute_id, payload, headers: {});    
    api_call("#{Constants::DISPUTE_URLS}/#{dispute_id}/contest", Constants::POST, payload: payload, headers: headers)
end

#create_dispute(payload, headers: {}) ⇒ HTTPResponse

API to create dispute. The createDispute operation is used to notify Amazon of a newly created chargeback dispute by a buyer on a transaction processed by the PSP (Payment Service Provider), ensuring the dispute is properly accounted for in the Amazon Pay systems.

Parameters:

  • payload (Object)
    • The payload containing statusDetails.

  • headers (Object) (defaults to: {})
    • Requires : x-amz-pay-idempotency-key, Optional headers for the request, such as authorization tokens or custom headers.

Returns:

  • (HTTPResponse)

    The response from the API call, which includes details of the dispute.

See Also:



9
10
11
# File 'lib/amazon-pay-api-sdk-ruby/payment_service_provider_client.rb', line 9

def create_dispute(payload, headers: {});    
    api_call(Constants::DISPUTE_URLS, Constants::POST, payload: payload, headers: headers)
end

#update_dispute(dispute_id, payload, headers: {}) ⇒ HTTPResponse

API to update dispute. The updateDispute operation is used to notify Amazon of the closure status of a chargeback dispute initiated by a buyer for orders processed by a partner PSP (Payment Service Provider), ensuring proper accounting within the Amazon systems.

Parameters:

  • dispute_id (String)
    • The unique ID of the dispute to retrieve.

  • payload (Object)
    • The payload containing statusDetails.

  • headers (Object) (defaults to: {})
    • Optional headers for the request, such as x-amz-pay-idempotency-key, authorization tokens or custom headers.

Returns:

  • (HTTPResponse)

    The response from the API call, which includes details of the dispute.

See Also:



21
22
23
# File 'lib/amazon-pay-api-sdk-ruby/payment_service_provider_client.rb', line 21

def update_dispute(dispute_id, payload, headers: {});    
    api_call("#{Constants::DISPUTE_URLS}/#{dispute_id}", Constants::PATCH, payload: payload, headers: headers)
end

#upload_file(payload, headers: {}) ⇒ HTTPResponse

API to upload file. The uploadFile operation is utilised by PSPs (Payment Service Provider) to upload file-based evidence when a merchant contests a dispute, providing the necessary reference ID to the evidence file as part of the Update Dispute API process.

Parameters:

  • headers (Object) (defaults to: {})
    • Requires : x-amz-pay-idempotency-key, Optional headers for the request, such as authorization tokens or custom headers.

Returns:

  • (HTTPResponse)

    The response from the API call, which includes details of the file.

See Also:



45
46
47
# File 'lib/amazon-pay-api-sdk-ruby/payment_service_provider_client.rb', line 45

def upload_file(payload, headers: {});    
    api_call(Constants::FILES_URLS, Constants::POST, payload: payload, headers: headers)
end