First payment after subscription a plan delayed one day - paypal

I am implementing a payment subsystem with the REST API and recurring payments.
I have created several plans and when I make a subscription to one of these plans, the first payment it's done the day after I subscribe the plan. I expected to receive the first payment at the same moment I subscribe the plan. Why it's waiting for next day to do it?
At the moment I am using the sandbox.
Can somebody help me to achieve the behaviour I expected for the first payment when subscribe?

I mailed PayPal MTS and they answered me that for the moment it's not possible to do a inicial instant charge when you create a subscription using the REST API.
You can do it with the Classic API setting up the optional INITAMT from the Activation Details Fields.
You can get more details here: https://developer.paypal.com/docs/classic/api/merchant/CreateRecurringPaymentsProfile_API_Operation_NVP/

Related

Is the INVOICING.INVOICE.SCHEDULED automatically created?

I've implemented PayPal gateway in my application, and I'm looking for a way to send a notification to my customer when an upcoming renewal is coming.
Unfortunately in the documentation I didn't find a depth explaination about INVOICING.INVOICE.SCHEDULED but I'm guessing should be the same as invoice.upcoming of Stripe which is triggered when a recurring payment is going to be renewed.
My question is: INVOICING.INVOICE.SCHEDULED is sended by PayPal automatically when a recurring payment is going to be renewed?
Invoicing and Subscriptions are two separate PayPal products. I would not expect an Invoicing webhook in relation to a Subscription recurring payment.
The subscription webhooks are listed here: https://developer.paypal.com/docs/integration/direct/webhooks/event-names/#subscriptions
If you are looking for one that happens "in advance" of a scheduled payment, I am not aware of one.

Recurring payment on PayPal Express Checkout

Im trying set up recurring payment on my site by using Paypal Express Checkout. I did read through the official docs and I couldnt find anything useful related to recurring payment.
https://developer.paypal.com/docs/integration/direct/express-checkout/integration-jsv4/add-paypal-button/
Im just wondering does Express Checkout support recurring payment? If so, how can I achieve that or Where can I get some good example to start with?
Thank you for your help in advance. Much appreciated
Cheers
We have a similar issue before. You might wanted to take a look at this thread.
I'm trying to understand the use case here. When you say recurring payment for express checkout,it has to be something a customer is buying regularly like restocking an item, in that case it's not an express checkout, it's a recurring purchase by a returning customer. They must have opted to restock at a regular interval like every 30 days, 2 months etc. They also must be registered users on your website.
So your logic must include — Checking all the customers who have set up an automatic purchase for an item.
—Check their frequency of purchase and charge them for the amount of the item at that frequency.
—For this purpose PayPal has a REST API :
This is the accurate place to look for to implement PayPal recurring payments:
https://developer.paypal.com/docs/api/payments/#payment_create
In case they also allow you to authorize payments through the following API
https://developer.paypal.com/docs/api/payments/#authorization
you could use it as well.
But at least this narrows down your choices in terms of regular payment authorization.
This API will allow you to request PayPal services to authorize payment on a regular basis for that customer. You will still have to have your own logic to check the 'subscription' for your products and the intervals.
—The CreateRecurringPaymentsProfile API Operation (NVP) at the link below looks to be for personal payments. For example something an Inventory Management System will do.
https://developer.paypal.com/docs/classic/api/merchant/CreateRecurringPaymentsProfile_API_Operation_NVP/
It's an API specific to adding recurring payments functionality.
Since you're a developer, PayPal Developers' Resources will answer any queries you have regarding the API functionality and usage. You will have to just know what to ask for. You are their B2B customer trying to understand their API system. You can also file a bug on their Developer portal if you're not getting proper answers.

PayPal Express Checkout with a mix of one time purchase and recurring payments through the REST API

I am using the PayPal REST API and would like to create a transaction that includes a combination of recurring and one-time payments in a single transaction.
According to the documentation for the NVP integration, it seems such a transaction is possible. However, I'm not sure how to accomplish the same using the REST API. I have searched the REST API documentation as well as the .NET SDK examples and cannot find an example of a transaction that uses a mix of recurring and one-time payments.
Our use case: We process transactions for downloadable software - most of the products are one-time purchases, but some of the products (such as anti-virus products) have a recurring billing component associated with them. As such, we need to process a single transaction where one of the items is a regular purchase, and the other is a part of a recurring plan. We plan to process these transactions using the "PayPal" payment method (i.e. not direct credit card). Specifically, we'll be using Express Checkout.
Any guidance would be much appreciated. Thank you!
Based on what you're doing about, here's what I think your best course of action might be:
When you have a user checking out that may have some multi-month subscriptions, and some single time subscriptions, you set up a new billing plan with each item to be purchased. For the subscriptions, you set up an entry that is set to multiple months, and for a single payment you set a single month payment (see https://developer.paypal.com/docs/integration/direct/create-billing-plan/ for an example of multiple entries).
Next, you need to execute that plan for the user via a billing agreement (https://developer.paypal.com/docs/integration/direct/create-billing-agreement/). Within the billing agreement you can set the start date to execute immediately, which should complete the checkout process for both billing orders right then.
Let me know if that works out for your scenario.

configure reoccurring payment and one time payment for paypal using php

I am working on a website which provides the subscription plans like for 1 year, 2 year and 3 year. User can make payment using the one time payment and using the monthly payment. for achieving this functionality I integrated reoccurring payment and one time payment using paypal gateway and I have successfully integrated. But I have some problem below is my scenario.
Suppose customer checkout using one time payment for one year subscription plan and make payment on paypal then paypal will hit at my IPN handler script and I will update the subscription plan for that customer for one year.
Now if customer checkout using the reoccurring payment for one year subscription plan then it will hit at my IPN handler script and i will update the subscription plan.
But here i want to know how i will differentiate with one time payment and reoccurring payment because whenever paypal hit the IPN for monthly payment then it will update my database for that customer and it will update the subscription date with one year. In this way it will update database every month and customer subscription date will update every month with one year.
I hope you can understand what i am trying to say,
Thanks.
The txn_type in your IPN will be different depending on the type of payment, so that's one way to distinguish between the two. Configure your IPN to handle each txn_type different depending on what you need to do for one-time vs subscription payments.
Also, keep in mind that you can add an initial payment in to a recurring payments profile and it will be treated as a one-time payment. Sort of like a setup fee when signing up for cable service or something like that.
Are you using the Recurring Payments API or Standard Subscription buttons or what?

Paypal Recurring Payment API CALL when taking money

I am writing a subscription where I need to provide users a month trial and charge $5.00 after trial is finished. I just found an amazing code to do that for me.
I also have setup paypalpro plus recurring payments
This is the link
https://github.com/krio/paypal-recurring-subscriptions
Questions:
1- How to make first month Free Trial?
2- I need to update users billing and update their payment in my database so it can calculate their subscription, how would i get to call from paypal to my files to update?
If you are using subscriptions and you are wanting to make the first month a free trial, you would need to pass over the following variables and values.
a1=0
p1=1
t1=M
You can find a description of all of the variables for subscriptions here.
If you are wanting to get updates back to your system/database to update your profiles and etc, you can use IPN to do this. Instant Payment Notification (IPN) is a message service that notifies you of events related to PayPal transactions. You can use it to automate back-office and administrative functions, such as fulfilling orders, tracking customers, and providing status and other information related to a transaction.