Skip to content

Instantly share code, notes, and snippets.

@WanderGink
Last active May 15, 2017 14:19
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save WanderGink/c30b615b234647b7d5c37f7b34f00278 to your computer and use it in GitHub Desktop.
Save WanderGink/c30b615b234647b7d5c37f7b34f00278 to your computer and use it in GitHub Desktop.

-> Add 'gem activemerchant' in gem file
-> bundle install
-> Go to "developer.paypal.com" and create an account(also known as Merchant Account) with US address details.
-> It will create two dummy test account for buyer and seller(alias facilitator) in "sandbox.paypal.com".
Ex:
    Seller account  --->  naveengoud-facilitator@gmail.com   Buyer account  --->  naveengoud-buyer@gmail.com
To see test accounts details Click on "Dashboard -> Accounts"
Now set the password for both test accounts by clicking on profile link

Go to seller account(i.e, facilitator) profile details and copy the API Credentials i.e, Username, password and signature
Ex:     Username:  naveengoud-facilitator_api1.gamil.com       Password:   VSPALJ5ALA5YY9YJ     Signature:   AVLslxW5UGzEpaDPEK4Oril7Xo4IAYjdWHD25HhS8a8kqPYO4FjFhd6A   Set these API Credentials in "config/environments/development.rb" as follows, add the below code with API credentials

  config.after_initialize do  
ActiveMerchant::Billing::Base.mode = :test       
        ::GATEWAY = ActiveMerchant::Billing::PaypalGateway.new(  
             login: "merchant_api1.gotealeaf.com",  
            password: "2PWPEUKZXAYE7ZHR",  
            signature: "AFcWxV21C7fd0v3bYYYRCpSSRl31A-dRI5VpyF4A9emruhNYzlM8poc0")  
end

From here onward follow the Rails cast 145 episode (http://railscasts.com/episodes/145-integrating-active-merchant)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment