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.
2824 2825 2826 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 2824 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
2846 2847 2848 2849 2850 2851 2852 2853 2854 2855 2856 2857 2858 2859 2860 2861 2862 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 2846 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
2865 2866 2867 2868 2869 2870 2871 2872 2873 2874 2875 2876 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 2865 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
2828 2829 2830 2831 2832 2833 2834 2835 2836 2837 2838 2839 2840 2841 2842 2843 2844 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 2828 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 |