Class: BillingIntegration::Skrill::QuickCheckout

Inherits:
BillingIntegration
  • Object
show all
Defined in:
app/models/spree/billing_integration/skrill/quick_checkout.rb

Instance Method Summary collapse

Instance Method Details

#provider_classObject



9
10
11
# File 'app/models/spree/billing_integration/skrill/quick_checkout.rb', line 9

def provider_class
  ActiveMerchant::Billing::Skrill
end

#redirect_url(order, opts = {}) ⇒ Object



13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
# File 'app/models/spree/billing_integration/skrill/quick_checkout.rb', line 13

def redirect_url(order, opts = {})
  opts.merge! self.preferences

  set_global_options(opts)

  opts[:detail1_text] = order.number
  opts[:detail1_description] = "Order:"

  opts[:pay_from_email] = order.email
  opts[:firstname] = order.bill_address.firstname
  opts[:lastname] = order.bill_address.lastname
  opts[:address] = order.bill_address.address1
  opts[:address2] = order.bill_address.address2
  opts[:phone_number] = order.bill_address.phone.gsub(/\D/,'') if order.bill_address.phone
  opts[:city] = order.bill_address.city
  opts[:postal_code] = order.bill_address.zipcode
  opts[:state] = order.bill_address.state.nil? ? order.bill_address.state_name.to_s : order.bill_address.state.abbr
  opts[:country] = order.bill_address.country.name
  opts[:pay_to_email] = self.preferred_pay_to_email
  opts[:hide_login] = 1
  opts[:merchant_fields] = 'platform,order_id,payment_method_id'
  opts[:platform] = 'Spree'
  opts[:order_id] = order.number

  skrill = self.provider
  skrill.payment_url(opts)
end