Move code from Active Merchant