thisendup Posted April 14, 2007 Share Posted April 14, 2007 I've been PHPing for a few years, but brand new to the curl universe and need help. I am trying to figure out how to post credit card form data to the credit card company my client has signed up with, and need some basic help as this is a brand new thing to me. I am attempting to use this code below. It is supposed to post the credit card info to the credit card company using the variables names they gave me, but I get nothing, not even an error message - so it is probably my ignorance making elementary ommissions, if you could help me I'd surely appreciate it. I have been all over the web looking at tutorials and such and am not sure what all I am looking at yet.. $curlpost = curl_init(); curl_setopt($curlpost, CURLOPT_URL, "http://www.creditcardcompanywebsite.com" ); $curlpost=("ssl_yourmerchant_id=" .urlencode('mymerchantid123') ."&ssl_yourpin=".urlencode ('pin1234') ."&ssl_youruser_id=".urlencode('userid567') ."&ssl_show_form=" .urlencode('false') ."&ssl_card_number=".urlencode ($thiscardnumber) ."&ssl_exp_date=".urlencode($expdate) ."&ssl_amount=" .urlencode($saleamount) ."&ssl_thetransaction_type=".urlencode ('SALE') ."&ssl_invoice_num=".urlencode ('10131abc') ."&ssl_buyer_first_name=".urlencode($buyerfname) ."&ssl_buyerlast_name=". urlencode($buyerlname) ."&ssl_email=".urlencode ($buyeremail) ."&ssl_receipt_decl_method=".urlencode ('REDG') ."&ssl_receipt_decl_get_url=".urlencode ('http://www.mysite.org/problems.php') ."&ssl_receipt_apprvl_method=".urlencode ('REDG') ."&ssl_receipt_apprvl_get_url=".urlencode ('http://www.mysite.org/thank_you.php') ."&ssl_test_mode=" .urlencode ('false' ). "&SUBMIT=Send"); $postresult=curl_exec($curlpost); echo $postresult; Thanks in advance Quote Link to comment https://forums.phpfreaks.com/topic/46952-solved-curl-im-new-to-it-and-stuck/ Share on other sites More sharing options...
Glyde Posted April 14, 2007 Share Posted April 14, 2007 <?php $refCurl = curl_init(); curl_setopt($refCurl, CURLOPT_URL, "http://www.creditcardcompanywebsite.com"); curl_setopt($refCurl, CURLOPT_POST, true); curl_setopt($refCurl, CURLOPT_POSTFIELDS, "ssl_yourmerchant_id=" .urlencode('mymerchantid123') ."&ssl_yourpin=".urlencode ('pin1234') ."&ssl_youruser_id=".urlencode('userid567') ."&ssl_show_form=" .urlencode('false') ."&ssl_card_number=".urlencode ($thiscardnumber) ."&ssl_exp_date=".urlencode($expdate) ."&ssl_amount=" .urlencode($saleamount) ."&ssl_thetransaction_type=".urlencode ('SALE') ."&ssl_invoice_num=".urlencode ('10131abc') ."&ssl_buyer_first_name=".urlencode($buyerfname) ."&ssl_buyerlast_name=". urlencode($buyerlname) ."&ssl_email=".urlencode ($buyeremail) ."&ssl_receipt_decl_method=".urlencode ('REDG') ."&ssl_receipt_decl_get_url=".urlencode ('http://www.mysite.org/problems.php') ."&ssl_receipt_apprvl_method=".urlencode ('REDG') ."&ssl_receipt_apprvl_get_url=".urlencode ('http://www.mysite.org/thank_you.php') ."&ssl_test_mode=" .urlencode ('false' ). "&SUBMIT=Send"); curl_setopt($refCurl, CURLOPT_RETURNTRANSFER, true); $curlResponse = curl_exec($refCurl); ?> Should work. Let me know if there are any problems. Quote Link to comment https://forums.phpfreaks.com/topic/46952-solved-curl-im-new-to-it-and-stuck/#findComment-228951 Share on other sites More sharing options...
thisendup Posted April 16, 2007 Author Share Posted April 16, 2007 perfect THANKS A BUNCH! Quote Link to comment https://forums.phpfreaks.com/topic/46952-solved-curl-im-new-to-it-and-stuck/#findComment-230740 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.