Search code examples
phpapisdkpaypalpayflowpro

PayPal Payflow Pro error


I am using PayPal's Payflow pro API on a test account and no matter what, it tells me the field is incorrect. I am using PHP. This is the string being sent to them:

USER=xxx&VENDOR=xxx&PARTNER=PayPal&PWD=xxx&TENDER=C&ACTION=A&TRXTYPE=R&PROFILENAME=JerProfile&PAYPERIOD=MONT&START=12152012&TERM=0&ACCT=4012888888881881&AMT=123.45&&BUTTONSOURCE=PF-CCWizard

And the response says

Array
(
    [RESULT] => 7
    [RPREF] => R1853E1E07BF
    [RESPMSG] => Field format error: Invalid or missing START/NEXTPAYMENTDATE field
)

And as you can see, I have specified a monthly pay period and the start date is in their format of mmddyyyy. Any help would be appreciated as this is driving me insane.


Solution

  • The exact order of the submitted variables is important:

            'TRXTYPE' => 'R',
            'PARTNER' => $API_Partner,
            'VENDOR' => $API_Vendor,
            'USER' => $API_User,
            'PWD' => $API_Password,
            'ACTION' => $action
    

    And then any others required depending on which action. For the Create action, START must be tomorrow's date or a date in the future. Hope this helps somebody else having problems with PayPal's PayFlow API.