首页 > 解决方案 > Pesapal:问题:parameter_rejected | 建议:unknown_error_occured> oauth_parameters_rejected | request_xml_data

问题描述

我第一次在 wordpress 中包含 Pesapal 支付网关,但收到此错误:我已搜索但不幸的是没有找到此错误的解决方案。

问题:parameter_rejected | 建议:unknown_error_occured> oauth_parameters_rejected | request_xml_data

pesapal_consumer_key = listingpro_options['pesapal_secrit_key'];
pesapal_consumer_secret = listingpro_options['pesapal_pubishable_key'];



$token = $params = NULL;
$consumer_key = $pesapal_consumer_key;   

$consumer_secret = $pesapal_consumer_secret;   

$signature_method = new OAuthSignatureMethod_HMAC_SHA1();
 $iframelink = 'http://demo.pesapal.com/api/PostPesapalDirectOrderV4';


global $plan_price, $post_id;    

$current_user = wp_get_current_user();
$useremail = $current_user->user_email;
$userDname = $current_user->display_name;

echo 'Plan Price: '.$_SESSION['price'];
echo 'Post ID: '.$_SESSION['post_id'];


//get form details
$amount = $_SESSION['price'];
$amount = number_format($amount, 2);//format amount to 2 decimal places
$desc = 'desc';
$type = 'MERCHANT'; //default value = MERCHANT
$reference = '1053';//unique order id of the transaction, generated
$first_name = $userDname; //[optional]
$last_name = $_POST['last_name']; //[optional]
$email = $useremail;
//ONE of email or phonenumber is required by merchant
$phonenumber = '1122336655';    
$Currency = 'KES';   
$callback_url = 'http://test.com/serviceexpert/redirect.php'; //redirect url, the page that will handle the response from pesapal.
$post_xml = "<?xml version=\"1.0\" encoding=\"utf8\"?><PesapalDirectOrderInfo xmlns:xsi=\" http://www.w3.org/2001/XMLSchemainstance\" xmlns:xsd=\"http://www.w3.org/2001/XMLSchema\"
Amount=\"".$amount."\" Description=\"".$desc."\" Type=\"".$type."\" Reference=\"".$reference."\" FirstName=\"".$first_name."\" LastName=\"".$last_name."\" Email=\"".$email."\" PhoneNumber=\"".$phonenumber."\" Currency=\"".$Currency."\" xmlns=\"http://www.pesapal.com\" />";
$post_xml = htmlentities($post_xml);  
$consumer = new OAuthConsumer($consumer_key, $consumer_secret, $callback_url);  

$iframe_src = OAuthRequest::from_consumer_and_token($consumer, $token,"GET", $iframelink, $params);

$iframe_src->set_parameter("oauth_callback", $callback_url);
$iframe_src->set_parameter("pesapal_request_data", $post_xml);
$iframe_src->sign_request($signature_method, $consumer,$token); 

?>

<iframe src="<?php echo $iframe_src; ?>" width="100%" height="620px" scrolling="auto" frameBorder="0"><p>Unable to load the payment page</p> </iframe>

标签: wordpressapipayment-gateway

解决方案


可能您的电话/电子邮件无效


推荐阅读