Class: BraintreeLyre::TransparentRedirect::CreateTransaction
- Inherits:
-
Object
- Object
- BraintreeLyre::TransparentRedirect::CreateTransaction
- Defined in:
- lib/braintree_lyre/transparent_redirect/create_transaction.rb
Instance Attribute Summary collapse
-
#kind ⇒ Object
readonly
Returns the value of attribute kind.
-
#merchant_id ⇒ Object
readonly
Returns the value of attribute merchant_id.
-
#redirect_url ⇒ Object
readonly
Returns the value of attribute redirect_url.
Instance Method Summary collapse
-
#initialize(params) ⇒ CreateTransaction
constructor
A new instance of CreateTransaction.
- #return_url ⇒ Object
Constructor Details
#initialize(params) ⇒ CreateTransaction
Returns a new instance of CreateTransaction.
9 10 11 12 13 14 15 16 |
# File 'lib/braintree_lyre/transparent_redirect/create_transaction.rb', line 9 def initialize(params) _, query = *params['tr_data'].split("|", 2) tr_data = Rack::Utils.parse_query(query) @merchant_id = params['merchant_id'] @redirect_url = tr_data['redirect_url'] @kind = tr_data['kind'] end |
Instance Attribute Details
#kind ⇒ Object (readonly)
Returns the value of attribute kind.
7 8 9 |
# File 'lib/braintree_lyre/transparent_redirect/create_transaction.rb', line 7 def kind @kind end |
#merchant_id ⇒ Object (readonly)
Returns the value of attribute merchant_id.
7 8 9 |
# File 'lib/braintree_lyre/transparent_redirect/create_transaction.rb', line 7 def merchant_id @merchant_id end |
#redirect_url ⇒ Object (readonly)
Returns the value of attribute redirect_url.
7 8 9 |
# File 'lib/braintree_lyre/transparent_redirect/create_transaction.rb', line 7 def redirect_url @redirect_url end |
Instance Method Details
#return_url ⇒ Object
18 19 20 21 22 |
# File 'lib/braintree_lyre/transparent_redirect/create_transaction.rb', line 18 def return_url query = base_query uri = URI.parse(redirect_url).merge("?#{query}&hash=#{hash(query)}") uri.to_s end |