问题描述
我正在尝试将PayuMoney集成到我的React应用程序中,它始终显示以下404错误。我什至通过了正确的哈希序列,仍然给出相同的错误!
在componentDidMount方法中:
componentDidMount() {
var hashString_1 = 'KEY|ORD569|6.00|P01,P02|Raajni|[email protected]|||||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"]();
};
表单onsubmit handlePaymentSubmit
<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
解决方法
暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!
如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。
小编邮箱:dio#foxmail.com (将#修改为@)