Class: Yukon::ExpressCheckout
- Inherits:
-
Object
- Object
- Yukon::ExpressCheckout
- Defined in:
- lib/yukon/express_checkout.rb
Overview
Value object
Instance Attribute Summary collapse
-
#buyer_ip ⇒ Object
readonly
Returns the value of attribute buyer_ip.
-
#cart ⇒ Object
readonly
Returns the value of attribute cart.
-
#custom ⇒ Object
readonly
Returns the value of attribute custom.
-
#end_point ⇒ Object
readonly
Returns the value of attribute end_point.
Instance Method Summary collapse
-
#initialize(end_point, cart, buyer_ip, custom) ⇒ ExpressCheckout
constructor
A new instance of ExpressCheckout.
- #to_h ⇒ Object
Constructor Details
#initialize(end_point, cart, buyer_ip, custom) ⇒ ExpressCheckout
6 7 8 9 10 11 |
# File 'lib/yukon/express_checkout.rb', line 6 def initialize(end_point, cart, buyer_ip, custom) @end_point = end_point @cart = cart @buyer_ip = buyer_ip @custom = custom end |
Instance Attribute Details
#buyer_ip ⇒ Object (readonly)
Returns the value of attribute buyer_ip.
4 5 6 |
# File 'lib/yukon/express_checkout.rb', line 4 def buyer_ip @buyer_ip end |
#cart ⇒ Object (readonly)
Returns the value of attribute cart.
4 5 6 |
# File 'lib/yukon/express_checkout.rb', line 4 def cart @cart end |
#custom ⇒ Object (readonly)
Returns the value of attribute custom.
4 5 6 |
# File 'lib/yukon/express_checkout.rb', line 4 def custom @custom end |
#end_point ⇒ Object (readonly)
Returns the value of attribute end_point.
4 5 6 |
# File 'lib/yukon/express_checkout.rb', line 4 def end_point @end_point end |
Instance Method Details
#to_h ⇒ Object
13 14 15 16 17 18 19 20 21 22 |
# File 'lib/yukon/express_checkout.rb', line 13 def to_h { ip: @buyer_ip, return_url: @end_point.return_url, cancel_return_url: @end_point.cancel_return_url, notify_url: @end_point.notify_url, allow_guest_checkout: true, custom: @custom }.merge(@cart.contents) end |