Class: Tinypass::PurchaseRequest
- Inherits:
-
Object
- Object
- Tinypass::PurchaseRequest
- Defined in:
- lib/tinypass/ui/purchase_request.rb
Instance Attribute Summary collapse
-
#callback ⇒ Object
Returns the value of attribute callback.
-
#client_ip ⇒ Object
Returns the value of attribute client_ip.
-
#options ⇒ Object
Returns the value of attribute options.
-
#primary_offer ⇒ Object
Returns the value of attribute primary_offer.
-
#secondary_offer ⇒ Object
Returns the value of attribute secondary_offer.
-
#user_ref ⇒ Object
Returns the value of attribute user_ref.
Instance Method Summary collapse
- #generate_link(return_url, cancel_url) ⇒ Object
- #generate_tag ⇒ Object
-
#initialize(offer, options = {}) ⇒ PurchaseRequest
constructor
A new instance of PurchaseRequest.
Constructor Details
#initialize(offer, options = {}) ⇒ PurchaseRequest
Returns a new instance of PurchaseRequest.
5 6 7 |
# File 'lib/tinypass/ui/purchase_request.rb', line 5 def initialize(offer, = {}) @primary_offer, @options = offer, end |
Instance Attribute Details
#callback ⇒ Object
Returns the value of attribute callback.
3 4 5 |
# File 'lib/tinypass/ui/purchase_request.rb', line 3 def callback @callback end |
#client_ip ⇒ Object
Returns the value of attribute client_ip.
3 4 5 |
# File 'lib/tinypass/ui/purchase_request.rb', line 3 def client_ip @client_ip end |
#options ⇒ Object
Returns the value of attribute options.
3 4 5 |
# File 'lib/tinypass/ui/purchase_request.rb', line 3 def @options end |
#primary_offer ⇒ Object
Returns the value of attribute primary_offer.
3 4 5 |
# File 'lib/tinypass/ui/purchase_request.rb', line 3 def primary_offer @primary_offer end |
#secondary_offer ⇒ Object
Returns the value of attribute secondary_offer.
3 4 5 |
# File 'lib/tinypass/ui/purchase_request.rb', line 3 def secondary_offer @secondary_offer end |
#user_ref ⇒ Object
Returns the value of attribute user_ref.
3 4 5 |
# File 'lib/tinypass/ui/purchase_request.rb', line 3 def user_ref @user_ref end |
Instance Method Details
#generate_link(return_url, cancel_url) ⇒ Object
14 15 16 17 18 19 20 21 22 |
# File 'lib/tinypass/ui/purchase_request.rb', line 14 def generate_link(return_url, cancel_url) self.['return_url'] = return_url if return_url self.['cancel_url'] = cancel_url if cancel_url builder = ClientBuilder.new ticket_string = builder.build_purchase_request(self) Config.endpoint + Config::CONTEXT + "/jsapi/auth.js?aid=#{ Tinypass.aid }&r=#{ ticket_string }" end |
#generate_tag ⇒ Object
9 10 11 12 |
# File 'lib/tinypass/ui/purchase_request.rb', line 9 def generate_tag = HtmlWidget.new .(self) end |