Class: Smartpay::Responses::CheckoutSession

Inherits:
Base
  • Object
show all
Defined in:
lib/smartpay/responses/checkout_session.rb

Instance Attribute Summary

Attributes inherited from Base

#response

Instance Method Summary collapse

Methods inherited from Base

#as_hash, #as_json, #http_code, #initialize

Constructor Details

This class inherits a constructor from Smartpay::Responses::Base

Instance Method Details

#redirect_url(options = {}) ⇒ Object



6
7
8
9
10
11
12
13
14
15
16
# File 'lib/smartpay/responses/checkout_session.rb', line 6

def redirect_url(options = {})
  url = response[:url]

  if options && options[:promotionCode]
    qs = "?promotion-code=#{options[:promotionCode]}"

    return "#{url}#{qs}"
  end

  url
end