reactjs - React JS 中的 PayuMoney 集成问题
问题描述
我正在尝试将 PayuMoney 集成到我的反应应用程序中,它始终会出现以下 404 错误。我什至通过了正确的哈希序列仍然给出了同样的错误!
在 componentDidMount 方法中:
componentDidMount() {
var hashString_1 = 'KEY|ORD569|6.00|P01,P02|Raajni|asdf@xxxx.com|||||BOLT_KIT_NODE_JS||||||salt';
const shaObj = new jsSHA("SHA-512", "TEXT");
shaObj.update(hashString_1);
const hash = shaObj.getHash("HEX");
this.setState ( {
//Payu Fields Start
surl:"http://localhost:3000/customer-payment-response",
furl:"http://localhost:3000/customer-payment-response",
hashCode : hash
})
}
handlePaymentSubmit = (event) => {
event.preventDefault();
console.log("Inside Pay Submit Function handle Submit !!!!");
window["launchBOLT"]();
};
表单提交处理PaymentSubmit
<form id="payment_form" onSubmit={this.handlePaymentSubmit} class="php-email-form">
<input type="hidden" value={this.state.key} name="udf5" id="key"/>
<input type="hidden" value={this.state.salt} name="salt" id="salt"/>
<input type="hidden" value={this.state.txnid} name="txnid" id="txnid"/>
<input type="hidden" value={this.state.amount} name="amount" id="amount"/>
<input type="hidden" value={this.state.pinfo} name="pinfo" id="pinfo"/>
<input type="hidden" value={this.state.fname} name="fname" id="fname"/>
<input type="hidden" value={this.state.email} name="email" id="email"/>
<input type="hidden" value={this.state.mobile} name="mobile" id="mobile"/>
<input type="hidden" value={this.state.udf5} name="udf5" id="udf5"/>
<input type="hidden" value={this.state.surl} name="surl" id="surl"/>
<input type="hidden" value={this.state.hashCode} name="hash" id="hash"/>
</form>
在我的 index.html 文件中:
function launchBOLT()
{
console.log('inside...launch BOLT.....');
bolt.launch({
key: $('#key').val(),
txnid: $('#txnid').val(),
hash: $('#hash').val(),
amount: $('#amount').val(),
firstname: $('#fname').val(),
email: $('#email').val(),
phone: $('#mobile').val(),
productinfo: $('#pinfo').val(),
udf5: $('#udf5').val(),
surl : $('#surl').val(),
furl: $('#surl').val()
},
{ responseHandler: function(BOLT){
console.log( "BOLT.response.txnStatus : " );
console.log( BOLT.response.txnStatus );
if(BOLT.response.txnStatus != 'CANCEL')
{
// alert("....1.1...." );
//Salt is passd here for demo purpose only. For practical use keep salt at server side only.
var fr = '<form action=\"'+$('#surl').val()+'\" method=\"post\">' +
'<input type=\"hidden\" name=\"key\" value=\"'+BOLT.response.key+'\" />' +
'<input type=\"hidden\" name=\"salt\" value=\"'+$('#salt').val()+'\" />' +
'<input type=\"hidden\" name=\"txnid\" value=\"'+BOLT.response.txnid+'\" />' +
'<input type=\"hidden\" name=\"amount\" value=\"'+BOLT.response.amount+'\" />' +
'<input type=\"hidden\" name=\"productinfo\" value=\"'+BOLT.response.productinfo+'\" />' +
'<input type=\"hidden\" name=\"firstname\" value=\"'+BOLT.response.firstname+'\" />' +
'<input type=\"hidden\" name=\"email\" value=\"'+BOLT.response.email+'\" />' +
'<input type=\"hidden\" name=\"udf5\" value=\"'+BOLT.response.udf5+'\" />' +
'<input type=\"hidden\" name=\"mihpayid\" value=\"'+BOLT.response.mihpayid+'\" />' +
'<input type=\"hidden\" name=\"status\" value=\"'+BOLT.response.status+'\" />' +
'<input type=\"hidden\" name=\"hash\" value=\"'+BOLT.response.hash+'\" />' +
'</form>';
var form = jQuery(fr);
jQuery('body').append(form);
alert("...1.2....."+ form );
form.submit();
}
},
catchException: function(BOLT){
alert("....1....."+ BOLT.message );
}
});
}
在控制台中收到以下错误。
GET https://sboxcheckout-static.citruspay.com/bolt/css/bolt_2_8.min.css net::ERR_ABORTED 404 (Not Found) catch block : Error in adding payment
解决方案
推荐阅读
- python - 无法导入 .xlsx 文件的大型缓存 - 收到错误 BadZipFile:文件不是 zip 文件
- powershell - 为什么删除 powershell.exe -executionpolicy unrestricted 突然起作用但以前没有
- pine-script - 在第一次条件为真时关闭 50%,然后在下一次发生时关闭另外 50%
- dialog - Magnolia (6.2) 选择器 ChooseAction 按节点类型的可用性
- ios - 将数据从闭包函数传递到 Segue 变量
- apache-spark - 优化同一数据帧的不同键上的火花连接
- django - 可以使用什么 SSO 解决方案,不需要用户提示,也不依赖固定的重定向 URI?
- reactjs - react-transition-groups 根据状态改变动画方向
- python - 我不能用beautifulsoup 刮掉某个列表
- c# - 如何创建操作以检查是否有计划覆盖现有计划?