Class: Yukon::ExpressCheckout

Inherits:
Object
  • Object
show all
Defined in:
lib/yukon/express_checkout.rb

Overview

Value object

Instance Attribute Summary collapse

Instance Method Summary collapse

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_ipObject (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

#cartObject (readonly)

Returns the value of attribute cart.



4
5
6
# File 'lib/yukon/express_checkout.rb', line 4

def cart
  @cart
end

#customObject (readonly)

Returns the value of attribute custom.



4
5
6
# File 'lib/yukon/express_checkout.rb', line 4

def custom
  @custom
end

#end_pointObject (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_hObject



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