5
votes

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.

2
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
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 solutionMichael Samteladze
Although this answer: stackoverflow.com/questions/49957228/… refers to a Python implementation, the Paypal API usage remains the same.John Moutafis

2 Answers

1
votes

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

0
votes

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...