I am new to rails and am starting to learn about how to integrate payment processing. I am trying to find some direction about where to focus my learning about payment processor integration.
From what I understand ActiveMerchant is an extraction from Shopify that allows you to easily integrate many of the major payment gateways such as Stripe and Braintree. I also understand that these platforms also have their own APIs for their specific services.
There seems to be obviouse benefits to using activemerchant if there is a possibility of wanting to switch payment processor in future or if you intend to use different processors accross different sites.
My question is what are the drawbacks of using ActiveMerchant as apposed to a specific API. Do I take more responisibility for security if I use ActiveMerchant and is it much more complicated?
My reason for asking is I do not want to focus my time and effort on learning a specific API when I could learn ActiveMerchant and use it accross all providers.
Thank you :)
I've only used ActiveMerchant once (for an e-commerce system), and used it because of its integration with the respective payment gateways we required
--
Case For Use
The problem you have with "native" APIs is that they have a habit of changing when you least expect it, making all that custom (brutal) work to originally implement them very difficult to debug when it suddenly blows up
I've found ActiveMerchant is a great "buffer" between Rails development & the payment providers. If Shopify are getting paid to handle payments for their users, surely it's a good thing that they'll provide an up-to-date gem with all their experience
Although you'll have to manage much of the integration yourself (still), ActiveMerchent certainly acts as a very reliable abstraction layer for accepting payments
--
Drawbacks
In my experience, the main drawbacks are that ActiveMerchant may not support some of the more "niche" features of particular API's (for example, currency conversion or similar). Although Shopify, by all accounts, are very liberal with the inclusion of functionality upon [pull] request, you still generally have to abide by their specs
Another thing to consider is that you may have to "bend" the API's to fit your application. In our company, we have a lot of different ways to create the wealth we need, and as such, we don't want to rely on "accepting payments" with our providers.
We like to create integrated experiences, which invariably means giving people the chance to purchase things like premium accounts, or in-app upgrades etc. When you get into the world of "micro payments" (which we're strictly not; we just have varying ways to attract buyers), you begin to have to make the APIs work by using very custom implementations
--
Coverage
From a developer perspective, the main benefit that ActiveMerchant provides is that you are "covered" with so many different payment providers.
Hawking back to my comments regarding API changes, this means that if you integrate your app with the ActiveMerchant interface correctly, you should be able to work with a multitude of many different payment providers
The list of supported providers is monumental - meaning that if you want to change your payment provider from Paypal to Stripe or something - you'll be able to do so by not editing your core code a huge amount
--
Resources
Finally, because ActiveMerchant is a base-standard, you'll get much more support than direct implementation with the various APIs. This is reflected in the likes of Railscasts: