Friday, June 19, 2009

How to integrate chase payment gateway with PHP?

Hi,
I will not explain here each and every step. Just I am telling what I did and which problems I faced while integrating chase payment gateway with PHP.

1) I user XML API method. ( Refer http://download.chasepaymentech.com/ to download links for XML schema ZIP for request and response, and xml specification DOC)
2) Download "Orbital Gateway XML Interface Specification" from ( http://download.chasepaymentech.com/portal/server.pt/gateway/PTARGS_0_226_1595_0_0_18/Orbital_Gateway_XML_Specification.pdf )
3) In your XML request do not forget to write correct version (e.g PTI46 in this case)
4) Developement KIT is not available for PHP. So if in future if you want to integrate chase with PHP contact me. I have done NewOrder, REFUND, VOID request to chase through PHP programming.
I will add sample format of REQUEST next time.
Enough for today.
Going bye...

Sampel XML Request and Response..
OrbitalConnectionUsername and OrbitalConnectionPassword are not really needed as authetication is checked from the SERVER IP from where the requst for payment transaction is made. Your server IP is stored to CHASE.


NEW ORDER REQUEST

<?xml version="1.0" encoding="UTF-8"?>
<Request>
<NewOrder>
<OrbitalConnectionUsername>TESTUSER123</OrbitalConnectionUsername>
<OrbitalConnectionPassword>abcd1234</OrbitalConnectionPassword>
<IndustryType>EC</IndustryType>
<MessageType>AC</MessageType>
<BIN>000001</BIN>
<MerchantID>123456</MerchantID>
<TerminalID>001</TerminalID>
<CardBrand></CardBrand>
<AccountNum>5454545454545454</AccountNum>
<Exp>0112</Exp>
<CurrencyCode>840</CurrencyCode>
<CurrencyExponent>2</CurrencyExponent>
<AVSzip>25541</AVSzip>
<AVSaddress1>123 Test Street</AVSaddress1>
<AVSaddress2>Suite 350</AVSaddress2>
<AVScity>Test City</AVScity>
<AVSstate>FL</AVSstate>
<AVSphoneNum>8004564512</AVSphoneNum>
<OrderID>8316384413</OrderID>
<Amount>2500</Amount>
</NewOrder>
</Request>



NEW ORDER RESPONSE

<?xml version="1.0" encoding="UTF-8"?>
<Response>
<NewOrderResp>
<IndustryType/>
<MessageType>AC</MessageType>
<MerchantID>123456</MerchantID>
<TerminalID>001</TerminalID>
<CardBrand>MC</CardBrand>
<AccountNum>5454545454545454</AccountNum>
<OrderID>8316384413</OrderID>
<TxRefNum>48E0E5BC6EAB75C4863A09DFED9804E7EC2E54A1</TxRefNum>
<TxRefIdx>1</TxRefIdx>
<ProcStatus>0</ProcStatus>
<ApprovalStatus>1</ApprovalStatus>
<RespCode>00</RespCode>
<AVSRespCode>H </AVSRespCode>
<CVV2RespCode> </CVV2RespCode>
<AuthCode>191044</AuthCode>
<RecurringAdviceCd/>
<CAVVRespCode/>
<StatusMsg>Approved</StatusMsg>
<RespMsg/>
<HostRespCode>00</HostRespCode>
<HostAVSRespCode>Y</HostAVSRespCode>
<HostCVV2RespCode/>
<CustomerRefNum/>
<CustomerName/>
<ProfileProcStatus/>
<CustomerProfileMessage/>
<RespTime>102708</RespTime>
</NewOrderResp>
</Response>


$xml is the XML request string.... SEE above

your header of XML request will be like
$header= "POST /AUTHORIZE HTTP/1.0\r\n";
$header.= "MIME-Version: 1.0\r\n";
$header.= "Content-type: application/PTI46\r\n";
$header.= "Content-length: ".strlen($xml)."\r\n";
$header.= "Content-transfer-encoding: text\r\n";
$header.= "Request-number: 1\r\n";
$header.= "Document-type: Request\r\n";
$header.= "Interface-Version: Test 1.4\r\n";
$header.= "Connection: close \r\n\r\n";

/** CURL Implementation **/
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, "https://orbitalvar1.paymentech.net/authorize");
curl_setopt($ch, CURLOPT_HEADER, false);
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, $header);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 1);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
$response = curl_exec($ch);
if (curl_errno($ch))
{
//print curl_error($ch);
}
else
{
curl_close($ch);
}
$xml_parser = xml_parser_create();
xml_parser_set_option($xml_parser,XML_OPTION_CASE_FOLDING,0);
xml_parser_set_option($xml_parser,XML_OPTION_SKIP_WHITE,1);
xml_parse_into_struct($xml_parser, $response, $vals,$index);
xml_parser_free($xml_parser);
/*****************/
$parsedResArr = $this->parseXmlResponse($vals);

// Print response here
print_r( $parsedResArr);


public function parseXmlResponse($xmlResponse)
{
$newResArr = array();
foreach($xmlResponse as $val)
{ $tagval=$val['tag'];
if(($val['tag']!='Response') && ($val['tag']!='NewOrderResp'))
{
if(isset($val['value']))
{
$newResArr[$tagval]=$val['value'];
}
else
{
$newResArr[$tagval]=''; }
}
}
return $newResArr;
}
You can find the attachements at location :

https://sites.google.com/site/seedsoffriendship/home/downloads

46 comments:

  1. Hello Sir,

    It's usefull information, Thanks
    i will try it, thank for in advance help declearation. I will definatly contact you

    ReplyDelete
  2. Thank you for providing this info.

    How does the XML get read into the variable $xml

    How much much would you charge to implement Orbital Gateway in php?

    When could you do it?

    ReplyDelete
  3. Hi jim,

    just Assign the whole xml Request to $xml thats it.

    e.g.
    $xml = "<?xml version="1.0" encoding="UTF-8"?>
    <Response>
    <NewOrderResp>
    <IndustryType/>
    <MessageType>AC</MessageType>
    <MerchantID>123456</MerchantID>.....
    .....
    ...
    </NewOrder>
    </Request>"

    Currently I am not working as a freelancer...
    And Currently too much busy with company project..
    But I can send you the class I wrote to implement Orbital Gateway in php.

    Check the Blog Soon....

    ReplyDelete
    Replies
    1. Hello Roshan

      Please send me that code also ?

      me email : satishpatil1981@gmail.com

      Thanks
      Satish

      Delete
    2. Hi Roshan. Thanks for posting this with PHP Version. Can I have also a copy of it?
      my email is proverbian@gmail.com

      Thanks!

      Delete
    3. Hi Roshan. thanks for creating a PHP Version of this. really appreciate it. Can i have a copy of the php files? email is proverbian@gmail.com..

      Thanks!

      Delete
  4. Roshan,

    Thanks for your help. -Jim

    ReplyDelete
  5. Roshan,

    You mentioned the class for Chase Payment Gateway implementation. Could you send it or post it?

    Thanks. I greatly appreciate it.

    Jim

    ReplyDelete
  6. Roshan,

    You mentioned the php class. Could you send it or post it?

    Thanks. I greatly appreciate it.

    Regards,

    Jim

    ReplyDelete
  7. Jim

    I sent email on your email address, with the Class.
    I was not able to upload zip file in blogger.
    Sorry for that.
    If you have any queries you can post comments.

    Thanks for your interest.

    ReplyDelete
  8. Roshan,

    Very helpful post, thank you for sharing your experience.

    I am facing this same issue this week, is there anyway I could see the class that you wrote?

    Thanks in advance.

    ~Joe

    ReplyDelete
  9. Yes Joe,
    Send Me you email id.

    I will send the class to you.

    ReplyDelete
  10. My address is: joe3@2gtech.com -Thank you!

    ReplyDelete
  11. Oh Please, can you email me the class also.
    Thank You!!!!
    john@digitalhomeservice.com

    ReplyDelete
  12. Roshan can you email it to me too please!
    My email-id is - vphpppl@gmail.com
    Thanks in advance.

    ReplyDelete
  13. Hi,

    Can you send me this class please?

    ReplyDelete
  14. chase has given me there cerificates and told me to load it in my server how do i go about doing it .. my server is a ubuntu server.
    The soap request wont work until this is done..

    can u tell me how to go about this.

    ReplyDelete
  15. Hi roshan please send me your class......your help will be great.
    Thanks
    m.bisht0805@gmail.com

    ReplyDelete
  16. i want to integrate orbital payment gateway using php.could you please help me?

    ReplyDelete
  17. Hi I integrate this into my site but I am getting the error "Precondition Failed: Security Information is missing". Please Help me out.

    ReplyDelete
  18. You can find more payment gateway source code

    www.justiworld.com

    ReplyDelete
  19. HI Roshan,

    Can you send me the complete zip file to my email id prijeya@gmail.com?

    Thanks in advance

    ReplyDelete
  20. Please email me the class to implement Orbital Gateway in php. My Email Id is -
    tnjha_27@yahoo.co.in

    ReplyDelete
  21. Roshan,

    Hope you're still out there. Can you send it to me as well? josh.barlow@plusonecompany.info

    Thanks,
    Josh

    ReplyDelete
  22. Sir,

    I need to implement it in cake php

    Can you help me

    Thanks

    ReplyDelete
  23. Hi Roshan,

    can you send me the php class?

    ReplyDelete
  24. Hey, useful post...love the way you have presented the whole detail's...it's
    always good to read and get to know quality stuff...

    Do visit my page and leave a comment if you like any of it...

    Techiezens Payment Gateway

    ReplyDelete
  25. Hi Roshan

    Can you please send me the php class?
    email Id: saran.banerjee@appsbee.com

    Thanks in advance

    ReplyDelete
  26. Hi Roshan

    Can you please send me the complete code (.zip) to integrate Chase Paymentech in php at nipss18@gmail.com

    Thanks in advance.

    ReplyDelete
  27. Hi Roshan

    Can you please send me the complete code(.zip) to integrate chase paymentech - orbital in to php.

    Thanks in advance.

    Nippy

    ReplyDelete
  28. Hello Sir Please Help me it's so urgent for my job

    can u provide me code to intregrate orbit payement gateway(chasepayment) . i want to intrgrate it in my website in asp.net using c#.
    Please help soon possible..
    my id is satyendrafgiet@gmail.com

    ReplyDelete
  29. Hi Orbital Team,

    I am facing "20412 Precondition Failed: Security Information is missing".

    Please help me.It will be very appreciative if you can.

    Thanks
    Rahul Jain
    Email : rahul_jain@softprodigy.com

    ReplyDelete
  30. Hi Roshan,
    Thanks for putting the above together. Can I get a copy of the class as well? info@phpmydev.com

    Thank you

    ReplyDelete
  31. Hi Roshan,

    I am integrating Chase payment with woocommerce. Can you send it to me as well? sj_zhou@yahoo,com

    Thanks.

    ReplyDelete
  32. i am using this code but it is not working




    it gives 20412Precondition Failed: Security Information is missing

    i did not find any solution .. please help me its very urgent

    ReplyDelete
  33. need a class for viod request in chasepayment tech
    send me if u find khadar3332@aol.com

    ReplyDelete
  34. Hi Roshan,

    Please send me the class in my mail soumik@whiteliongroup.net

    it will be very helpful for me...

    Thanks in advance..

    ReplyDelete
  35. Hello ,

    i want to integrate chase payment gateway
    anyone can send me the class which above mention

    email-anuragcalls@gmail.com


    thanks in advance

    ReplyDelete
  36. if you email the orbital certification group they can provide PHP, XML, SOAP, XML Batch, CSV Batch samples of the posts, mime headers, schemas, and file formats. They have the sample curl requests that can be provided as well. there is an integrator called www.getrouty.com that is already certified to their latest XML api that offers a plug n play option.

    ReplyDelete
  37. Hi
    I want to know how do I cancel payment which has been set as recurring using php script for chase pay payment gateway. Please reply immediately.

    Regards
    Arvind

    ReplyDelete
  38. Hello Team

    Hope you are doing well.

    Can you please send me the code into zip file, It will be really really appreciable.

    My email id is rahul.jain@betasoftsystems.com.

    Thanks in advance.

    Rahul Jain
    +91-8929669036

    ReplyDelete
  39. Hi please send me class my email is golu.panwar9785@gmail.com

    ReplyDelete
  40. Hi Roshan

    Can you please send me the complete code(.zip) to integrate chase paymentech - orbital in to php. On id : jignesh.it@gmail.com.plz its arjant

    Thanks in advance.
    Jignesh Patel

    ReplyDelete
  41. Hi Roshan,

    I am integrating Chase payment with PHP. Can you send it to me on id jignesh.it@gmail.com. its arjant

    Thanks.

    ReplyDelete
  42. Hello,
    I want to Integrating Chase Payment with PHP.
    Should you provide it to my email ajay04bairagi@gmail.com
    It is urgent because I am finding Code for long time

    Thanks..

    ReplyDelete