-
Notifications
You must be signed in to change notification settings - Fork 0
/
doRefund.aspx.cs
44 lines (38 loc) · 1.56 KB
/
doRefund.aspx.cs
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
using System;
using SDKPaylineDotNet;
using SDKPaylineDotNet.DirectPaymentAPI;
public partial class doRefund : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
}
protected void ButtonDoPayment_Click(object sender, EventArgs e)
{
// Retrieve payment informations
payment myPayment = new payment();
myPayment.amount = TextBoxPaymentAmount.Text;
myPayment.currency = TextBoxPaymentCurrency.Text;
myPayment.action = DropDownListPaymentFunction.SelectedValue;
myPayment.mode = DropDownListPaymentMode.SelectedValue; ;
myPayment.contractNumber = TextBoxPaymentContract.Text;
myPayment.differedActionDate = TextBoxPaymentDifferedDate.Text;
//Returned datas
transaction myTransaction = new transaction();
try
{
var client = PaymentApiFactory.GetDirectPaymentAPIClient();
var Result = client.doRefund(GlobalVariables.APIVersion, TextBoxTransactionID.Text, myPayment, TextBoxTransactionComment.Text, null, null, null, null, out myTransaction);
//Returned datas
TextBoxResultCode.Text = Result.code;
TextBoxResultShortMessage.Text = Result.shortMessage;
TextBoxResultLongMessage.Text = Result.longMessage;
TextBoxTransactionDate.Text = myTransaction.date;
TextBoxReturnedID.Text = myTransaction.id;
}
catch (Exception E)
{
LabelError.Visible = true;
LabelError.Text = "Error : " + E.ToString();
}
}
}