[eluser]cpp643[/eluser]
please help me how to make payment gateway with CI?
[eluser]phpwebdev[/eluser]
Hi mAxHunK,
You want to make payment gateway system like PAYPAL,
Or You need to make payment gateway integration ?????
[eluser]cpp643[/eluser]
yes i wann to make payment gateway integration
[eluser]phpwebdev[/eluser]
and what will be payment gateway ?
[eluser]cpp643[/eluser]
it is paypal.. i am new in making payment gateway integration. sorry for my bad English..
[eluser]cpp643[/eluser]
:gulp:
Thnxs a lot...
[eluser]phpwebdev[/eluser]
call me again if u have problem with integration
[eluser]barryskidmore[/eluser]
It wont let me post my authorize.net library for you. - Too long.
So here it is in parts.
Code: <?php if (!defined('BASEPATH')) exit('No direct script access allowed');
class Authorize_net {
function Authorize_net() {
$this->chalkboard =& get_instance();
log_message('debug', "Authorize.net Class Initialized");
$this->x_url = 'https://test.authorize.net/gateway/transact.dll';
# $this->x_url = 'https://secure.authorize.net/gateway/transact.dll';
$this->x_login = '';
$this->x_tran_key = '';
$this->x_test_request = '1';
$this->x_version = '3.1';
$this->x_type = 'AUTH_CAPTURE';
$this->x_method = 'CC';
$this->x_delim_char = '|';
$this->x_delim_data = 'TRUE';
$this->x_recurring_billing = '0';
$this->x_amount = '0.00';
$this->x_card_num = '4111111111111111';
$this->x_exp_date = '01-2008';
$this->x_card_code = '411';
$this->x_duplicate_window ='0';
$this->x_invoice_num = '0';
$this->x_description = 'Website Transaction';
$this->x_line_item = 'LineID<|>LineName<|>LineDDescription<|>LineQuanitity<|>LinePrice<|>LineTaxble'; # up to 30 line items seperated by ampersand
$this->x_first_name = 'Bob';
$this->x_last_name = 'Jones';
$this->x_company = '';
$this->x_address = '123 Main St.';
$this->x_city = 'Las Vegas';
$this->x_state = 'NV';
$this->x_zip = '12345';
$this->x_country = 'United States';
$this->x_phone = '(555) 555-5555';
$this->x_fax = '(555) 555-5555';
$this->x_email = '[email protected]';
$this->x_email_customer = '0';
$this->x_header_email_receipt = '';
$this->x_footer_email_receipt = '';
$this->x_cust_id = '1';
$this->x_customer_ip = '255.255.255.255';
$this->x_relay_response = 'FALSE';
$this->x_array = array();
$this->x_result = array();
}
[eluser]barryskidmore[/eluser]
Code: function transact($cart_id = 0) {
$this->x_array = array(
"x_login" => $this->x_login,
"x_version" => $this->x_version,
"x_delim_char" => $this->x_delim_char,
"x_delim_data" => $this->x_delim_data,
"x_url" => $this->x_url,
"x_type" => $this->x_type,
"x_method" => $this->x_method,
"x_tran_key" => $this->x_tran_key,
"x_relay_response" => $this->x_relay_response,
"x_card_num" => $this->x_card_num,
"x_exp_date" => $this->x_exp_date,
"x_card_code" => $this->x_card_code,
"x_description" => $this->x_description,
"x_amount" => number_format($this->x_amount,2,'.',','),
"x_first_name" => $this->x_first_name,
"x_last_name" => $this->x_last_name,
"x_company" => $this->x_company,
"x_address" => $this->x_address,
"x_city" => $this->x_city,
"x_state" => $this->x_state,
"x_zip" => $this->x_zip,
"x_country" => $this->x_country,
"x_phone" => $this->x_phone,
"x_fax" => $this->x_fax,
"x_email" => $this->x_email,
"x_email_customer" => $this->x_email_customer,
"x_header_email_receipt" => $this->x_header_email_receipt,
"x_footer_email_receipt" => $this->x_footer_email_receipt,
"x_test_request" => $this->x_test_request,
"x_version" => $this->x_version,
"x_recurring_billing" => $this->x_recurring_billing,
"x_duplicate_window" => $this->x_duplicate_window,
"x_invoice_num" => $this->x_invoice_num,
"x_description" => $this->x_description,
"x_cust_id" => $this->x_cust_id,
"x_customer_ip" => $this->x_customer_ip);
foreach($this->x_array as $key => $value) {
$this->x_request .= $key."=".urlencode($value).'&';
}
$this->x_request .= $this->x_line_item;
$this->x_transaction = curl_init($this->x_url);
curl_setopt($this->x_transaction, CURLOPT_HEADER,0);
curl_setopt($this->x_transaction, CURLOPT_RETURNTRANSFER,1);
curl_setopt($this->x_transaction, CURLOPT_POSTFIELDS,rtrim($this->x_request,'& '));
### curl_setopt($this->x_transaction, CURLOPT_SSL_VERIFYPEER, FALSE); // uncomment this line if you get no gateway response. ###
$this->x_response = curl_exec($this->x_transaction);
curl_close ($this->x_transaction);
return $this->x_response;
}
|