Pesapal:问题:parameter_rejected |建议:unknown_error_occured> oauth_parameters_rejected | request_xml_

Posted

技术标签:

【中文标题】Pesapal:问题:parameter_rejected |建议:unknown_error_occured> oauth_parameters_rejected | request_xml_data【英文标题】:Pesapal: Problem: parameter_rejected | Advice: unknown_error_occured> oauth_parameters_rejected | request_xml_data 【发布时间】:2019-05-15 09:09:19 【问题描述】:

我第一次在 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; ?>"   scrolling="auto" frameBorder="0"><p>Unable to load the payment page</p> </iframe>

【问题讨论】:

你能解决这个问题吗? 【参考方案1】:

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

【讨论】:

以上是关于Pesapal:问题:parameter_rejected |建议:unknown_error_occured> oauth_parameters_rejected | request_xml_的主要内容,如果未能解决你的问题,请参考以下文章

SVM原问题与对偶问题

P问题,NP问题,NPC问题,NP-hard问题

P问题NP问题和NPC问题

网络流24题(好大的坑啊)

算法---- 01背包问题和完全背包问题LeetCode系列问题题解

算法---- 01背包问题和完全背包问题LeetCode系列问题题解