Changeset 2008883
- Timestamp:
- 01/09/2019 06:12:07 AM (7 years ago)
- Location:
- pesapal-pay/trunk
- Files:
-
- 2 edited
-
pesapal_pay.php (modified) (3 diffs)
-
readme.txt (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
pesapal-pay/trunk/pesapal_pay.php
r1952755 r2008883 3 3 Plugin Name: Pesapal Pay 4 4 Description: A quick way to integrate pesapal to your website to handle the payment process. All you need to do is set up what parameters to capture from the form and the plugin will do the rest 5 Version: 3.1. 2.25 Version: 3.1.3 6 6 Author: rixeo 7 7 Author URI: http://thebunch.co.ke/ … … 888 888 $request_status->set_parameter("pesapal_transaction_tracking_id",$invoice); 889 889 $request_status->sign_request($signature_method, $consumer, $token); 890 $ch = curl_init(); 891 curl_setopt($ch, CURLOPT_URL, $request_status); 892 curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); 893 curl_setopt($ch, CURLOPT_HEADER, 1); 894 curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 0); 895 if(defined('CURL_PROXY_REQUIRED')) if (CURL_PROXY_REQUIRED == 'True'){ 896 $proxy_tunnel_flag = (defined('CURL_PROXY_TUNNEL_FLAG') && strtoupper(CURL_PROXY_TUNNEL_FLAG) == 'FALSE') ? false : true; 897 curl_setopt ($ch, CURLOPT_HTTPPROXYTUNNEL, $proxy_tunnel_flag); 898 curl_setopt ($ch, CURLOPT_PROXYTYPE, CURLPROXY_HTTP); 899 curl_setopt ($ch, CURLOPT_PROXY, CURL_PROXY_SERVER_DETAILS); 890 891 $request = wp_remote_get( $request_status ); 892 if ( is_wp_error( $request) ) { 893 $response = __( 'PENDING' ); 894 } else { 895 $response = wp_remote_retrieve_body( $request ); 900 896 } 901 897 902 $response = curl_exec($ch); 903 904 $header_size = curl_getinfo($ch, CURLINFO_HEADER_SIZE); 905 $raw_header = substr($response, 0, $header_size - 4); 906 $headerArray = explode("\r\n\r\n", $raw_header); 907 $header = $headerArray[count($headerArray) - 1]; 908 909 //transaction status 910 $elements = preg_split("/=/",substr($response, $header_size)); 911 $status = $elements[1]; 912 913 curl_close ($ch); 914 switch ($status) { 898 switch ($response) { 915 899 case 'PENDING': 916 900 $updated_status = 'order_pending'; … … 970 954 $request_status->set_parameter("pesapal_transaction_tracking_id",$invoice); 971 955 $request_status->sign_request($signature_method, $consumer, $token); 972 $ch = curl_init(); 973 curl_setopt($ch, CURLOPT_URL, $request_status); 974 curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); 975 curl_setopt($ch, CURLOPT_HEADER, 1); 976 curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 0); 977 if(defined('CURL_PROXY_REQUIRED')) if (CURL_PROXY_REQUIRED == 'True'){ 978 $proxy_tunnel_flag = (defined('CURL_PROXY_TUNNEL_FLAG') && strtoupper(CURL_PROXY_TUNNEL_FLAG) == 'FALSE') ? false : true; 979 curl_setopt ($ch, CURLOPT_HTTPPROXYTUNNEL, $proxy_tunnel_flag); 980 curl_setopt ($ch, CURLOPT_PROXYTYPE, CURLPROXY_HTTP); 981 curl_setopt ($ch, CURLOPT_PROXY, CURL_PROXY_SERVER_DETAILS); 956 957 $request = wp_remote_get( $request_status ); 958 if ( is_wp_error( $server_response) ) { 959 $response = __( 'PENDING' ); 960 } else { 961 $response = wp_remote_retrieve_body( $response ); 982 962 } 983 984 $response = curl_exec($ch); 985 986 $header_size = curl_getinfo($ch, CURLINFO_HEADER_SIZE); 987 $raw_header = substr($response, 0, $header_size - 4); 988 $headerArray = explode("\r\n\r\n", $raw_header); 989 $header = $headerArray[count($headerArray) - 1]; 990 991 //transaction status 992 $elements = preg_split("/=/",substr($response, $header_size)); 993 $status = $elements[1]; 994 995 curl_close ($ch); 996 switch ($status) { 963 switch ($response) { 997 964 case 'PENDING': 998 965 $updated_status = 'order_pending'; -
pesapal-pay/trunk/readme.txt
r1989778 r2008883 4 4 Tags: Pesapal, e-commerce, ecommerce 5 5 Requires at least: 4.4.0 6 Tested up to: 5. 07 Stable tag: 3.1. 2.26 Tested up to: 5.1 7 Stable tag: 3.1.3 8 8 License: GPLv2 or later 9 9 License URI: http://www.gnu.org/licenses/gpl-2.0.html … … 51 51 52 52 == Changelog == 53 54 = 3.1.3 = 55 * Refactor PesaPal to use WordPress HTTP API 56 * Other code fixes 53 57 54 58 = 3.1.2.2 =
Note: See TracChangeset
for help on using the changeset viewer.