Skip to content

Commit a9b59a6

Browse files
committed
Updated to V4 API
1 parent 92083e9 commit a9b59a6

File tree

4 files changed

+17
-6
lines changed

4 files changed

+17
-6
lines changed

App_Code/SSLCommerz.cs

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ public class SSLCommerz
2424
protected bool Store_Test_Mode;
2525

2626
protected string SSLCz_URL = "https://securepay.sslcommerz.com/";
27-
protected string Submit_URL = "gwprocess/v3/api.php";
27+
protected string Submit_URL = "gwprocess/v4/api.php";
2828
protected string Validation_URL = "validator/api/validationserverAPI.php";
2929
protected string Checking_URL = "validator/api/merchantTransIDvalidationAPI.php";
3030

@@ -317,5 +317,10 @@ public class SSLCommerzValidatorResponse
317317
public string validated_on { get; set; }
318318
public string gw_version { get; set; }
319319
public string token_key { get; set; }
320+
public string shipping_method { get; set; }
321+
public string num_of_item { get; set; }
322+
public string product_name { get; set; }
323+
public string product_profile { get; set; }
324+
public string product_category { get; set; }
320325
}
321326
}

Default.aspx.cs

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,15 +14,15 @@ protected void Page_Load(object sender, EventArgs e)
1414

1515
// CREATING LIST OF POST DATA
1616
NameValueCollection PostData = new NameValueCollection();
17-
PostData.Add("total_amount", "1150.00");
17+
PostData.Add("total_amount", "15.00");
1818
PostData.Add("tran_id", "TESTASPNET1234");
1919
PostData.Add("success_url",baseUrl+"Success.aspx");
2020
PostData.Add("fail_url", baseUrl+"Fail.aspx"); // "Fail.aspx" page needs to be created
2121
PostData.Add("cancel_url", baseUrl+"Cancel.aspx"); // "Cancel.aspx" page needs to be created
2222
PostData.Add("version", "3.00");
2323
PostData.Add("cus_name", "ABC XY");
2424
PostData.Add("cus_email", "[email protected]");
25-
PostData.Add( "cus_add1", "Address Line On");
25+
PostData.Add("cus_add1", "Address Line On");
2626
PostData.Add("cus_add2", "Address Line Tw");
2727
PostData.Add("cus_city", "City Nam");
2828
PostData.Add("cus_state", "State Nam");
@@ -41,8 +41,13 @@ protected void Page_Load(object sender, EventArgs e)
4141
PostData.Add("value_b", "ref00");
4242
PostData.Add("value_c", "ref00");
4343
PostData.Add("value_d", "ref00");
44+
PostData.Add("shipping_method", "NO");
45+
PostData.Add("num_of_item", "1");
46+
PostData.Add("product_name", "Demo");
47+
PostData.Add("product_profile", "general");
48+
PostData.Add("product_category", "Demo");
4449

45-
SSLCommerz sslcz = new SSLCommerz("YOUR STORE ID", "YOUR STORE PASSWORD");
50+
SSLCommerz sslcz = new SSLCommerz("testbox", "qwerty", true);
4651
String response = sslcz.InitiateTransaction(PostData);
4752
Response.Redirect(response);
4853
}

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44

55
1. Visual Studio 2017
66
2. [Sandbox Account](https://developer.sslcommerz.com/registration/ "SSLCommerz Sandbox Registration")
7+
3. TLS V1.2
78

89
## Process flow to integrate SSLCommerz by using ASP.Net sample code.
910

Success.aspx.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,11 +13,11 @@ protected void Page_Load(object sender, EventArgs e)
1313
{
1414
string TrxID = Request.Form["tran_id"];
1515
// AMOUNT and Currency FROM DB FOR THIS TRANSACTION
16-
string amount = "1150";
16+
string amount = "15";
1717
string currency = "BDT";
1818

1919
SSLCommerz sslcz = new SSLCommerz("testbox", "qwerty", true);
20-
Response.Write(sslcz.OrderValidate(TrxID, amount, currency, Request));
20+
Response.Write("Validation Response: "+sslcz.OrderValidate(TrxID, amount, currency, Request));
2121
}
2222
else {
2323
Response.Write("not found");

0 commit comments

Comments
 (0)