Shopify/active_merchant — pull request #1050 by amassaad (2014-02-24 20:07:00+00:00)
Title: Fixing Elavon, to match 3 digit country codes

This originated from a support ticket in July 2013, apparently our country codes did not match the Elavon supported 3 letter codes: https://www.myvirtualmerchant.com/VirtualMerchant/download/developerGuide.pdf - search for "fraud prevention"

This is just based on the advice left by @jordanwheeler

you can see in active merchant where the country code gets added in for elavon. here:https://github.com/Shopify/active_merchant/blob/master/lib/active_merchant/billing/gateways/elavon.rb#L231

and here for shipping address: https://github.com/Shopify/active_merchant/blob/master/lib/active_merchant/billing/gateways/elavon.rb#L244

so what you'll want to do is something like what we already have in paypal. like this:https://github.com/Shopify/active_merchant/blob/master/lib/active_merchant/billing/gateways/paypal_express.rb#L13-27
at the top of elavon.rb, you'll add pretty much the exact same thing. on the left hand side you'll have the shopify country code, then on the right hand side you'll have the elavon country code. like 'US' => 'USA', for example. you'd do that for all the countries that have a different country code in elavon than in shopify.

then, you'll add your own method at the bottom of elavon.rb. exactly like this: https://github.com/Shopify/active_merchant/blob/master/lib/active_merchant/billing/gateways/paypal_express.rb#L234-236

except in our case, just the country+
so, in elavon.rb, you'll replace the lines like = billing_address[:country].to_s.slice(0, 50) with a call to your method. say, '"

@odorcicd @bslobodin not sure if anything else is required. Advice?