简体   繁体   中英

Implementing PayPal subscription with no trial period

I am using this code for subscription for PayPal payment

<form action="https://www.sandbox.paypal.com/cgi-bin/webscr" method="post">
        <input type="hidden" name="cmd" value="_xclick-subscriptions" />
        <input type="hidden" name="business" value="a@a.com" />
        <input type="hidden" name="item_name" value="this is buy" />
        <input type="submit" value="Subscribe!" />
        <input type="hidden" name="currency_code" value="GBP"/>
        <input type='hidden' name='custom' value='777sdfsdf' />
        <input type='hidden' name='invoice' value='103' />

        <input type="hidden" name="a1" value="0" />
        <input type="hidden" name="p1" value="1" />
        <input type="hidden" name="t1" value="D" />
        <input type="hidden" name="a3" value="10.00" />
        <input type="hidden" name="p3" value="1" />
        <input type="hidden" name="t3" value="D" />
        <input type="hidden" name="src" value="1" />
        <input type="hidden" name="srt" value="52" />
        <input type="hidden" name="sra" value="1" />           

    </form>

This work fine with one day of trial period but my requirement is that i don't want to give free trial to user , so when i use this

<form action="https://www.sandbox.paypal.com/cgi-bin/webscr" method="post">
        <input type="hidden" name="cmd" value="_xclick-subscriptions" />
        <input type="hidden" name="business" value="a@a.com" />
        <input type="hidden" name="item_name" value="this is buy" />
        <input type="submit" value="Subscribe!" />
        <input type="hidden" name="currency_code" value="GBP"/>
        <input type='hidden' name='custom' value='777sdfsdf' />
        <input type='hidden' name='invoice' value='103' />

        <input type="hidden" name="a1" value="0" />
        <input type="hidden" name="p1" value="0" />
        <input type="hidden" name="t1" value="D" />
        <input type="hidden" name="a3" value="10.00" />
        <input type="hidden" name="p3" value="1" />
        <input type="hidden" name="t3" value="D" />
        <input type="hidden" name="src" value="1" />
        <input type="hidden" name="srt" value="52" />
        <input type="hidden" name="sra" value="1" />           
    </form>

i get following error when user click and go to PayPal

Invalid first trial period. You must specify valid values for the A1, P1 and T1 parameters for a subscription.

MY Finding i search and find that there should be at least one trial period , but i didn't able to find how to implement no trial period using above method i don't want to change to use any other way of payment in PayPal

FYI : i am using sandbox for testing , so i hope same situation is in live PayPal environment

Trial period is not required. However, all periods must be valid (ie cannot have zero length).

Drop the zero-length period and just list the periods you want. So what you were calling period 1 becomes period 0 (which would be the only period, in your example).

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM