Class: Spree::Paysera::BuildUrl

Inherits:
Object
  • Object
show all
Defined in:
app/domain/spree/paysera/build_url.rb

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(payment_method, options) ⇒ BuildUrl

Returns a new instance of BuildUrl.



13
14
15
16
# File 'app/domain/spree/paysera/build_url.rb', line 13

def initialize(payment_method, options)
  @payment_method = payment_method
  @options = options
end

Instance Attribute Details

#optionsObject (readonly)

Returns the value of attribute options.



7
8
9
# File 'app/domain/spree/paysera/build_url.rb', line 7

def options
  @options
end

#payment_methodObject (readonly)

Returns the value of attribute payment_method.



7
8
9
# File 'app/domain/spree/paysera/build_url.rb', line 7

def payment_method
  @payment_method
end

Class Method Details

.for(payment_method, options) ⇒ Object



9
10
11
# File 'app/domain/spree/paysera/build_url.rb', line 9

def self.for(payment_method, options)
  new(payment_method, options).run
end

Instance Method Details

#runObject



18
19
20
21
22
23
# File 'app/domain/spree/paysera/build_url.rb', line 18

def run
  provider_url + make_query(
    data: assertion,
    sign: sign_request(assertion, payment_method.preferred_sign_key)
  )
end