Changeset 2008877
- Timestamp:
- 01/09/2019 06:00:25 AM (7 years ago)
- Location:
- thebunch-ke-pesapal-woocommerce/trunk
- Files:
-
- 2 edited
-
readme.txt (modified) (2 diffs)
-
thebunchke_pesapal_woocommerce.php (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
thebunch-ke-pesapal-woocommerce/trunk/readme.txt
r1989776 r2008877 4 4 Tags: pesapal, woocommerce, ecommerce, gateway, payment 5 5 Requires at least: 4.0 6 Tested up to: 5. 07 Stable tag: 1.1. 86 Tested up to: 5.1 7 Stable tag: 1.1.9 8 8 License: GPLv3 or later 9 9 License URI: http://www.gnu.org/licenses/gpl-3.0.html … … 31 31 32 32 == Changelog == 33 34 = 1.1.9 = 35 * Update from Curl to WordPress HTTP API 36 * Fix WooCommerce deprecated functions 33 37 34 38 = 1.1.8 = -
thebunch-ke-pesapal-woocommerce/trunk/thebunchke_pesapal_woocommerce.php
r1852264 r2008877 3 3 Plugin Name: TheBunch KE Pesapal Woocommerce 4 4 Description: Add PesaPal payment gateway to your Woocommerce plugin 5 Version: 1.1. 85 Version: 1.1.9 6 6 Author: rixeo 7 7 Author URI: http://thebunch.co.ke/ … … 355 355 $pesapal_args['total'] = $order->get_total(); 356 356 $pesapal_args['reference'] = $order_id; 357 $pesapal_args['first_name'] = $order-> billing_first_name;358 $pesapal_args['last_name'] = $order-> billing_last_name;359 $pesapal_args['email'] = $order-> billing_email;360 $pesapal_args['phone'] = $order-> billing_phone;357 $pesapal_args['first_name'] = $order->get_billing_first_name(); 358 $pesapal_args['last_name'] = $order->get_billing_last_name(); 359 $pesapal_args['email'] = $order->get_billing_email(); 360 $pesapal_args['phone'] = $order->get_billing_phone(); 361 361 362 362 … … 456 456 **/ 457 457 function curlRequest($request_status){ 458 459 $ch = curl_init(); 460 curl_setopt($ch, CURLOPT_URL, $request_status); 461 curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); 462 curl_setopt($ch, CURLOPT_HEADER, 1); 463 curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 0); 464 if(defined('CURL_PROXY_REQUIRED')) if (CURL_PROXY_REQUIRED == 'True'){ 465 $proxy_tunnel_flag = (defined('CURL_PROXY_TUNNEL_FLAG') && strtoupper(CURL_PROXY_TUNNEL_FLAG) == 'FALSE') ? false : true; 466 curl_setopt ($ch, CURLOPT_HTTPPROXYTUNNEL, $proxy_tunnel_flag); 467 curl_setopt ($ch, CURLOPT_PROXYTYPE, CURLPROXY_HTTP); 468 curl_setopt ($ch, CURLOPT_PROXY, CURL_PROXY_SERVER_DETAILS); 469 } 470 471 $response = curl_exec($ch); 472 $header_size = curl_getinfo($ch, CURLINFO_HEADER_SIZE); 473 $raw_header = substr($response, 0, $header_size - 4); 474 $headerArray = explode("\r\n\r\n", $raw_header); 475 $header = $headerArray[count($headerArray) - 1]; 476 477 //transaction status 478 $elements = preg_split("/=/",substr($response, $header_size)); 479 $pesapal_response_data = $elements[1]; 480 481 return $pesapal_response_data; 458 459 $response = wp_remote_get( $request_status ); 460 if ( is_wp_error( $server_response) ) { 461 return __( 'An Error Occurred' ); 462 } else { 463 $resp_body = wp_remote_retrieve_body( $response ); 464 return $resp_body; 465 } 482 466 483 467 }
Note: See TracChangeset
for help on using the changeset viewer.