Here, we will explained How do recurring profiles works in magento.
WHAT IS RECURRING PROFILE?
There is a time when you want to sell something, and then capture the payment on a regular basis, defined per product. For example, if you sell magazine subscription, and you want to charge it each month, recurring profiles are for you. In short, this is the agreement between seller and buyer, and this agreement authorizes the merchant to charge the buyer account again in the future, according to the recurring profile settings.
ENABLING RECURRING PROFILES AND NOMINAL ITEMS
To enable recurring profiles you have to set it for every product. By default recurring profiles can be set on simple and virtual products, but it can be set on other product types as well. You have to enable product types by editing recurring profile attribute. When it’s set on a product, it will become ‘nominal item’.
There are several unusual things with nominal items. You cannot order more than one nominal item, or have any other product ordered in the same order. Regular totals are also not applied to nominal items. When you purchase it, you will have subtotal and grand total of $0.00, and new group called ‘nominal item’ where the price is displayed. That’s odd a bit, but things works that way.
Currently, the only payment that accept recurring profiles is Paypal.
HOW DO RECURRING PROFILES WORK IN MAGENTO
When customer place an order, information such as prices, start date, interval, billing cycles etc. are sent to Paypal. Paypal will then create recurring profile, and charge customer’s credit card regularly, as specified in the ordered product.
So, what is the catch?
Testing is the most difficult part of the process. I’ve set paypal sandbox account which allow me to place recurring profile orders without problems. I expected to see an order from Magento’s admin panel, but nothing was there. Confirmation email from Magento is not sent.
When I go to Sales -> Recurring Profiles, profile information is displayed, but there are no related orders. It’s supposed to create an order for every interval charge from PayPal. Paypal send Instant Payment Notifications (IPN), and Magento rely on it.
To achieve that, you need to set in your Paypal account where IPNs will be sent. After digging a code for a while, I’ve found the url: http://www.yourdomain.com/paypal/ipn
In Paypal sandbox account I was unable to set IPN Notification url, so I tried to simulate it using Paypal’s IPN Simulator tool. I tried every possible options, but I was unable to send fields as Magento expect them. Trouble-maker is the ‘rp_invoice_id’ field, without it will not work. You can, as always, add it from code for testing, but that is not what we’re expecting from a sandbox and test tools.
I really hope Paypal will update its tool soon, so we can test payment in the sandbox, not in live mode only.