Class: Tpaga::RefundApi
Class Method Summary collapse
-
.refund_credit_card_charge(body, opts = {}) ⇒ CreditCardCharge
Try to refund a CreditCardCharge to a Customer's CreditCard Refunds a new ‘CreditCardCharge` that was successful to a `CreditCard`.
Class Method Details
.refund_credit_card_charge(body, opts = {}) ⇒ CreditCardCharge
Try to refund a CreditCardCharge to a Customer's CreditCard Refunds a new ‘CreditCardCharge` that was successful to a `CreditCard`. It only can be done within the same day of the `CreditCardCharge`
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 38 39 40 41 42 43 |
# File 'lib/tpaga/api/refund_api.rb', line 12 def self.refund_credit_card_charge(body, opts = {}) # verify the required parameter 'body' is set fail "Missing the required parameter 'body' when calling refund_credit_card_charge" if body.nil? # resource path path = "/refund/credit_card".sub('{format}','json') # query parameters query_params = {} # header parameters header_params = {} # HTTP header 'Accept' (if needed) _header_accept = [] _header_accept_result = Swagger::Request.select_header_accept(_header_accept) and header_params['Accept'] = _header_accept_result # HTTP header 'Content-Type' _header_content_type = [] header_params['Content-Type'] = Swagger::Request.select_header_content_type(_header_content_type) # form parameters form_params = {} # http body (model) post_body = Swagger::Request.object_to_http_body(body) auth_names = ['api_key'] response = Swagger::Request.new(:POST, path, {:params => query_params, :headers => header_params, :form_params => form_params, :body => post_body, :auth_names => auth_names}).make.body obj = CreditCardCharge.new() and obj.build_from_hash(response) end |