Class: Io::Flow::V0::Clients::PaymentMethodRules
- Inherits:
-
Object
- Object
- Io::Flow::V0::Clients::PaymentMethodRules
- Defined in:
- lib/flow_commerce/flow_api_v0_client.rb
Instance Method Summary collapse
- #get_payment_and_method_and_rules(organization, incoming = {}) ⇒ Object
-
#get_payment_and_method_and_rules_and_batch(organization, incoming = {}) ⇒ Object
Provides payment method rules for all experiences for an organization.
- #get_payment_method_rules(organization, incoming = {}) ⇒ Object
-
#initialize(client) ⇒ PaymentMethodRules
constructor
A new instance of PaymentMethodRules.
Constructor Details
#initialize(client) ⇒ PaymentMethodRules
Returns a new instance of PaymentMethodRules.
2612 2613 2614 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 2612 def initialize(client) @client = HttpClient::Preconditions.assert_class('client', client, ::Io::Flow::V0::Client) end |
Instance Method Details
#get_payment_and_method_and_rules(organization, incoming = {}) ⇒ Object
2634 2635 2636 2637 2638 2639 2640 2641 2642 2643 2644 2645 2646 2647 2648 2649 2650 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 2634 def get_payment_and_method_and_rules(organization, incoming={}) HttpClient::Preconditions.assert_class('organization', organization, String) opts = HttpClient::Helper.symbolize_keys(incoming) query = { :country => (x = opts.delete(:country); x.nil? ? nil : HttpClient::Preconditions.assert_class('country', x, Array).map { |v| HttpClient::Preconditions.assert_class('country', v, String) }), :amount => (x = opts.delete(:amount); x.nil? ? nil : HttpClient::Preconditions.assert_class('amount', x, String)), :currency => (x = opts.delete(:currency); x.nil? ? nil : HttpClient::Preconditions.assert_class('currency', x, String)), :experience => (x = opts.delete(:experience); x.nil? ? nil : HttpClient::Preconditions.assert_class('experience', x, String)), :ip => (x = opts.delete(:ip); x.nil? ? nil : HttpClient::Preconditions.assert_class('ip', x, String)), :context => (x = opts.delete(:context); x.nil? ? nil : HttpClient::Preconditions.assert_class('context', x, String)), :limit => HttpClient::Preconditions.assert_class('limit', (x = opts.delete(:limit); x.nil? ? 25 : x), Integer), :offset => HttpClient::Preconditions.assert_class('offset', (x = opts.delete(:offset); x.nil? ? 0 : x), Integer), :sort => HttpClient::Preconditions.assert_class('sort', (x = opts.delete(:sort); x.nil? ? "display_position" : x), String) }.delete_if { |k, v| v.nil? } r = @client.request("/#{CGI.escape(organization)}/payment/method/rules").with_query(query).get r.map { |x| ::Io::Flow::V0::Models::PaymentMethodRule.new(x) } end |
#get_payment_and_method_and_rules_and_batch(organization, incoming = {}) ⇒ Object
Provides payment method rules for all experiences for an organization
2653 2654 2655 2656 2657 2658 2659 2660 2661 2662 2663 2664 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 2653 def get_payment_and_method_and_rules_and_batch(organization, incoming={}) HttpClient::Preconditions.assert_class('organization', organization, String) opts = HttpClient::Helper.symbolize_keys(incoming) query = { :experiences => (x = opts.delete(:experiences); x.nil? ? nil : HttpClient::Preconditions.assert_class('experiences', x, Array).map { |v| HttpClient::Preconditions.assert_class('experiences', v, String) }), :limit => HttpClient::Preconditions.assert_class('limit', (x = opts.delete(:limit); x.nil? ? 25 : x), Integer), :offset => HttpClient::Preconditions.assert_class('offset', (x = opts.delete(:offset); x.nil? ? 0 : x), Integer), :context => (x = opts.delete(:context); x.nil? ? nil : HttpClient::Preconditions.assert_class('context', x, String)) }.delete_if { |k, v| v.nil? } r = @client.request("/#{CGI.escape(organization)}/payment/method/rules/batch").with_query(query).get r.map { |x| ::Io::Flow::V0::Models::ExperiencePaymentMethodRule.new(x) } end |
#get_payment_method_rules(organization, incoming = {}) ⇒ Object
2616 2617 2618 2619 2620 2621 2622 2623 2624 2625 2626 2627 2628 2629 2630 2631 2632 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 2616 def get_payment_method_rules(organization, incoming={}) HttpClient::Preconditions.assert_class('organization', organization, String) opts = HttpClient::Helper.symbolize_keys(incoming) query = { :country => (x = opts.delete(:country); x.nil? ? nil : HttpClient::Preconditions.assert_class('country', x, Array).map { |v| HttpClient::Preconditions.assert_class('country', v, String) }), :amount => (x = opts.delete(:amount); x.nil? ? nil : HttpClient::Preconditions.assert_class('amount', x, String)), :currency => (x = opts.delete(:currency); x.nil? ? nil : HttpClient::Preconditions.assert_class('currency', x, String)), :experience => (x = opts.delete(:experience); x.nil? ? nil : HttpClient::Preconditions.assert_class('experience', x, String)), :ip => (x = opts.delete(:ip); x.nil? ? nil : HttpClient::Preconditions.assert_class('ip', x, String)), :context => (x = opts.delete(:context); x.nil? ? nil : HttpClient::Preconditions.assert_class('context', x, String)), :limit => HttpClient::Preconditions.assert_class('limit', (x = opts.delete(:limit); x.nil? ? 25 : x), Integer), :offset => HttpClient::Preconditions.assert_class('offset', (x = opts.delete(:offset); x.nil? ? 0 : x), Integer), :sort => HttpClient::Preconditions.assert_class('sort', (x = opts.delete(:sort); x.nil? ? "display_position" : x), String) }.delete_if { |k, v| v.nil? } r = @client.request("/#{CGI.escape(organization)}/payment-method-rules").with_query(query).get r.map { |x| ::Io::Flow::V0::Models::PaymentMethodRule.new(x) } end |