Module: Mobilepay::Client::RefundAmount

Included in:
Mobilepay::Client
Defined in:
lib/mobilepay/client/refund_amount.rb

Instance Method Summary collapse

Instance Method Details

#refund_amount(args = {}) ⇒ Object

Merchants_RefundAmount Refunds an amount to the customer based on an order id



7
8
9
10
11
12
13
# File 'lib/mobilepay/client/refund_amount.rb', line 7

def refund_amount(args = {})
    check_args(order_id: args[:order_id])
    response = call(:put, "/merchants/#{merchant_id}/orders/#{args[:order_id]}", { body: args[:body] || '{}' })
    JSON.parse(response.body)
rescue Failure => ex
    return { error: ex.message }
end