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.

[View source]

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

[View source]

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

def add_on
  AddOnGateway.new(self)
end

#addressObject

[View source]

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

def address
  AddressGateway.new(self)
end

#apple_payObject

[View source]

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

def apple_pay
  ApplePayGateway.new(self)
end

#client_tokenObject

[View source]

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

def client_token
  ClientTokenGateway.new(self)
end

#credit_cardObject

[View source]

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

def credit_card
  CreditCardGateway.new(self)
end

#customerObject

[View source]

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

def customer
  CustomerGateway.new(self)
end

#customer_sessionObject

[View source]

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

def customer_session
  CustomerSessionGateway.new(self, graphql_client)
end

#discountObject

[View source]

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

def discount
  DiscountGateway.new(self)
end

#disputeObject

[View source]

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

def dispute
  DisputeGateway.new(self)
end

#document_uploadObject

[View source]

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

def document_upload
  DocumentUploadGateway.new(self)
end

#exchange_rate_quoteObject

[View source]

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

def exchange_rate_quote
  ExchangeRateQuoteGateway.new(self)
end

#merchantObject

[View source]

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

def merchant
  MerchantGateway.new(self)
end

#merchant_accountObject

[View source]

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

def 
  MerchantAccountGateway.new(self)
end

#oauthObject

[View source]

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

def oauth
  OAuthGateway.new(self)
end

#payment_methodObject

[View source]

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

def payment_method
  PaymentMethodGateway.new(self)
end

#payment_method_nonceObject

[View source]

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

def payment_method_nonce
  PaymentMethodNonceGateway.new(self)
end

#paypal_accountObject

[View source]

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

def 
  PayPalAccountGateway.new(self)
end

#paypal_payment_resourceObject

[View source]

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

def paypal_payment_resource
  PayPalPaymentResourceGateway.new(self)
end

#planObject

[View source]

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

def plan
  PlanGateway.new(self)
end

#sepa_direct_debit_accountObject

[View source]

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

def 
  SepaDirectDebitAccountGateway.new(self)
end

#settlement_batch_summaryObject

[View source]

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

def settlement_batch_summary
  SettlementBatchSummaryGateway.new(self)
end

#subscriptionObject

[View source]

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

def subscription
  SubscriptionGateway.new(self)
end

#testingObject

[View source]

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

def testing
  TestingGateway.new(self)
end

#transactionObject

[View source]

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

def transaction
  TransactionGateway.new(self)
end

#transaction_line_itemObject

[View source]

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

def transaction_line_item
  TransactionLineItemGateway.new(self)
end

#us_bank_accountObject

[View source]

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

def 
  UsBankAccountGateway.new(self)
end

#us_bank_account_verificationObject

[View source]

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

def 
  UsBankAccountVerificationGateway.new(self)
end

#verificationObject

[View source]

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

def verification
  CreditCardVerificationGateway.new(self)
end

#webhook_notificationObject

[View source]

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

def webhook_notification
  WebhookNotificationGateway.new(self)
end

#webhook_testingObject

[View source]

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

def webhook_testing
  WebhookTestingGateway.new(self)
end