Merge pull request #7 from vintem/master
Allowing user to choose preferred currency
This commit is contained in:
commit
8cc1d63464
|
@ -218,7 +218,7 @@ CheckoutController.class_eval do
|
||||||
|
|
||||||
# hook to override paypal site options
|
# hook to override paypal site options
|
||||||
def paypal_site_opts
|
def paypal_site_opts
|
||||||
{}
|
{:currency => payment_method.preferred_currency}
|
||||||
end
|
end
|
||||||
|
|
||||||
def order_opts(order, payment_method, stage)
|
def order_opts(order, payment_method, stage)
|
||||||
|
|
|
@ -4,6 +4,7 @@ class BillingIntegration::PaypalExpress < BillingIntegration
|
||||||
preference :signature, :string
|
preference :signature, :string
|
||||||
preference :review, :boolean, :default => false
|
preference :review, :boolean, :default => false
|
||||||
preference :no_shipping, :boolean, :default => false
|
preference :no_shipping, :boolean, :default => false
|
||||||
|
preference :currency, :string, :default => 'USD'
|
||||||
|
|
||||||
def provider_class
|
def provider_class
|
||||||
ActiveMerchant::Billing::PaypalExpressGateway
|
ActiveMerchant::Billing::PaypalExpressGateway
|
||||||
|
|
|
@ -8,7 +8,7 @@ class PaypalAccount < ActiveRecord::Base
|
||||||
def capture(payment)
|
def capture(payment)
|
||||||
authorization = find_authorization(payment)
|
authorization = find_authorization(payment)
|
||||||
|
|
||||||
ppx_response = payment.payment_method.provider.capture((100 * payment.amount).to_i, authorization.params["transaction_id"])
|
ppx_response = payment.payment_method.provider.capture((100 * payment.amount).to_i, authorization.params["transaction_id"], :currency => payment.payment_method.preferred_currency)
|
||||||
if ppx_response.success?
|
if ppx_response.success?
|
||||||
record_log payment, ppx_response
|
record_log payment, ppx_response
|
||||||
payment.complete
|
payment.complete
|
||||||
|
|
Loading…
Reference in New Issue