5

I'm trying to set up recurring payment with immediate first payment.

For example you buy some monthly subscription on my website for $10. I take first $10 immediately and then I continue charge $10 monthly.

My problem is that I can't set up first immediate payment.

I use REST API:

https://developer.paypal.com/docs/api/#create-a-plan

Here is my JSON

{
    name = Caption,
    description = "Some Description"
    type = "INFINITE",
    payment_definitions = 
    [
        {
            name = "Some Name"
            type ="REGULAR",
            frequency = "DAY",
            frequency_interval = 1,
            amount = new 
            {
                value = 10,
                currency = "USD"
            },
            cycles = "0"
        }
    ],
    merchant_preferences
    {
        setup_fee = new
        {
            value = 10,
            currency = "USD"
        },
        cancel_url = CancelUrl,
        return_url = ReturnUrl,
        max_fail_attempts = "5"
    }
};

What should I add to my json, to make paypal take first payment immediately.

Thanks.

Edited:

I could find out some strange behavior: My timezone is (UTC+04:00) Tbilisi. If I set up a transaction before 14:00 it processes immediately, but if I do it after, I have to wait until next day.

Michael Samteladze
  • 1,310
  • 15
  • 38
  • I need something like this: https://developer.paypal.com/docs/classic/paypal-payments-pro/integration-guide/WPRecurringPayments/#id086520F027U__id08652200WTS – Michael Samteladze Sep 23 '14 at 13:56
  • Dear Michael Samteladze, did find the solution for your problem if yes please share with me, you can answer your question here... because I am stuck in here with the same problem :-) – zarpio Jun 12 '16 at 08:16
  • After that problem I had to cancel subscription option and didn't come back to it. I'll definitely post it if I find a solution – Michael Samteladze Jun 13 '16 at 10:58
  • Although this answer: https://stackoverflow.com/questions/49957228/paypal-monthly-subscription-plan-settings-for-first-day-of-the-month-django-py/50018563#50018563 refers to a Python implementation, the Paypal API usage remains the same. – John Moutafis May 04 '18 at 08:01

2 Answers2

1

If the $10 is a one time payment then you should have it as the setup fee. The setup fee should be immediately processed.

Avi Das
  • 1,725
  • 1
  • 13
  • 19
  • As you can see, "setup_fee" is there, but I receive IPN only in next day. It never sends any notification about payment immediately, also when I go to paypal account, payment is there but it is not charged, it says pending. – Michael Samteladze Sep 23 '14 at 09:26
  • 2
    Is that consistent behavior across all your users? Generally when a payment state is listed as pending, it could either be related to the account or related to the payment in question i.e. it could be the merchants ability to receive or buyer's ability to pay. It should be checked later that payment status has changed to approved and nothing should be shipped until that happens. For more detail about pending payments, look into http://stackoverflow.com/questions/18037648/doexpresscheckoutpayment-or-execute-transactions-are-always-pending-why – Avi Das Sep 23 '14 at 15:35
  • Thank you Avi Das, this article was helpful. I went through all steps of an article. I've changed my settings on step 1 and step 2, I think it worked. Let me do few more tests and I'll let you know about the results. Thanks – Michael Samteladze Sep 24 '14 at 08:26
  • It seemed to work from my local computer but not from server. Maybe because of timezones and agreement start_date? I sent client date plus few minutes. – Michael Samteladze Sep 24 '14 at 14:12
0

Is only in sandbox is didn't work?

I've try a +1day (made the 24, and in the client, the first payment is for the 25) and nothing is transfered...

Jacky Lormoz
  • 165
  • 2
  • 11
  • 1
    Yes it seems that sandbox has this problem. I spoke with paypal, show them an example, it took me almost a week to repeat ascenario plus show them, IPN came 6 hours after I've executes subription plan. But looks like paypal doesn't care about this issue. – Michael Samteladze Oct 27 '14 at 07:08
  • Did PayPal give you any solution... please share with us. – zarpio Jun 12 '16 at 12:17