php - SkipJack payment integration -
i using skipjack payment gateway in ecommerce application. i've downloaded skipjack classes internet, , call functions in own script there issue during processing.
there method geterrors(). called when payment declined, in function errors written.
but when payment proceeds empty array printed no error message. working fix issue week can't solve it. please me.
thank in advance
this code:
<?php require_once 'skipjack.php'; $sj = new skipjack(); //$sj->setdeveloper(true); // use development server address, remove line use live server 4445999922225 if (isset($_post['submit'])) { $c_name = $_post['c_name']; $c_email = $_post['c_email']; $c_add = $_post['c_add']; $c_city = $_post['c_city']; $c_state = $_post['c_state']; $c_zip = $_post['c_zip']; $c_acc = $_post['c_acc']; $c_cvv = $_post['c_cvv']; $c_phone = $_post['c_phone']; $c_month = $_post['c_month']; $c_year = $_post['c_year']; $sj->addfields(array( 'ordernumber' => '5', 'itemnumber' => 'i5', 'itemdescription' => 'test item', 'itemcost' => '5.50', 'quantity' => '1', 'taxable' => '0', 'streetaddress' => $c_add, 'city' => $c_city, 'state' => $c_state, 'zipcode' => $c_zip, 'accountnumber' => $c_acc, 'cvv2' => $c_cvv, 'sjname' => $c_name, 'email' => $c_email, 'month' => $c_month, 'year' => $c_year, 'transactionamount' => '200.00' )); $sub = "your payment transaction"; $msg = "<table width='50%'> <tr> <td>order number:</td><td>5</td> </tr> <tr> <td>quantity:</td><td>1</td> </tr> <tr> <td>name:</td><td>" . $c_name . "</td> </tr> <tr> <td>city:</td><td>" . $c_city . "</td> </tr> <tr> <td>address:</td><td>" . $c_add . "</td> </tr> <tr> <td>zip code:</td><td>" . $c_zip . "</td> </tr> <tr> <td>account number:</td><td>" . $c_acc . "</td> </tr> <tr> <td>message:</td><td>your transaction has been declined, pos_error_blind_credits_failed</td> </tr> </table>"; if ($sj->process() && $sj->isapproved()) { echo "transaction approved!" . "<br> email has sent email address"; sendemail($msg, $c_email, $sub); } else { echo "transaction declined!\n"; echo ($sj->geterrors()) . "<br> email has sent email address"; //echo $a; } } ?> <h3 align="center" style="width:100%;">skip jack</h3> <form method="post" action=""> <table width="1000" align="center" cellpadding="5" cellspacing="5"> <tr> <td>name:<br /></td> <td><input type="text" name="c_name" id="c_name" /></td> <td>email:<br /></td> <td><input type="text" name="c_email" id="c_email" /></td> <td>street address:<br /></td> <td><input type="text" name="c_add" id="c_add" /></td> </tr> <tr> <td>city:<br /></td> <td><input type="text" name="c_city" id="c_city" /></td> <td>state:<br /></td> <td><input type="text" name="c_state" id="c_state" /></td> <td>zip code:<br /></td> <td><input type="text" name="c_zip" id="c_zip" /></td> </tr> <tr> <td>credit card number:<br /></td> <td><input type="text" name="c_acc" id="c_acc" /></td> <td>security code:<br /></td> <td><input type="text" name="c_cvv" id="c_cvv" /></td> <td>phone:<br /></td> <td><input type="text" name="c_phone" id="c_phone" /></td> </tr> <tr> <td>month:<br /></td> <td> <select name="c_month"> <option value="01">january</option> <option value="02">february</option> <option value="03">march</option> <option value="04">april</option> <option value="05">may</option> <option value="06">june</option> <option value="07">july</option> <option value="08">august</option> <option value="09">september</option> <option value="10">october</option> <option value="11">november</option> <option value="12">december</option> </select> </td> <td>year:<br /></td> <td> <select name="c_year"> <option value="2014">2014</option> <option value="2015">2015</option> <option value="2016">2016</option> <option value="2017">2017</option> <option value="2018">2018</option> <option value="2019">2019</option> <option value="2020">2020</option> </select> </td> <td> </td> </tr> <tr> <td align="center" colspan="5"><input type="submit" name="submit" /></td> </tr> </table> </form> </body> </html> ?>
according comment on apis page, problem php library:
there's bugs api .. 1 @ line 255 it's using $errorcodes when should using $this->errorcodes .. spent while wondering why wasn't seeing errors getting transaction failed message..
the example code doesn't work out of box..
from: https://code.google.com/p/skipjack-php/wiki/classdocumentation
i recommend trying skipjack library on github, since it's more recent , might fix problem. (caveat: haven't used either one.)
(although looks one's busted too. on line 429, should $this->errorcodes[...] , not $errorcodes[...].)
i've made repairs in forked repository now, if you'd try that: https://github.com/firstclown/skipjack-php-library/tree/patch-1
Comments
Post a Comment