Class: Io::Flow::V0::Clients::PaymentRequestBundles

Inherits:
Object
  • Object
show all
Defined in:
lib/flow_commerce/flow_api_v0_client.rb

Instance Method Summary collapse

Constructor Details

#initialize(client) ⇒ PaymentRequestBundles

Returns a new instance of PaymentRequestBundles.



7996
7997
7998
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 7996

def initialize(client)
  @client = HttpClient::Preconditions.assert_class('client', client, ::Io::Flow::V0::Client)
end

Instance Method Details

#get_by_id(organization, id) ⇒ Object

Returns information about a specific payment request bundle



8009
8010
8011
8012
8013
8014
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 8009

def get_by_id(organization, id)
  HttpClient::Preconditions.assert_class('organization', organization, String)
  HttpClient::Preconditions.assert_class('id', id, String)
  r = @client.request("/#{CGI.escape(organization)}/payment/request/bundles/#{CGI.escape(id)}").get
  ::Io::Flow::V0::Models::PaymentRequestBundle.new(r)
end

#post(organization, payment_request_bundle_form) ⇒ Object

Creates a new payment request bundle



8001
8002
8003
8004
8005
8006
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 8001

def post(organization, payment_request_bundle_form)
  HttpClient::Preconditions.assert_class('organization', organization, String)
  (x = payment_request_bundle_form; x.is_a?(::Io::Flow::V0::Models::PaymentRequestBundleForm) ? x : ::Io::Flow::V0::Models::PaymentRequestBundleForm.new(x))
  r = @client.request("/#{CGI.escape(organization)}/payment/request/bundles").with_json(payment_request_bundle_form.to_json).post
  ::Io::Flow::V0::Models::PaymentRequestBundle.new(r)
end

#put_by_id(organization, id, payment_request_bundle_form) ⇒ Object

Updates payment request bundle



8017
8018
8019
8020
8021
8022
8023
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 8017

def put_by_id(organization, id, payment_request_bundle_form)
  HttpClient::Preconditions.assert_class('organization', organization, String)
  HttpClient::Preconditions.assert_class('id', id, String)
  (x = payment_request_bundle_form; x.is_a?(::Io::Flow::V0::Models::PaymentRequestBundleForm) ? x : ::Io::Flow::V0::Models::PaymentRequestBundleForm.new(x))
  r = @client.request("/#{CGI.escape(organization)}/payment/request/bundles/#{CGI.escape(id)}").with_json(payment_request_bundle_form.to_json).put
  ::Io::Flow::V0::Models::PaymentRequestBundle.new(r)
end