-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdoMassCapture.aspx.cs
More file actions
62 lines (52 loc) · 2.29 KB
/
doMassCapture.aspx.cs
File metadata and controls
62 lines (52 loc) · 2.29 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
using System;
using SDKPaylineDotNet;
using SDKPaylineDotNet.MassPaymentAPI;
public partial class doMassCapture : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
}
protected void ButtonDoPayment_Click(object sender, EventArgs e)
{
// Retrieve first item informations
var myPayment1 = new payment();
myPayment1.amount = TextBoxPaymentAmount1.Text;
myPayment1.currency = TextBoxPaymentCurrency1.Text;
myPayment1.action = DropDownListPaymentFunction1.SelectedValue;
myPayment1.mode = DropDownListPaymentMode1.SelectedValue; ;
myPayment1.contractNumber = TextBoxPaymentContract1.Text;
myPayment1.differedActionDate = TextBoxPaymentDifferedDate1.Text;
capture myCapture1 = new capture();
myCapture1.payment = myPayment1;
myCapture1.transactionID = TextBoxTransactionID1.Text;
// Retrieve seconde item informations
var myPayment2 = new payment();
myPayment2.amount = TextBoxPaymentAmount2.Text;
myPayment2.currency = TextBoxPaymentCurrency2.Text;
myPayment2.action = DropDownListPaymentFunction2.SelectedValue;
myPayment2.mode = DropDownListPaymentMode2.SelectedValue; ;
myPayment2.contractNumber = TextBoxPaymentContract2.Text;
myPayment2.differedActionDate = TextBoxPaymentDifferedDate2.Text;
capture myCapture2 = new capture();
myCapture2.payment = myPayment2;
myCapture2.transactionID = TextBoxTransactionID2.Text;
capture[] myCaptureList = new capture[] { myCapture1, myCapture2 };
string massTreatmentID = "";
string date = "";
try
{
var client = PaymentApiFactory.GetMassPaymentAPIClient();
var Result = client.doMassCapture(GlobalVariables.APIVersion, myCaptureList, TextBoxComment.Text, out massTreatmentID, out date);
//Returned datas
TextBoxResultCode.Text = Result.code;
TextBoxResultShortMessage.Text = Result.shortMessage;
TextBoxResultLongMessage.Text = Result.longMessage;
TextBoxMassTreatmentID.Text = massTreatmentID;
}
catch (Exception E)
{
LabelError.Visible = true;
LabelError.Text = "Error : " + E.ToString();
}
}
}