Search
 
SCRIPT & CODE EXAMPLE
 

PHP

how to payment credit card in codeigniter authorized.net

function do_payment ($post_values)
{
        $post_url = "https://test.authorize.net/gateway/transact.dll";		  
        // This section takes the input fields and converts them to the proper format
	$post_string = "";
	foreach( $post_values as $key => $value )
	{ $post_string .= "$key=" . urlencode( $value ) . "&"; }
	   $post_string = rtrim( $post_string, "& " );
	
	// This sample code uses the CURL library for php to establish a connection,
		// submit the post, and record the response.
		// If you receive an error, you may want to ensure that you have the curl
		// library enabled in your php configuration
		
		$request = curl_init($post_url); // initiate curl object
		
		curl_setopt($request, CURLOPT_HEADER, 0); // set to 0 to eliminate header info from response
		
		curl_setopt($request, CURLOPT_RETURNTRANSFER, 1); // Returns response data instead of TRUE(1)
		curl_setopt($request, CURLOPT_POSTFIELDS, $post_string); // use HTTP POST to send form data
		curl_setopt($request, CURLOPT_SSL_VERIFYPEER, FALSE); // uncomment this line if you get no gateway response.
		$post_response = curl_exec($request); // execute curl post and store results in $post_response
		
		// additional options may be required depending upon your server configuration
		// you can find documentation on curl options at http://www.php.net/curl_setopt
		curl_close ($request); // close curl object
		
		// This line takes the response and breaks it into an array using the specified delimiting character
		$response_array = explode($post_values["x_delim_char"],$post_response);
		
		// The results are output to the screen in the form of an html numbered list.
		if($response_array)
		{
		return $response_array;
		}
	  else { return ''; }
	}
Comment

PREVIOUS NEXT
Code Example
Php :: $request laravel undefined inside function query 
Php :: phoenix query builder 
Php :: phpmaker check master details page 
Php :: codeigniter without index.php not working 
Php :: Laravel 9.x Target class does not exist error at login application 
Php :: return multiple rows from mysqli php and encode JSON 
Php :: add user role to wp admin page css 
Php :: html vs php 
Php :: $this-uri-uri_to_assoc(5); 
Php :: merge cell collumn phpOffice 
Php :: popup en php 
Php :: php Change the WooCommerce loop product link based on a custom field 
Php :: woocommerce create client account without email 
Php :: file upload yii2 rest api 
Php :: dreamweaver laravel plugin 
Php :: php doctrine findby greater than 
Php :: add attachment to the invoice laravel 
Php :: Comment rediriger la page “Panier” et sauter la page Commande 
Php :: error correction in qr code php 
Php :: laravel orm latest() 
Php :: 7 reasons why Lee is an idiot 
Php :: fuzzy search in php with percentage 
Php :: php delete al lsession 
Php :: Required parameter follows optional parameter (500 Internal Server Error) php 
Php :: show data as per url slug change in laravel 
Php :: php unsupported file types 
Php :: null check nested object laravel 
Php :: get first cat php wp 
Php :: redirect back in codeignitor 
Php :: deleted_at 
ADD CONTENT
Topic
Content
Source link
Name
7+4 =