Class: MasspayRubySdk::Client
- Inherits:
-
Object
- Object
- MasspayRubySdk::Client
- Defined in:
- lib/masspay_ruby_sdk/client.rb
Instance Method Summary collapse
- #account_service ⇒ Object
- #attribute_service ⇒ Object
- #card_service ⇒ Object
- #catalog_service ⇒ Object
-
#initialize(options = {}, faraday_options = {}) ⇒ Client
constructor
A new instance of Client.
- #kyc_service ⇒ Object
- #load_service ⇒ Object
- #payout_service ⇒ Object
- #spend_back_service ⇒ Object
- #subaccount_service ⇒ Object
- #tax_service ⇒ Object
- #user_service ⇒ Object
- #wallet_service ⇒ Object
Constructor Details
#initialize(options = {}, faraday_options = {}) ⇒ Client
Returns a new instance of Client.
21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 |
# File 'lib/masspay_ruby_sdk/client.rb', line 21 def initialize( = {}, = {}) [:url] ||= [:url] || "https://api.masspay.io/v1.0.0" @client = Faraday.new() do |builder| builder.request :json builder.response :json, parser_options: { object_class: OpenStruct } builder.adapter Faraday.default_adapter builder.headers[USER_AGENT_HEADER_NAME] = USER_AGENT if [:basic_auth] || [:bearer_auth] if(![:bearer_auth].nil?) builder.request :authorization, 'Bearer', [:bearer_auth] elsif ![:basic_auth] builder.request :authorization, :basic, [:basic_auth].split(":").first, [:basic_auth].split(":").last end end end end |
Instance Method Details
#account_service ⇒ Object
43 44 45 |
# File 'lib/masspay_ruby_sdk/client.rb', line 43 def account_service MasspayRubySdk::AccountService.new(@client) end |
#attribute_service ⇒ Object
47 48 49 |
# File 'lib/masspay_ruby_sdk/client.rb', line 47 def attribute_service MasspayRubySdk::AttributeService.new(@client) end |
#card_service ⇒ Object
51 52 53 |
# File 'lib/masspay_ruby_sdk/client.rb', line 51 def card_service MasspayRubySdk::CardService.new(@client) end |
#catalog_service ⇒ Object
55 56 57 |
# File 'lib/masspay_ruby_sdk/client.rb', line 55 def catalog_service MasspayRubySdk::CatalogService.new(@client) end |
#kyc_service ⇒ Object
59 60 61 |
# File 'lib/masspay_ruby_sdk/client.rb', line 59 def kyc_service MasspayRubySdk::KycService.new(@client) end |
#load_service ⇒ Object
63 64 65 |
# File 'lib/masspay_ruby_sdk/client.rb', line 63 def load_service MasspayRubySdk::LoadService.new(@client) end |
#payout_service ⇒ Object
67 68 69 |
# File 'lib/masspay_ruby_sdk/client.rb', line 67 def payout_service MasspayRubySdk::PayoutService.new(@client) end |
#spend_back_service ⇒ Object
71 72 73 |
# File 'lib/masspay_ruby_sdk/client.rb', line 71 def spend_back_service MasspayRubySdk::SpendBackService.new(@client) end |
#subaccount_service ⇒ Object
75 76 77 |
# File 'lib/masspay_ruby_sdk/client.rb', line 75 def subaccount_service MasspayRubySdk::SubaccountService.new(@client) end |
#tax_service ⇒ Object
79 80 81 |
# File 'lib/masspay_ruby_sdk/client.rb', line 79 def tax_service MasspayRubySdk::TaxService.new(@client) end |
#user_service ⇒ Object
83 84 85 |
# File 'lib/masspay_ruby_sdk/client.rb', line 83 def user_service MasspayRubySdk::UserService.new(@client) end |
#wallet_service ⇒ Object
87 88 89 |
# File 'lib/masspay_ruby_sdk/client.rb', line 87 def wallet_service MasspayRubySdk::WalletService.new(@client) end |