public void RefundAdd(string bankAccountName, string bankAccountNumber, string amount) { try { APISettings.InitAPI(); ClearDebug(); int numValue; bool parsed = Int32.TryParse(amount, out numValue); if (!parsed) { AddDebug("foutieve invoer"); AddDebug("amount: numbers. 3,40 must be filled in as 350"); } else { PAYNLSDK.API.Refund.Add.Request request = new PAYNLSDK.API.Refund.Add.Request(numValue, bankAccountName, bankAccountNumber, ""); InitRequestDebug(request); APISettings.Client.PerformRequest(request); DebugRawResponse(request); tbMain.Text = request.Response.RefundId; } } catch (ErrorException ee) { AddDebug("~~EXCEPTION~~"); AddDebug(ee.Message); } }
public void Decline(string transactionID) { try { APISettings.InitAPI(); ClearDebug(); if (transactionID == "") { AddDebug("foutieve invoer"); AddDebug("transactionID mag niet leeg zijn"); } else { PAYNLSDK.API.Transaction.Decline.Request request = new PAYNLSDK.API.Transaction.Decline.Request(); request.TransactionId = transactionID; InitRequestDebug(request); APISettings.Client.PerformRequest(request); DebugRawResponse(request); tbMain.Text = request.Response.Message.ToString(); } } catch (ErrorException ee) { AddDebug("~~EXCEPTION~~"); AddDebug(ee.Message); } }
private void frm_FormClosed(object sender, FormClosedEventArgs e) { try { if (!StartTransaction.OK) { ClearDebug(); AddDebug("CANCELLED!"); return; } APISettings.InitAPI(); ClearDebug(); PAYNLSDK.API.Transaction.Start.Request fixture = LastRequests.LastTransactionStart; InitRequestDebug(fixture); DumpNvc(fixture.GetParameters()); APISettings.Client.PerformRequest(fixture); DebugRawResponse(fixture); tbMain.Text = fixture.Response.ToString(); string url = fixture.Response.Transaction.PaymentURL; System.Diagnostics.Process.Start(url); } catch (ErrorException ee) { AddDebug("~~EXCEPTION~~"); AddDebug(ee.Message); } }
public void dumpTransactionGetLast() { APISettings.InitAPI(); ClearDebug(); PAYNLSDK.API.Transaction.GetLastTransactions.Request request = new PAYNLSDK.API.Transaction.GetLastTransactions.Request(); InitRequestDebug(request); APISettings.Client.PerformRequest(request); DebugRawResponse(request); tbMain.Text = request.Response.ToString(); }
public void dumpPaymentmethods() { APISettings.InitAPI(); ClearDebug(); PAYNLSDK.API.PaymentMethod.GetAll.Request request = new PAYNLSDK.API.PaymentMethod.GetAll.Request(); InitRequestDebug(request); APISettings.Client.PerformRequest(request); DebugRawResponse(request); tbMain.Text = request.Response.ToString(); }
private void InitRequestDebug(RequestBase request) { APISettings.InitAPI(); AddDebug(string.Format("Calling API {0} / {1}", request.Controller, request.Method)); AddDebug(string.Format("Requires TOKEN? {0}", request.RequiresApiToken)); AddDebug(string.Format("Requires SERVICEID? {0}", request.RequiresServiceId)); AddDebug("-----"); AddDebug("Initializing..."); AddDebug(string.Format("URL : {0}", request.Url)); AddDebug(string.Format("PARAMS : {0}", request.ToQueryString())); AddDebug("-----"); }
private void txinfo(string id) { //619204633Xc4027e APISettings.InitAPI(); ClearDebug(); PAYNLSDK.API.Transaction.Info.Request request = new PAYNLSDK.API.Transaction.Info.Request(); request.TransactionId = id; InitRequestDebug(request); APISettings.Client.PerformRequest(request); DebugRawResponse(request); tbMain.Text = request.Response.ToString(); }
private void transActionStartToolStripMenuItem_Click(object sender, EventArgs e) { APISettings.InitAPI(); ClearDebug(); PAYNLSDK.API.Transaction.Start.Request fixture = TransactionStart.GetFixture(); AddDebug("Fixture loaded."); AddDebug("JSON:"); AddDebug(fixture.ToString()); AddDebug("PARAMS:"); AddDebug(fixture.ToQueryString()); AddDebug("-----"); AddDebug("DONE"); }
public void TransactionRefund(string transactionID, string amount, string exchangeUrl) { try { APISettings.InitAPI(); ClearDebug(); int numValue; bool parsed = Int32.TryParse(amount, out numValue); if (!parsed || transactionID == "") { if (!parsed) { AddDebug("foutieve invoer"); AddDebug("amount: only numbers. 3,40 must be filled in as 350"); } AddDebug("foutieve invoer"); AddDebug("transactionID mag niet leeg zijn"); } else if (exchangeUrl != "") { APISettings.InitAPI(); AddDebug("-----"); AddDebug("Working with modified version of call"); PAYNLSDK.API.Transaction.Refund.Response response = Transaction.Refund(transactionID, null, numValue, null, exchangeUrl); tbMain.Text = response.RefundId; } else { PAYNLSDK.API.Transaction.Refund.Request request = new PAYNLSDK.API.Transaction.Refund.Request(); request.Amount = numValue; request.TransactionId = transactionID; InitRequestDebug(request); APISettings.Client.PerformRequest(request); DebugRawResponse(request); tbMain.Text = request.Response.RefundId; } } catch (ErrorException ee) { AddDebug("~~EXCEPTION~~"); AddDebug(ee.Message); } }
private void serviceCategoriesToolStripMenuItem_Click(object sender, EventArgs e) { try { APISettings.InitAPI(); ClearDebug(); PAYNLSDK.API.Service.GetCategories.Request fixture = new PAYNLSDK.API.Service.GetCategories.Request(); InitRequestDebug(fixture); DumpNvc(fixture.GetParameters()); APISettings.Client.PerformRequest(fixture); DebugRawResponse(fixture); tbMain.Text = fixture.Response.ToString(); } catch (ErrorException ee) { AddDebug("~~EXCEPTION~~"); AddDebug(ee.Message); } }
public void TransactionRefundInfo(string refundID) { try { APISettings.InitAPI(); ClearDebug(); PAYNLSDK.API.Refund.Info.Request request = new PAYNLSDK.API.Refund.Info.Request(refundID); InitRequestDebug(request); APISettings.Client.PerformRequest(request); DebugRawResponse(request); tbMain.Text = request.Response.ToString(); } catch (ErrorException ee) { AddDebug("~~EXCEPTION~~"); AddDebug(ee.Message); } }
private void refundTrasactionProductsToolStripMenuItem_Click(object sender, EventArgs e) { APISettings.InitAPI(); ClearDebug(); PAYNLSDK.API.Refund.Transaction.Request fixture = RefundTransaction.GetFixture(); AddDebug("Fixture loaded."); AddDebug("JSON:"); AddDebug(fixture.ToString()); AddDebug("PARAMS:"); string qs = fixture.ToQueryString(); AddDebug(qs); NameValueCollection nvc = HttpUtility.ParseQueryString(qs); string json = JsonConvert.SerializeObject(NvcToDictionary(nvc, true)); AddDebug("-----"); //AddDebug("PARAMS AS JSON"); //AddDebug(json); DumpNvc(nvc); AddDebug("-----"); AddDebug("DONE"); }
private void startuseFixtureToolStripMenuItem_Click(object sender, EventArgs e) { try { APISettings.InitAPI(); ClearDebug(); PAYNLSDK.API.Transaction.Start.Request fixture = TransactionStart.GetFixtureNoProductLines(); InitRequestDebug(fixture); DumpNvc(fixture.GetParameters()); APISettings.Client.PerformRequest(fixture); DebugRawResponse(fixture); tbMain.Text = fixture.Response.ToString(); string url = fixture.Response.Transaction.PaymentURL; System.Diagnostics.Process.Start(url); } catch (ErrorException ee) { AddDebug("~~EXCEPTION~~"); AddDebug(ee.Message); } }