Credit Card Payment Definition

  • Posts: 108
  • Thank you received: 1
9 years 6 months ago #200398

File Attachment:

File Name: PHP_Code_2.txt
File Size:1 KB

-- HikaShop version -- : Business
-- Joomla version -- : 3.4

Hi,

I would like to process credit cart payments on my site.
I have already contracted a payment gateway server (tranzila) to process the payments.
They have not developed a specific plugin for Hikashop and I suppose I need to do it myself.

I have defined in Hikashop the standard credit card plugin.
The Tranzila ask me to change the "Action" tag so the details will go into their servers.
How can it be done?

for example: The Action should send the form here: secure5.tranzila.com/cgi-bin/tranzila31.cgi
method=POST >

and if to be more precise:

<?php $host = 'secure5.tranzila.com'; // gateway host $path = '/cgi-bin/tranzila31.cgi'; // gateway uri $formdata='terminalname'; // supplier $formdata='45.70'; // total amount to process $formdata='4444333322221111'; // credit card $formdata='08'; // expiration month $formdata='09'; // expiration year $formdata=' יוסי סלטים '; $formdata='ישראל '; $formdata='ישראלי '; $poststring = ''; // formatting the request string foreach($formdata AS $key => $val) { $poststring .= $key . "=" . $val . "&"; } // strip off trailing ampersand $poststring = substr($poststring, 0, -1); // init curl connection $CR = curl_init(); curl_setopt($CR, CURLOPT_URL, "https://".$host.$path); curl_setopt($CR, CURLOPT_POST, 1); curl_setopt($CR, CURLOPT_FAILONERROR, true); curl_setopt($CR, CURLOPT_POSTFIELDS, $poststring); curl_setopt($CR, CURLOPT_RETURNTRANSFER, 1); curl_setopt($CR, CURLOPT_SSL_VERIFYPEER, 0); // actual curl execution perfom $result = curl_exec( $CR ); $error = curl_error( $CR ); // on error - exit with error message if( !empty( $error )) { die($error); } curl_close( $CR ); // re-format the string into array $response =explode('&', $result); foreach($response as $key=>$value) { unset($tmparr); $tmparr=explode("=",$value); $answer[$tmparr[0]]=$tmparr[1]; } print "<pre>"; print_r($answer); // response array with string keys

Thank you

Attachments:
Last edit: 9 years 6 months ago by shoppist. Reason: added file

Please Log in or Create an account to join the conversation.

  • Posts: 26158
  • Thank you received: 4028
  • MODERATOR
9 years 6 months ago #200400

Hi,

I recommend you our developer documentation.
www.hikashop.com/support/support/documen...on.html#howtopayment

You can download the sample plugin directly from the documentation but you can also see it though github.
github.com/HikaShop/sample-payment-plugin

Regards,


Jerome - Obsidev.com
HikaMarket & HikaSerial developer / HikaShop core dev team.

Also helping the HikaShop support team when having some time or couldn't sleep.
By the way, do not send me private message, use the "contact us" form instead.

Please Log in or Create an account to join the conversation.

Time to create page: 0.054 seconds
Powered by Kunena Forum