Browse Source

payment page

Ime-london-webcore
shakun 11 months ago
parent
commit
6e4015f5fe
  1. 9
      Swift.web/AgentNew/Administration/CustomerSetup/CustomerRegistration/Manage.aspx
  2. BIN
      Swift.web/Content/images/spinner.gif
  3. 31
      Swift.web/Library/WebUtils.cs
  4. 4
      Swift.web/MobileRemit/Admin/Operation/EditCustomerForApproval.aspx
  5. 135
      Swift.web/Payment/STPaymentCustomerRedirect.aspx
  6. 101
      Swift.web/Payment/STPaymentCustomerRedirect.aspx.cs
  7. 117
      Swift.web/Payment/STPaymentCustomerRedirect.aspx.designer.cs
  8. 2
      Swift.web/Remit/Administration/CustomerRegistration/Manage.aspx
  9. 2
      Swift.web/Remit/Administration/CustomerSetup/Manage.aspx

9
Swift.web/AgentNew/Administration/CustomerSetup/CustomerRegistration/Manage.aspx

@ -98,7 +98,6 @@
console.error(error);
}
});
});
$('#ContentPlaceHolder1_reg_front_id').on('change', function (e) {
$('.loadImg').remove();
@ -155,8 +154,10 @@
});
});
$(document).ready(function () {
$('#modalClose').on('click', function () {
$("#apiDataPopup").modal("hide");
})
//$("#ContentPlaceHolder1_occupation").prop("disabled", true);
$("#<%=verificationTypeNo.ClientID%>").on("change", function () {
var idtype = $("#<%=idType.ClientID%>").val();
@ -783,7 +784,7 @@
ControlToValidate="emailConfirm"></asp:RegularExpressionValidator>
</div>
</div>
<div id="apiDataPopup" class="modal fade" role="dialog">
<div id="apiDataPopup" class="modal" role="dialog">
<div class="modal-dialog">
<div class="modal-content">
<div class="modal-header">
@ -804,7 +805,7 @@
</table>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-primary">Close</button>
<button type="button" class="btn btn-primary" id="modalClose" data-bs-dismiss="modal">Close</button>
</div>
</div>
</div>

BIN
Swift.web/Content/images/spinner.gif

After

Width: 131  |  Height: 131  |  Size: 139 KiB

31
Swift.web/Library/WebUtils.cs

@ -1,6 +1,10 @@
using Swift.web.Component.Grid;
using Swift.web.Component.Grid.gridHelper;
using System;
using System.Collections.Generic;
using System.IO;
using System.Security.Cryptography;
using System.Text;
namespace Swift.web.Library
{
@ -39,5 +43,32 @@ namespace Swift.web.Library
return grid.CreateGrid(sql);
}
public static string DecryptString( string cipherText)
{
var key = GetStatic.ReadWebConfig("encryptKey");
byte[] iv = new byte[16];
byte[] buffer = Convert.FromBase64String(cipherText);
using (Aes aes = Aes.Create())
{
aes.Key = Encoding.UTF8.GetBytes(key);
aes.IV = iv;
ICryptoTransform decryptor = aes.CreateDecryptor(aes.Key, aes.IV);
using (MemoryStream memoryStream = new MemoryStream(buffer))
{
using (CryptoStream cryptoStream = new CryptoStream((Stream)memoryStream, decryptor, CryptoStreamMode.Read))
{
using (StreamReader streamReader = new StreamReader((Stream)cryptoStream))
{
return streamReader.ReadToEnd();
}
}
}
}
}
}
}

4
Swift.web/MobileRemit/Admin/Operation/EditCustomerForApproval.aspx

@ -247,7 +247,7 @@
return false;
}
var countryCode = '+81';
var countryCode = '+44';
if (mobileNo.indexOf(countryCode) < 0) {
if (mobileNo.substring(0, 1) == "0") //staring with zero
@ -273,7 +273,7 @@
var maxLength = input.attr('maxLength');
if (mobileNo.length > maxLength) {
alert('Mobile No. Can allow input maximum ' + maxLength + ' digit only including +81');
alert('Mobile No. Can allow input maximum ' + maxLength + ' digit only including +44');
/* return $(this).val('');*/
return false;
}

135
Swift.web/Payment/STPaymentCustomerRedirect.aspx

@ -5,73 +5,96 @@
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title></title>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.6.4/jquery.min.js"></script>
<script>
<style>
.loader {
position: fixed;
left: 0px;
top: 0px;
width: 100%;
height: 100%;
background: url('../content/images/spinner.gif') 50% 50% no-repeat rgb(249,249,249);
}
</style>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.6.4/jquery.min.js"></script>
<script>
$(document).ready(function () {
//Id of your button control either it is server control or simple html control
})
function CallBackPost(post,a,b,c)
{
})
console.log(a);
console.log(a);
console.log(c);
function CallBackPost(post) {
if (post=='true') {
$("[id*='btnSubmit']").click();
}
if (post == 'true') {
$("[id*='btnSubmit']").click();
}
}
</script>
</head>
<body>
<form runat="server" id="from">
<input type="hidden" name="sitereference" value="test_subhidauk71992">
<input type="hidden" name="stprofile" value="default">
<input type="hidden" name="currencyiso3a" value="GBP">
<%-- <asp:HiddenField ID="mainamount" runat="server"/>--%>
<input type="hidden" name="mainamount" value="700.00" id="mainamount" runat="server">
<input type="hidden" name="version" value="2">
<asp:HiddenField ID="orderreference" runat="server"/>
<%-- <input type="hidden" name="orderreference" value="12345111">--%>
<%--<input type="hidden" name="trans_ref" value="12345">--%>
<input type="hidden" name="request_source" value="ORM">
<input type="hidden" name="billingfirstname" value="KEWAL">
<input type="hidden" name="billinglastname" value="RAJ POKHREL">
<input type="hidden" name="billingstreet" value="Middlesex">
<input type="hidden" name="customerpremise" value="London">
<input type="hidden" name="customerstreet" value="Middlesex">
<input type="hidden" name="billingpostcode" value="UB5 4SR">
<input type="hidden" name="customerpostcode" value="UB5 4SR">
<input type="hidden" name="billingtown" value="London">
<input type="hidden" name="customertown" value="London">
<input type="hidden" name="billingcountryiso2a" value="GB">
<input type="hidden" name="customercountryiso2a" value="GB">
<input type="hidden" name="billingtelephone" value="7984713677">
<input type="hidden" name="customertelephone" value="7984713677">
<input type="hidden" name="billingemail" value="kewal@imelondon.co.uk">
<input type="hidden" name="customeremail" value="sthashakun@gmail.com">
<input type="hidden" name="customertelephonetype" value="M">
<input type="hidden" name="ruleidentifier" value="STR-6">
<input type="hidden" name="successfulurlredirect" value="https://uat.imelondon.co.uk:1081/payment/trans_payment_success.aspx">
<input type="hidden" name="declinedurlredirect" value="https://uat.imelondon.co.uk:1081/payment/trans_payment_decline.aspx">
<asp:HiddenField ID="sitesecuritytimestamp" runat="server"/>
<asp:HiddenField ID="sitesecurity" runat="server"/>
<%-- <input type="hidden" name="sitesecuritytimestamp" value="2023-09-14 15:13:04">
<div class="loader">
<div class="row">
<div class="text-center">
<%--<h1>Receipt</h1>--%>
</div>
<p>If the payment page didn't load, </p>
<input type="submit" value="Click here" class="btn btn-primary" onclick="CallBackPost('true'); this.value = 'Submitting ';"/>
</div>
</div>
<form runat="server" id="from">
<input type="hidden" name="sitereference" value="test_subhidauk71992">
<input type="hidden" name="stprofile" value="default">
<input type="hidden" name="currencyiso3a" value="GBP">
<%-- <asp:HiddenField ID="mainamount" runat="server"/>--%>
<input type="hidden" name="mainamount" id="mainamount" runat="server">
<input type="hidden" name="version" value="2">
<asp:HiddenField ID="orderreference" runat="server" />
<input type="hidden" name="request_source" value="ORM">
<input type="hidden" name="billingfirstname" id="billingfirstname" runat="server">
<input type="hidden" name="billinglastname" id="billinglastname" runat="server">
<input type="hidden" name="billingstreet" id="billingstreet" runat="server">
<input type="hidden" name="customerpremise" id="customerpremise" runat="server">
<input type="hidden" name="customerstreet" id="customerstreet" runat="server">
<input type="hidden" name="billingpostcode" id="billingpostcode" runat="server">
<input type="hidden" name="customerpostcode" id="customerpostcode" runat="server">
<input type="hidden" name="billingtown" id="billingtown" runat="server">
<input type="hidden" name="customertown" id="customertown" runat="server">
<input type="hidden" name="billingcountryiso2a" value="GB">
<input type="hidden" name="customercountryiso2a" value="GB">
<input type="hidden" name="billingtelephone" id="billingtelephone" runat="server">
<input type="hidden" name="customertelephone" id="customertelephone" runat="server">
<input type="hidden" name="billingemail" id="billingemail" runat="server">
<input type="hidden" name="customeremail" id="customeremail" runat="server">
<input type="hidden" name="customertelephonetype" value="M">
<input type="hidden" name="ruleidentifier" value="STR-6">
<input type="hidden" name="successfulurlredirect" value="https://uat.imelondon.co.uk:1081/payment/trans_payment_success.aspx">
<input type="hidden" name="declinedurlredirect" value="https://uat.imelondon.co.uk:1081/payment/trans_payment_decline.aspx">
<asp:HiddenField ID="sitesecuritytimestamp" runat="server" />
<asp:HiddenField ID="sitesecurity" runat="server" />
<%-- <input type="hidden" name="sitesecuritytimestamp" value="2023-09-14 15:13:04">
<input type="hidden" name="sitesecurity" value="hb180e83d1a161c4dd32c2fccd368b77a85679563d3ac20f85bbe4ae65bc39f01">--%>
<input type="hidden" name="ruleidentifier" value="STR-4">
<!--Sends email confirmation to the merchant, following declined transaction:-->
<input type="hidden" name="ruleidentifier" value="STR-5">
<input type="hidden" name="merchantemail" value="shakun@japanremit.com">
<asp:Button ID="btnSubmit" UseSubmitBehavior="true" runat="server" />
<input type="hidden" name="ruleidentifier" value="STR-4">
<!--Sends email confirmation to the merchant, following declined transaction:-->
<input type="hidden" name="ruleidentifier" value="STR-5">
<input type="hidden" name="merchantemail" value="shakun@japanremit.com">
<asp:Button ID="btnSubmit" UseSubmitBehavior="true" runat="server" />
</form>
</body>
</html>

101
Swift.web/Payment/STPaymentCustomerRedirect.aspx.cs

@ -1,49 +1,110 @@
using Swift.web.Library;
using Newtonsoft.Json;
using Swift.API;
using Swift.web.Library;
using System;
using System.Collections.Generic;
using System.Data;
using System.Linq;
using System.Security.Cryptography;
using System.Text;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using UAParser;
namespace Swift.web.Payment
{
public partial class STPaymentCustomerRedirect : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
if (!Page.IsPostBack)
{
var cn = GetStatic.ReadQueryString("cn", "");
sitesecuritytimestamp.Value = DateTime.UtcNow.ToString("yyyy-MM-dd HH:mm:ss");
var customerid = GetStatic.ReadQueryString("cid", "");
var uniqueId = GetStatic.ReadQueryString("ref", "");
var tranid = GetStatic.ReadQueryString("Id", "");
orderreference.Value = Guid.NewGuid().ToString();
Form.Method = "POST";
var uniqueId = GetStatic.ReadQueryString("ref", "");
var eid = GetStatic.ReadQueryString("Id", "");
if (!string.IsNullOrEmpty(eid))
{
string uaString = HttpContext.Current.Request.Headers["User-Agent"].ToString();
var hash = $"GBP700.00test_subhidauk71992{sitesecuritytimestamp.Value}BEe6nRraqNeUgkpI";
var uaParser = Parser.GetDefault();
StringBuilder builder = new StringBuilder();
using (SHA256 sha256Hash = SHA256.Create())
{
// ComputeHash - returns byte array
byte[] bytes = sha256Hash.ComputeHash(Encoding.UTF8.GetBytes(hash));
ClientInfo c = uaParser.Parse(uaString);
RemittanceLibrary _remit = new RemittanceLibrary();
SwiftLibrary sl = new SwiftLibrary();
var tranid = HttpUtility.UrlDecode(WebUtils.DecryptString(eid));
var controlNo = HttpUtility.UrlDecode(WebUtils.DecryptString(eid));
// Convert byte array to a string
for (int i = 0; i < bytes.Length; i++)
{
builder.Append(bytes[i].ToString("x2"));
Utility.LogRequest(tranid, "TRUSTPAY", "CustomerRedirect", controlNo, JsonConvert.SerializeObject(c), uniqueId);
string sql = "EXEC proc_trust_payment @Flag = 'details',@type='data', @tranid = " + sl.FilterString(tranid) + "";
DataSet ds = _remit.ExecuteDataset(sql);
if (ds.Tables == null || ds.Tables.Count <= 0)
{
GetStatic.AlertMessage(this, "Data Empty.");
return;
}
DataTable dt = ds.Tables[0];
if (dt == null || dt.Rows.Count <= 0)
{
GetStatic.AlertMessage(this, "Data Empty.");
return;
}
orderreference.Value = Convert.ToString(dt.Rows[0]["ControlNo"]);
sitesecuritytimestamp.Value = DateTime.UtcNow.ToString("yyyy-MM-dd HH:mm:ss");
mainamount.Value = Convert.ToString(dt.Rows[0]["camt"]);
billingpostcode.Value = customerpostcode.Value = Convert.ToString(dt.Rows[0]["zipcode"]);
billingfirstname.Value = Convert.ToString(dt.Rows[0]["firstname"]);
billinglastname.Value = Convert.ToString(dt.Rows[0]["lastname1"]);
billingstreet.Value = customerstreet.Value = Convert.ToString(dt.Rows[0]["address"]);
customertown.Value = billingtown.Value = Convert.ToString(dt.Rows[0]["city"]);
billingtelephone.Value = customertelephone.Value = Convert.ToString(dt.Rows[0]["mobile"]);
Form.Method = "POST";
var hash = $"GBP{ mainamount.Value}test_subhidauk71992{sitesecuritytimestamp.Value}BEe6nRraqNeUgkpI";
StringBuilder builder = new StringBuilder();
using (SHA256 sha256Hash = SHA256.Create())
{
// ComputeHash - returns byte array
byte[] bytes = sha256Hash.ComputeHash(Encoding.UTF8.GetBytes(hash));
// Convert byte array to a string
for (int i = 0; i < bytes.Length; i++)
{
builder.Append(bytes[i].ToString("x2"));
}
}
sitesecurity.Value = $"h{builder.ToString()}";
Form.Action = "https://payments.securetrading.net/process/payments/choice";
GetStatic.CallJSFunction(this, $"CallBackPost('true')");
}
}
sitesecurity.Value = $"h{builder.ToString()}";
Form.Action = "https://payments.securetrading.net/process/payments/choice";
GetStatic.CallJSFunction(this, $"CallBackPost('true','{customerid}','{uniqueId}','{tranid}')");
}

117
Swift.web/Payment/STPaymentCustomerRedirect.aspx.designer.cs

@ -41,6 +41,123 @@ namespace Swift.web.Payment
/// </remarks>
protected global::System.Web.UI.WebControls.HiddenField orderreference;
/// <summary>
/// billingfirstname control.
/// </summary>
/// <remarks>
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::System.Web.UI.HtmlControls.HtmlInputHidden billingfirstname;
/// <summary>
/// billinglastname control.
/// </summary>
/// <remarks>
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::System.Web.UI.HtmlControls.HtmlInputHidden billinglastname;
/// <summary>
/// billingstreet control.
/// </summary>
/// <remarks>
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::System.Web.UI.HtmlControls.HtmlInputHidden billingstreet;
/// <summary>
/// customerpremise control.
/// </summary>
/// <remarks>
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::System.Web.UI.HtmlControls.HtmlInputHidden customerpremise;
/// <summary>
/// customerstreet control.
/// </summary>
/// <remarks>
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::System.Web.UI.HtmlControls.HtmlInputHidden customerstreet;
/// <summary>
/// billingpostcode control.
/// </summary>
/// <remarks>
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::System.Web.UI.HtmlControls.HtmlInputHidden billingpostcode;
/// <summary>
/// customerpostcode control.
/// </summary>
/// <remarks>
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::System.Web.UI.HtmlControls.HtmlInputHidden customerpostcode;
/// <summary>
/// billingtown control.
/// </summary>
/// <remarks>
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::System.Web.UI.HtmlControls.HtmlInputHidden billingtown;
/// <summary>
/// customertown control.
/// </summary>
/// <remarks>
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::System.Web.UI.HtmlControls.HtmlInputHidden customertown;
/// <summary>
/// billingtelephone control.
/// </summary>
/// <remarks>
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::System.Web.UI.HtmlControls.HtmlInputHidden billingtelephone;
/// <summary>
/// customertelephone control.
/// </summary>
/// <remarks>
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::System.Web.UI.HtmlControls.HtmlInputHidden customertelephone;
/// <summary>
/// billingemail control.
/// </summary>
/// <remarks>
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::System.Web.UI.HtmlControls.HtmlInputHidden billingemail;
/// <summary>
/// customeremail control.
/// </summary>
/// <remarks>
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::System.Web.UI.HtmlControls.HtmlInputHidden customeremail;
/// <summary>
/// sitesecuritytimestamp control.
/// </summary>

2
Swift.web/Remit/Administration/CustomerRegistration/Manage.aspx

@ -1169,7 +1169,7 @@
</table>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-primary" data-dismiss="modal">Close</button>
<button type="button" class="btn btn-primary" data-bs-dismiss="modal">Close</button>
</div>
</div>
</div>

2
Swift.web/Remit/Administration/CustomerSetup/Manage.aspx

@ -65,7 +65,7 @@
// mobile country code added
$("#<%=mobile.ClientID%>").intlTelInput({
nationalMode: true,
onlyCountries: ["jp"],
onlyCountries: ["gp"],
//onlyCountries: ["az", "bd", "by", "ge", "kz", "kg", "mm", "md", "my", "ph", "lk", "th", "in", "ru", "tj", "uz", "cn", "sg", "id", "pk", "np", "vn", "kh", "mn"],
utilsScript: "https://cdnjs.cloudflare.com/ajax/libs/intl-tel-input/12.1.3/js/utils.js" // just for formatting/placeholders etc
});

Loading…
Cancel
Save