Class: Yukon::PaypalExpressGateway

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

Instance Method Summary collapse

Constructor Details

#initialize(product, gateway) ⇒ PaypalExpressGateway

Returns a new instance of PaypalExpressGateway.



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

def initialize(product, gateway)
  @product = product
  @gateway = gateway
end

Instance Method Details

#set_express_checkout(express_checkout) ⇒ Object



8
9
10
11
12
# File 'lib/yukon/paypal_express_gateway.rb', line 8

def set_express_checkout(express_checkout)
  cart = express_checkout.cart
  
  @gateway.setup_purchase(cart.total_amount, express_checkout.to_h)
end