Class: Braintree::Gateway

Inherits:
Object
  • Object
show all
Defined in:
lib/braintree/gateway.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(config) ⇒ Gateway

Returns a new instance of Gateway.



5
6
7
8
9
10
11
12
13
14
15
# File 'lib/braintree/gateway.rb', line 5

def initialize(config)
  if config.is_a?(Hash)
    @config = Configuration.new config
  elsif config.is_a?(Braintree::Configuration)
    @config = config
  else
    raise ArgumentError, "config is an invalid type"
  end

  @graphql_client = GraphQLClient.new(@config)
end

Instance Attribute Details

#configObject (readonly)

Returns the value of attribute config.



3
4
5
# File 'lib/braintree/gateway.rb', line 3

def config
  @config
end

#graphql_clientObject (readonly)

Returns the value of attribute graphql_client.



3
4
5
# File 'lib/braintree/gateway.rb', line 3

def graphql_client
  @graphql_client
end

Instance Method Details

#add_onObject



17
18
19
# File 'lib/braintree/gateway.rb', line 17

def add_on
  AddOnGateway.new(self)
end

#addressObject



21
22
23
# File 'lib/braintree/gateway.rb', line 21

def address
  AddressGateway.new(self)
end

#apple_payObject



25
26
27
# File 'lib/braintree/gateway.rb', line 25

def apple_pay
  ApplePayGateway.new(self)
end

#bank_account_instant_verificationObject



29
30
31
# File 'lib/braintree/gateway.rb', line 29

def 
  BankAccountInstantVerificationGateway.new(self)
end

#client_tokenObject



33
34
35
# File 'lib/braintree/gateway.rb', line 33

def client_token
  ClientTokenGateway.new(self)
end

#credit_cardObject



37
38
39
# File 'lib/braintree/gateway.rb', line 37

def credit_card
  CreditCardGateway.new(self)
end

#customerObject



41
42
43
# File 'lib/braintree/gateway.rb', line 41

def customer
  CustomerGateway.new(self)
end

#customer_sessionObject



45
46
47
# File 'lib/braintree/gateway.rb', line 45

def customer_session
  CustomerSessionGateway.new(self, graphql_client)
end

#discountObject



49
50
51
# File 'lib/braintree/gateway.rb', line 49

def discount
  DiscountGateway.new(self)
end

#disputeObject



53
54
55
# File 'lib/braintree/gateway.rb', line 53

def dispute
  DisputeGateway.new(self)
end

#document_uploadObject



57
58
59
# File 'lib/braintree/gateway.rb', line 57

def document_upload
  DocumentUploadGateway.new(self)
end

#exchange_rate_quoteObject



61
62
63
# File 'lib/braintree/gateway.rb', line 61

def exchange_rate_quote
  ExchangeRateQuoteGateway.new(self)
end

#merchantObject



97
98
99
# File 'lib/braintree/gateway.rb', line 97

def merchant
  MerchantGateway.new(self)
end

#merchant_accountObject



101
102
103
# File 'lib/braintree/gateway.rb', line 101

def 
  MerchantAccountGateway.new(self)
end

#oauthObject



65
66
67
# File 'lib/braintree/gateway.rb', line 65

def oauth
  OAuthGateway.new(self)
end

#payment_methodObject



73
74
75
# File 'lib/braintree/gateway.rb', line 73

def payment_method
  PaymentMethodGateway.new(self)
end

#payment_method_nonceObject



77
78
79
# File 'lib/braintree/gateway.rb', line 77

def payment_method_nonce
  PaymentMethodNonceGateway.new(self)
end

#paypal_accountObject



81
82
83
# File 'lib/braintree/gateway.rb', line 81

def 
  PayPalAccountGateway.new(self)
end

#paypal_payment_resourceObject



85
86
87
# File 'lib/braintree/gateway.rb', line 85

def paypal_payment_resource
  PayPalPaymentResourceGateway.new(self)
end

#planObject



69
70
71
# File 'lib/braintree/gateway.rb', line 69

def plan
  PlanGateway.new(self)
end

#sepa_direct_debit_accountObject



93
94
95
# File 'lib/braintree/gateway.rb', line 93

def 
  SepaDirectDebitAccountGateway.new(self)
end

#settlement_batch_summaryObject



105
106
107
# File 'lib/braintree/gateway.rb', line 105

def settlement_batch_summary
  SettlementBatchSummaryGateway.new(self)
end

#subscriptionObject



109
110
111
# File 'lib/braintree/gateway.rb', line 109

def subscription
  SubscriptionGateway.new(self)
end

#testingObject



121
122
123
# File 'lib/braintree/gateway.rb', line 121

def testing
  TestingGateway.new(self)
end

#transactionObject



113
114
115
# File 'lib/braintree/gateway.rb', line 113

def transaction
  TransactionGateway.new(self)
end

#transaction_line_itemObject



117
118
119
# File 'lib/braintree/gateway.rb', line 117

def transaction_line_item
  TransactionLineItemGateway.new(self)
end

#us_bank_accountObject



89
90
91
# File 'lib/braintree/gateway.rb', line 89

def 
  UsBankAccountGateway.new(self)
end

#us_bank_account_verificationObject



125
126
127
# File 'lib/braintree/gateway.rb', line 125

def 
  UsBankAccountVerificationGateway.new(self)
end

#verificationObject



129
130
131
# File 'lib/braintree/gateway.rb', line 129

def verification
  CreditCardVerificationGateway.new(self)
end

#webhook_notificationObject



133
134
135
# File 'lib/braintree/gateway.rb', line 133

def webhook_notification
  WebhookNotificationGateway.new(self)
end

#webhook_testingObject



137
138
139
# File 'lib/braintree/gateway.rb', line 137

def webhook_testing
  WebhookTestingGateway.new(self)
end