SitePoint Sponsor

User Tag List

Results 1 to 3 of 3
  1. #1
    SitePoint Addict macker123's Avatar
    Join Date
    Mar 2000
    Location
    Victoria, BC
    Posts
    230
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Help with cold fusion and paypal subscriptions.

    I am always getting the following error even though I'm using the IPN ColdFusion code supplied by paypal!
    I'm using the IPN with ColdFusion to validate subscription payments. Any help is appreciated and can supply you with more code if desired.

    ======================================
    Error Occurred While Processing Request
    Error Diagnostic Information

    An error occurred while evaluating the expression:

    "#Form.FieldNames#"

    Error near line 4, column 33.
    --------------------------------------------------------------------------------
    Error resolving parameter FORM.FIELDNAMES

    The specified form field cannot be found. This problem is very likely due to the fact that you have misspelled the form field name.
    The error occurred while processing an element with a general identifier of (CFLOOP), occupying document position (4:1) to (4:50).

    This is the IPN Code causing the error, again this is paypal's code :
    ===============================================
    Code:
    <!-- read post from PayPal system and add 'cmd' -->
    <CFSET str="cmd=_notify-validate">
    <CFLOOP INDEX="TheField" list="#Form.FieldNames#">
    <CFSET str = str & "&#LCase(TheField)#=#URLEncodedFormat(Evaluate(TheField))#">
    </CFLOOP>
    <CFIF IsDefined("FORM.payment_date")>
    <CFSET str = str & "&payment_date=#URLEncodedFormat(Form.payment_date)#">
    </CFIF>
    <CFIF IsDefined("FORM.subscr_date")>
    <CFSET str = str & "&subscr_date=#URLEncodedFormat(Form.subscr_date)#">
    </CFIF>
    
    <!-- post back to PayPal system to validate -->
    <CFHTTP URL="https://www.paypal.com/cgi-bin/webscr?#str#" METHOD="GET" RESOLVEURL="false">
    </CFHTTP>
    
    <!-- assign posted variables to local variables -->
    <!-- note: additional IPN variables also available -- see IPN documentation -->
    <CFSET item_name=FORM.item_name>
    <CFSET receiver_email=FORM.receiver_email>
    <CFSET payment_status=FORM.payment_status>
    <CFSET payment_gross=FORM.payment_gross>
    <CFSET txn_id=FORM.txn_id>
    <CFSET payer_email=FORM.payer_email>
    <CFIF IsDefined("FORM.item_number")>
    <CFSET item_number=FORM.item_number>
    </CFIF>
    
    <!-- check notification validation -->
    <CFIF #CFHTTP.FileContent# is "VERIFIED">
    VERIFIED
    <!-- check that payment_status=Completed -->
    <!-- check that txn_id has not been previously processed -->
    <!-- check that receiver_email is your email address -->
    <!-- process payment -->
    <CFELSEIF #CFHTTP.FileContent# is "INVALID">
    INVALID
    <!-- log for investigation -->
    <CFELSE>
    <!-- error -->
    </CFIF


    Thanks for any help you can give.

  2. #2
    Yugo full of anvils bronze trophy hillsy's Avatar
    Join Date
    May 2001
    Location
    :noitacoL
    Posts
    1,859
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Do you have an input on your input form (i.e. the form that calls this page) called FIELDNAMES? It might not be a field - could be a hidden input for example.

    If not, that will cause this error. Can you post the form code?

    Tip: Read the error message. ColdFusion's error messages are unusually helpful
    that's me!
    Now A Pom. And a Plone Nut
    Broccoli Martinez Airpark

  3. #3
    SitePoint Zealot easyrew's Avatar
    Join Date
    Nov 2001
    Location
    Milton Keynes, UK
    Posts
    186
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    The FORM.FIELDNAMES field is automatically sent when you submit the form, and is a comma-separated list of the other fields which have been submitted.

    The fact that the script falls over at this stage indicates that the form information hasn't been posted to the script. If you *have* submitted the form information, check the code which generates your form and check that the submit method is set to POST and not GET.

    Hope that helps...
    If a man stands alone in the forest
    and there's no woman around to hear him,
    is he still wrong?
    w: www.EasyRew.com


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •