protected void BtnCreateLinkPayment_Click(object sender, EventArgs e) { Settings settings = new Settings(); LinkPaymentCreateRequest request = new LinkPaymentCreateRequest(); request.name = name.Value; request.surname = surname.Value; request.tcCertificate = tcCertificate.Value; request.taxNumber = taxNumber.Value; request.email = email.Value; request.gsm = gsm.Value; request.amount = Convert.ToInt32(amount.Value); request.threeD = threeD.Value; request.expireDate = year.Value + "-" + month.Value + "-" + day.Value + " 23:59:59"; int[] i = new int[1]; i[0] = Convert.ToInt32(installmentList.Value); request.installmentList = i; request.sendEmail = sendEmail.Value; request.commissionType = commissionType.Value; request.clientIp = "127.0.0.1"; LinkPaymentCreateResponse response = LinkPaymentCreateRequest.Execute(request, settings); string jsonResponse = JsonConvert.SerializeObject(response, Formatting.Indented); result.InnerHtml = "<pre>" + jsonResponse + "</pre>"; }
public static LinkPaymentCreateResponse Execute(LinkPaymentCreateRequest request, Settings options) { options.TransactionDate = Helper.GetTransactionDateString(); options.HashString = options.PrivateKey + request.name + request.surname + request.email + request.amount + request.clientIp + options.TransactionDate; LinkPaymentCreateResponse response = RestHttpCaller.Create().PostJson <LinkPaymentCreateResponse>(options.BaseUrl + "corporate/merchant/linkpayment/create", Helper.GetHttpHeaders(options, Helper.application_json), request); return(response); }