I am working on
Laravel 4.2 project. The project is about to provide the Video services to the dedicated customers.
The client wants to use
PayPal payment gateway and I have never done this before. He has provided me a
Personal and a
Business account with
Classical API credentials and signature.
The project requirement is once user sign-up, he will be charged certain amount (let us say $10 every month). For payment he must NOT be redirected to
PayPal site that means everything should be done using my website only. Also we will NOT store any credit card details of the user and still the Payment should be done OR renewed automatically every month.
If user wants to turn of the the auto renewal of payment, he can.
I am not sure how to do this using
PayPal classical API. Although I have downloaded the
Omnipay/Omnipay package from
git-hub, they asks there is no method to store the user's credit card details in
PayPal Vault using this also to have a
cron job for auto renewal. Since I don't want to store the credit card details, I am not sure how to do all this.
Please help me or guide me to do so. Is there any sample or example?
In order to take credit cards directly like you're asking you'll need to sign up with PayPal Payments Pro, which is $30/mo. Then you'll need to add the recurring billing feature to that, which is another $30/mo.
If that's not a problem, then after getting those things approved and active on your account, you would use the CreateRecurringPaymentsProfile API to create the subscription profiles.
This PayPal PHP SDK is available on Packagist and works with Composer, so it works wonderfully in Laravel.
The CreateRecurringPaymentsProfile sample is functional as-is (although, as I look at it now you'll need to update the expiration date of the credit card) so you would just need to replace all of the static data with your own dynamic data.
The template file is the same thing but it's completely empty and ready for you to populate with your own data.
Using that SDK you can have the profile creation working within minutes, so it's just a matter of having Pro w/ Recurring Payments enabled on your account.