Results 1 to 4 of 4
  1. #1

    PHP question - CURL + CDGCommerce

    Arghhh...enough headaches, finally time to ask a question.

    I've setup a secure server and am attempting to set up my payment processing (my merchant account is through CDGCommerce with CDGGateway) such that the entire process is transparent to my clients -- they never see off-site URLs, etc. According to Chris, I need to set up a PHP script that gathers the necessary data (order/payment form). This script then needs to post the data to the link provided by CDGCommerce. I've tried doing this in a multitude of ways, but I keep getting this error message. Also according to Chris, I am then supposed to set up my ret_addr to be a secure script on my site that will "echo out the name/value pairs being sent back to it." I have yet to get to that point, though, due to this error message:

    For your protection, your session has expired. Please close this window and log in again.
    If you are seeing this message unexpectedly, you may need to delete your browser cookies and try again.
    PHP Code:

    # paymentprocessor.php -- handles posting everything to the payment processor on CDGCommerce's side.

    foreach($_POST as $k => $v)
    $v urlencode($v);
    $postedfields[] = "{$k}={$v}";
    $urlstring join("\n"$postedfields);
    $urlstring ereg_replace("\n""&"$urlstring);

    $ch curl_init("");
    $data curl_exec($ch);
    Evidently there is something I've got to be missing. Anyone know what it might be? I'm at my wit's end over here.

    I should mention that I only added the CURLOPT_FOLLOWLOCATION header so I could see if some sort of error message was being generated; without that flag set, all I get is a "1" echoed to the screen.


  2. #2
    Join Date
    Aug 2003
    Chesapeake, VA
    Hi Rob,

    I will work on some sample PHP code for you to integrate into this using the HTML API. - Trusted Merchant Account Solutions since 1998
    Many thousands of successful, growing businesses benefit from our expertise every day. You can, too!
    We help merchants to eliminate gateway costs, reduce & mitigate fraud and achieve streamlined PCI compliance.
    Learn more today at - we look forward to helping your business grow!

  3. #3
    Thanks Chris. You -- and your Company -- rock.

    Rob (one very happy customer)

  4. #4
    Any updates Chris? I followed the instructions here ( but still had no luck.


Posting Permissions

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