No announcement yet.

My Sample PHP

  • Filter
  • Time
  • Show
Clear All
new posts

  • My Sample PHP

    I've spent days beating my head against a wall trying to get the Click&Pledge API to work. After many hours of suffering, I want to share with you all what I've found. I haven't tested this in a production environment yet, but I am getting responses from the Click&Pledge API -- a sure sign of soon-to-be-had victory.

  • #2
    Sample PHP

    Great to hear success stories.

    Have you seen our PHP samples? they were posted yesterday.

    Here is the link:

    Let us know when it is up and running & we can gladly test it for you.
    Click & Pledge Support Department

    Join us @ the educational webinars:
    Live Support- read more:


    • #3
      UserID & Password

      I just glanced at your code & will review it further shortly. I like to suggest that you remove UserID & Password.

      See Version 1.6 release notes:

      In the latest release we removed UserID & Password from the API since it was not adding any value. 2 parameters define an account uniquely and leave no chance for error. GUID is a globally unique number and confirmation with AccountID makes it error proof.

      The UserID & Password were removed because it helped with the FaaS service. The API is backward compatible so if you include it the API will use it and if you don't use it the API will work also.

      We also love to hear about the issues you have had. What were the problems you faced for "days". We have had clients that have gone live in a day and some that have had issues. Knowing your issues will help us address it in the manual or examples and that will help others.

      Unfortunately it is hard for those of us involved with the API not to know what we know. Hearing about your issues will help us make the API more friendly.
      Click & Pledge Support Department

      Join us @ the educational webinars:
      Live Support- read more:


      • #4
        Issues I've Had

        Here is a review of the issues I've had:

        I first tried to use the FaaS to post to your system, thinking I could use it as a shortcut that would prevent me from having to figure out the API. I just wanted to be able to post the data and get a response, like PayPal and other services allow me to do. I hoped to be able to do this with CURL, so as to conduct the entire transaction behind the scenes without redirecting my users. I never could get your page to respond to my CURL posts.

        When I turned to the PaaS method, I had no idea what the proper XML file should look like, how to create it, or how to submit it to your system. When you posted your examples yesterday morning, I had something to work with. I learned that I could use PHP to construct the XML file and that I needed SOAP to make the request/response. My system admin couldn't get SOAP working properly, so I found NuSOAP and studied it for hours to figure out how to make it work. NuSOAP gave me what I needed without having to recompile PHP and restart my server.

        One question I still have is what fields are required in the XML file. For example, my sample PHP contains fields on "item number" and "shipping cost" etc -- things I don't need or care about when taking donations. I would omit them, but I'm not sure if they are required by your system and need to have a value of zero. A simple list of all possible fields and if they are required would be helpful. I should note, the "schema" zip file mentioned in your online manual is a broken link.

        My hope is to get this working today and be set for production -- but I'm curious how I am going to see if the transaction worked or not in the Click&Pledge website. Obviously, I want to test with fake information and see that it appears in the account before I start using real money. Any ideas on how I can do this? Also, if an account I am using is set to "Production" -- can I set an XML file to "Test" just to test things again? If I submit a transaction in test mode, does it show up in the account?


        • #5
          Required fields

          So many languages.. so little time.

          For a donation you can get an idea from what we posted in our FaaS service for just donation.

          I understand your question about Item #, etc. but please note that the API is a general environment where people can do whatever they want. A simple donation may not need item # but what if someone wants to post donations for many activities in text boxes?

          The system was designed to be very general and flexible. I created an xml based on minimum fields that are needed for a simple donation.

          I also included an image of the receipt for the XML posted with minimum fields.

          As for the report and where to download the report- please see the attached. In the report section choose Test transactions and you can download the tests with 4111 credit card.

          I also like to re-iterate that the API gives you a lot of features all integrated into a simple XML. For example you can use a checkout page ID and activate the following in the page:
          • Salesforce: donor info will post to the Salesforce
          • Constant Contact eNewsletter subscription
          • MailChimp eNewsletter subscription
          • Twitter: asking for your patron's userid & password you can post a message they type directly to their twitter.

          Electronic tickets, name badges, and soon to be announced MaxMind fraud scores are all part of the API. There is more but we can discuss those if needed.

          I am sure you will find the API really powerful once you have your first transaction.

          We are here to answer any questions you may have.
          Attached Files
          Click & Pledge Support Department

          Join us @ the educational webinars:
          Live Support- read more: