allow for preferred currency
This commit is contained in:
parent
5340cdb907
commit
ec356cf5e8
|
@ -217,7 +217,7 @@ CheckoutController.class_eval do
|
|||
|
||||
# hook to override paypal site options
|
||||
def paypal_site_opts
|
||||
{}
|
||||
{:currency => payment_method.preferred_currency}
|
||||
end
|
||||
|
||||
def order_opts(order, payment_method, stage)
|
||||
|
|
|
@ -4,6 +4,7 @@ class BillingIntegration::PaypalExpress < BillingIntegration
|
|||
preference :signature, :string
|
||||
preference :review, :boolean, :default => false
|
||||
preference :no_shipping, :boolean, :default => false
|
||||
preference :currency, :string, :default => 'USD'
|
||||
|
||||
def provider_class
|
||||
ActiveMerchant::Billing::PaypalExpressGateway
|
||||
|
|
|
@ -8,7 +8,7 @@ class PaypalAccount < ActiveRecord::Base
|
|||
def capture(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?
|
||||
record_log payment, ppx_response
|
||||
payment.complete
|
||||
|
|
Loading…
Reference in New Issue