Paypal recurring payment status - ruby-on-rails

I’m trying to set up a recurring billing situation with Paypal using Rails with ActiveMerchant and the ruby-paypal gem. Wondering how the status of subscriptions is commonly managed - IPN? Or a cron job to check the status of all subscriptions?

In the SaaS Rails Kit I set up a recurring billing profile in PayPal then use a cron job to check on the status of that profile when it is time for it to be billed.
Another approach is to use reference transactions (aka billing agreements) and then using a cron job to bill that paypal user when and what you want. This was my initial implementation in the SaaS Kit, but a lot of people didn't like the hassle of getting reference transactions turned on for their PayPal accounts.

Related

Recurring billing in activemerchant using Moneris Canada

I am working on an e-commerce site which allows user to purchase a product in 3 monthly instalments. Previously I was using Stripe payment gateway for instalments. I was using Stripe webhooks to update my system after instalments gets paid.
Now I have to achieve the same thing using Moneris(Canada) payment gateway. There are official libraries for Java, PHP & .NET but I am using Ruby. I looked into ActiveMerchant. It allows single charge but I couldn't find anything about recurring payment support.
As far as I know there is no any webhook support but I am looking for API's which I can schedule to run to fetch data from Moneris & update my system accordingly.
I would prefer using ActiveMerchant & a bit of custom code to update my system. I am looking for a good starting point which can lead to a better solution given this scenario.
AFAIK Moneris at this time doesn't support access to reporting via API so there's no programmatic way of checking that a recurring payment was successful or not, neither through webooks or through reportings.
This answer suggests another solution...
Looking for some one who has implemented Moneris recurring payments for a website subcription
...which is basically just storing the credit cards on Moneris in exchange for a token, presumably, (what the poster refers to as "the vault") and then setting up your own scheduler to request payments as needed and getting real-time feedback on success or failure of payments.

Paypal parallel payment using saved card

I am saving the customer credit/debit card on paypal. is there is any method to send Parallel Payment using these saved cards.
So your looking to use pay-pal vault with adaptive payments APIs? I was stuck with the same sort of issue.
My research concluded that this cannot be done, with the current adaptive payments APIs.
So there are two solutions
1) Wait till the rest api team adds spilt payments to the rest APIs. You can follow development of this feature # https://github.com/paypal/PayPal-iOS-SDK/issues/9
2) Pay into one account (A nominee account look it up) and use mass payments to pay out to other accounts

Integrating Paypal Rest SDK into Rails app --

I'm a fairly new developer and this is my first time integrating a rest API with an app. The goal is to implement a subscription process where a user can select from a choice of 4 subscriptions and then submit a payment through Paypal or stripe, but I'm struggling to understand how PayPal's rest API works. I've read their documentation and looked at some examples which gave me an idea of where to start. However, I had a few questions that I couldn't seem to find the answer to online:
Are subscription plans that are created through the rest API permanently associated with the account they have been created on?
If they are permanent, how can I avoid hardcoding the Plan ID? This seems like bad practice even though it is done in some of the examples.
When should I be generating new tokens? Every time they expire? Every time a user wants to subscribe to a plan?
How do I automatically execute agreements after they have been created? (I assume executing the agreement is what makes it active and begins the collection of payment).
Thanks, it would be nice to get some clarification on some of this stuff.

Is it possible to use koudoku for one-time payments?

This post references: https://github.com/andrewculver/koudoku
I'd like to use Koudoku for one time payments as opposed to recurring billing. I do not see any way to do this.
Koudoku is specifically designed for recurring subscriptions.
If you're just looking to do one-off payments, I recommend just following the standard Stripe tutorial for a payments page.
To support returning customers or additional purchases, I recommend simply using Devise for authentication and then saving whatever the resulting Stripe customer ID is from the first purchase in the user model, so you can run additional charges against the same card in the future.

Active merchant and Paypal API for recurring payment

I have few questions on paypal's recurring payments, I went trough the paypal documentation to find some answers but, it didn't help me much.
Here are the stuffs that I need to know, hope someone can help me on these.
I'm using paypal's standard payment account. So far I managed to create recurring payments with paypal by posting NVP's to paypal from merchant website to paypal.
Now I need to show recurring payment profiles on merchant web site. So that customers can cancel, modify recurring payments from merchant website without redirecting to paypal.Is this possible?
Think I should use paypal's SOAP API for this as I can't get the job done with NVP API. So I installed active merchant as described in this post. But I always get an error
This transaction is invalid. Please
return to the recipient's website to
complete your transaction using their
regular checkout flow.
from paypal and it never send me the token back.
Also I got this on my log
Security header is not
valid
Is it because I use sandbox API credentials or is it because I can't use paypal's standard account with SOAP API?
Usually the "security header is not valid" response comes from using sandbox credentials in the live environment or vice-versa. AM will use the sandbox when your Rails app is in development mode, so be sure you are using the right set of credentials.
When I was integrating PayPal's recurring payment profiles into the SaaS Rails Kit (using ActiveMerchant) I ended up just canceling a user's current profile and creating a new one when they wanted to change their subscription.

Resources