Class: BraintreeLyre::TransparentRedirect::CreateTransaction

Inherits:
Object
  • Object
show all
Defined in:
lib/braintree_lyre/transparent_redirect/create_transaction.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

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

#kindObject (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_idObject (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_urlObject (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_urlObject



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