I am developing Rails 4 application where user can subscribe one time pay with application.
For subscription, use Active Merchant with stripe where now user pay $50 right now and payment done successfully. Below code :
ActiveMerchant::Billing::Base.mode = :test
transaction = ActiveMerchant::Billing::StripeGateway.new(:login => Rails.application.secrets.stripe_secret_key)
paymentInfo = ActiveMerchant::Billing::CreditCard.new(
:number => purchage_params[:card_holder_number],
:month => purchage_params[:expiry_month],
:year => purchage_params[:expiry_year],
:verification_value => purchage_params[:cvv])
purchaseOptions = {:billing_address => {
:name => purchage_params[:card_holder_name],
:currency => @country.currency,
:address1 => session[:address],
:city => session[:city],
:state => @region.name,
:zip => session[:zip_postal]
}}
response = transaction.purchase((amount * 100).to_i, paymentInfo, purchaseOptions)
Now my issue, I want to deduct payment as per user country wise. As per below country and payment.
USA = $50 USD
South Africa = 355 ZAR
India = 520 INR
Australia = $50 AUD
So how can i set currency and payment country wise. Any one have a idea in it?
Thanks