Class: Braintree::CreateLocalPaymentContextInput
- Inherits:
-
Object
- Object
- Braintree::CreateLocalPaymentContextInput
- Includes:
- BaseModule
- Defined in:
- lib/braintree/graphql/inputs/create_local_payment_context_input.rb
Instance Attribute Summary collapse
-
#amount ⇒ Object
readonly
Returns the value of attribute amount.
-
#attrs ⇒ Object
readonly
Returns the value of attribute attrs.
-
#cancel_url ⇒ Object
readonly
Returns the value of attribute cancel_url.
-
#country_code ⇒ Object
readonly
Returns the value of attribute country_code.
-
#expiry_date ⇒ Object
readonly
Returns the value of attribute expiry_date.
-
#merchant_account_id ⇒ Object
readonly
Returns the value of attribute merchant_account_id.
-
#order_id ⇒ Object
readonly
Returns the value of attribute order_id.
-
#payer_info ⇒ Object
readonly
Returns the value of attribute payer_info.
-
#return_url ⇒ Object
readonly
Returns the value of attribute return_url.
-
#type ⇒ Object
readonly
Returns the value of attribute type.
Instance Method Summary collapse
-
#initialize(attributes) ⇒ CreateLocalPaymentContextInput
constructor
A new instance of CreateLocalPaymentContextInput.
- #inspect ⇒ Object
- #to_graphql_variables ⇒ Object
Methods included from BaseModule
Methods included from BaseModule::Methods
#copy_instance_variables_from_object, #return_object_or_raise, #set_instance_variables_from_hash, #singleton_class
Constructor Details
#initialize(attributes) ⇒ CreateLocalPaymentContextInput
Returns a new instance of CreateLocalPaymentContextInput.
16 17 18 19 20 21 |
# File 'lib/braintree/graphql/inputs/create_local_payment_context_input.rb', line 16 def initialize(attributes) @attrs = attributes.keys set_instance_variables_from_hash(attributes) @amount = attributes[:amount] ? MonetaryAmountInput.new(attributes[:amount]) : nil @payer_info = attributes[:payer_info] ? PayerInfoInput.new(attributes[:payer_info]) : nil end |
Instance Attribute Details
#amount ⇒ Object (readonly)
Returns the value of attribute amount.
5 6 7 |
# File 'lib/braintree/graphql/inputs/create_local_payment_context_input.rb', line 5 def amount @amount end |
#attrs ⇒ Object (readonly)
Returns the value of attribute attrs.
6 7 8 |
# File 'lib/braintree/graphql/inputs/create_local_payment_context_input.rb', line 6 def attrs @attrs end |
#cancel_url ⇒ Object (readonly)
Returns the value of attribute cancel_url.
7 8 9 |
# File 'lib/braintree/graphql/inputs/create_local_payment_context_input.rb', line 7 def cancel_url @cancel_url end |
#country_code ⇒ Object (readonly)
Returns the value of attribute country_code.
8 9 10 |
# File 'lib/braintree/graphql/inputs/create_local_payment_context_input.rb', line 8 def country_code @country_code end |
#expiry_date ⇒ Object (readonly)
Returns the value of attribute expiry_date.
9 10 11 |
# File 'lib/braintree/graphql/inputs/create_local_payment_context_input.rb', line 9 def expiry_date @expiry_date end |
#merchant_account_id ⇒ Object (readonly)
Returns the value of attribute merchant_account_id.
10 11 12 |
# File 'lib/braintree/graphql/inputs/create_local_payment_context_input.rb', line 10 def merchant_account_id @merchant_account_id end |
#order_id ⇒ Object (readonly)
Returns the value of attribute order_id.
11 12 13 |
# File 'lib/braintree/graphql/inputs/create_local_payment_context_input.rb', line 11 def order_id @order_id end |
#payer_info ⇒ Object (readonly)
Returns the value of attribute payer_info.
12 13 14 |
# File 'lib/braintree/graphql/inputs/create_local_payment_context_input.rb', line 12 def payer_info @payer_info end |
#return_url ⇒ Object (readonly)
Returns the value of attribute return_url.
13 14 15 |
# File 'lib/braintree/graphql/inputs/create_local_payment_context_input.rb', line 13 def return_url @return_url end |
#type ⇒ Object (readonly)
Returns the value of attribute type.
14 15 16 |
# File 'lib/braintree/graphql/inputs/create_local_payment_context_input.rb', line 14 def type @type end |
Instance Method Details
#inspect ⇒ Object
23 24 25 26 |
# File 'lib/braintree/graphql/inputs/create_local_payment_context_input.rb', line 23 def inspect inspected_attributes = @attrs.map { |attr| "#{attr}:#{send(attr).inspect}" } "#<#{self.class} #{inspected_attributes.join(" ")}>" end |
#to_graphql_variables ⇒ Object
28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 |
# File 'lib/braintree/graphql/inputs/create_local_payment_context_input.rb', line 28 def to_graphql_variables { "paymentContext" => { "amount" => amount&.to_graphql_variables, "cancelUrl" => cancel_url, "countryCode" => country_code, "expiryDate" => expiry_date, "merchantAccountId" => merchant_account_id, "orderId" => order_id, "payerInfo" => payer_info&.to_graphql_variables, "returnUrl" => return_url, "type" => type }.compact } end |