Class: Yukon::PaymentProcessor

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

Class Method Summary collapse

Class Method Details

.do_express_checkout_payment(price, options) ⇒ Object

Part of Web Request 2 Step 3 : DoExpressCheckoutPayment



32
33
34
# File 'lib/yukon/payment_processor.rb', line 32

def self.do_express_checkout_payment(price, options)
  @gateway.purchase(price, options)
end

.get_express_checkout_details(token, seller_email) ⇒ Object

Part of Web Request 2 Step 2 : GetExpressCheckoutDetails : args - token



25
26
27
28
# File 'lib/yukon/payment_processor.rb', line 25

def self.get_express_checkout_details(token, seller_email)
  @gateway = gateway_instance_for(seller_email)
  @gateway.details_for(token)
end

.redirect_url_for(response) ⇒ Object

Part of Web Request 1

End of Step 1 : Redirect to Paypal URL : args - response



19
20
21
# File 'lib/yukon/payment_processor.rb', line 19

def self.redirect_url_for(response)
  @gateway.redirect_url_for(response.token)    
end

.set_express_checkout(price, ip, return_url, cancel_return_url, seller_email, custom) ⇒ Object

Part of Web Request 1 Step 1 : SetExpressCheckout price (in cents), buyer_ip, return_url, cancel_return_url, seller_email, notify_url (optional), custom



6
7
8
9
10
11
12
13
14
15
# File 'lib/yukon/payment_processor.rb', line 6

def self.set_express_checkout(price, ip, return_url, cancel_return_url, seller_email, custom)
  @gateway = gateway_instance_for(seller_email)
  response = @gateway.setup_purchase(price,
                                     ip:                   ip,
                                     return_url:           return_url,
                                     cancel_return_url:    cancel_return_url,
                                     allow_guest_checkout: true,
                                     custom:               custom)        
  response
end