public static void Main() { string accountID = "MERCHANT'S ACCOUNT ID HERE"; string secretKey = "MERCHANT'S SECRET KEY HERE"; string mode = "TEST"; // Merchant's Account ID // Merchant's Secret Key // Transaction Mode: TEST (can also be LIVE) BluePayPayment_BP10Emu stq = new BluePayPayment_BP10Emu( accountID, secretKey, mode); // Search Date Start: Jan. 1, 2013 // Search Date End: Jan 15, 2013 // Do not include errored transactions in search? Yes stq.getSingleTransQuery( "2013-01-01", "2013-01-15", "1"); stq.queryByTransactionID("ENTER A TRANSACTION ID HERE"); stq.Process(); // Outputs response from BluePay gateway Console.Write(stq.response); }
public static void Main() { string accountID = "MERCHANT'S ACCOUNT ID HERE"; string secretKey = "MERCHANT'S SECRET KEY HERE"; string mode = "TEST"; // Merchant's Account ID // Merchant's Secret Key // Transaction Mode: TEST (can also be LIVE) BluePayPayment_BP10Emu report = new BluePayPayment_BP10Emu( accountID, secretKey, mode); // Report Start Date: Jan. 1, 2013 // Report End Date: Jan. 15, 2013 // Also search subaccounts? Yes // Output response without commas? Yes // Do not include errored transactions? Yes report.getTransactionSettledReport( "2013-01-01", "2013-01-15", "1", "1", "1"); report.Process(); // Outputs response from BluePay gateway Console.Write(report.response); }
public static void Main() { string accountID = "MERCHANT'S ACCOUNT ID HERE"; string secretKey = "MERCHANT'S SECRET KEY HERE"; string mode = "TEST"; // Merchant's Account ID // Merchant's Secret Key // Transaction Mode: TEST (can also be LIVE) BluePayPayment_BP10Emu payment = new BluePayPayment_BP10Emu( accountID, secretKey, mode); // Card Number: 4111111111111111 // Card Expire: 12/15 // Card CVV2: 123 payment.setCCInformation( "4111111111111111", "1215", "123"); // First Name: Bob // Last Name: Tester // Address1: 123 Test St. // Address2: Apt #500 // City: Testville // State: IL // Zip: 54321 // Country: USA payment.setCustomerInformation( "Bob", "Tester", "123 Test St.", "Apt #500", "Testville", "IL", "54321", "USA"); // Phone #: 123-123-1234 payment.setPhone("1231231234"); // Email Address: [email protected] payment.setEmail("*****@*****.**"); // Sale Amount: $3.00 payment.sale("3.00"); payment.Process(); string result = payment.Process(); // If transaction was approved.. if (result == "APPROVED") { BluePayPayment_BP10Emu paymentCancel = new BluePayPayment_BP10Emu( accountID, secretKey, mode); // Voids above transaction paymentCancel.voidTransaction(payment.getTransID()); paymentCancel.Process(); // Outputs response from BluePay gateway Console.Write("Transaction ID: " + paymentCancel.getTransID() + Environment.NewLine); Console.Write("Message: " + paymentCancel.getMessage() + Environment.NewLine); Console.Write("Status: " + paymentCancel.getStatus() + Environment.NewLine); Console.Write("AVS Result: " + paymentCancel.getAVS() + Environment.NewLine); Console.Write("CVV2 Result: " + paymentCancel.getCVV2() + Environment.NewLine); Console.Write("Masked Payment Account: " + paymentCancel.getMaskedPaymentAccount() + Environment.NewLine); Console.Write("Card Type: " + paymentCancel.getCardType() + Environment.NewLine); Console.Write("Authorization Code: " + paymentCancel.getAuthCode() + Environment.NewLine); } else { Console.Write(payment.getMessage()); } }
public static void Main() { string accountID = "MERCHANT'S ACCOUNT ID HERE"; string secretKey = "MERCHANT'S SECRET KEY HERE"; string mode = "TEST"; // Merchant's Account ID // Merchant's Secret Key // Transaction Mode: TEST (can also be LIVE) BluePayPayment_BP10Emu payment = new BluePayPayment_BP10Emu( accountID, secretKey, mode); // Card Number: 4111111111111111 // Card Expire: 12/15 // Card CVV2: 123 payment.setCCInformation( "4111111111111111", "1215", "123"); // First Name: Bob // Last Name: Tester // Address1: 123 Test St. // Address2: Apt #500 // City: Testville // State: IL // Zip: 54321 // Country: USA payment.setCustomerInformation( "Bob", "Tester", "123 Test St.", "Apt #500", "Testville", "IL", "54321", "USA"); // Rebill Amount: $3.50 // Rebill Start Date: Jan. 5, 2015 // Rebill Frequency: 1 MONTH // Rebill # of Cycles: 5 payment.setRebillingInformation( "3.50", "2015-01-05", "1 MONTH", "5"); // Phone #: 123-123-1234 payment.setPhone("1231231234"); // Email Address: [email protected] payment.setEmail("*****@*****.**"); // Auth Amount: $0.00 payment.auth("0.00"); string result = payment.Process(); // If transaction was approved.. if (result == "APPROVED") { BluePayPayment_BP10Emu updatePaymentInformation = new BluePayPayment_BP10Emu( accountID, secretKey, mode); // Creates a new transaction that reflects a customer's updated card expiration date // Card Number: 4111111111111111 // Card Expire: 01/21 updatePaymentInformation.setCCInformation( "4111111111111111", "0121"); updatePaymentInformation.auth("0.00", payment.getTransID()); updatePaymentInformation.Process(); BluePayPayment_BP10Emu rebillUpdate = new BluePayPayment_BP10Emu( accountID, secretKey, mode); // Cancels rebill using Rebill ID token returned // Rebill Start Date: March 1, 2015 // Rebill Frequency: 1 MONTH // Rebill # of Cycles: 8 // Rebill Amount: $5.15 // Rebill Next Amount: $1.50 rebillUpdate.updateRebillingInformation( payment.getRebillID(), "2015-03-01", "1 MONTH", "8", "5.15", "1.50"); rebillUpdate.updateRebillPaymentInformation(updatePaymentInformation.getTransID()); rebillUpdate.Process(); // Outputs response from BluePay gateway Console.Write("Rebill ID: " + rebillUpdate.getRebillID() + Environment.NewLine); Console.Write("Rebill Status: " + rebillUpdate.getStatus() + Environment.NewLine); Console.Write("Rebill Creation Date: " + rebillUpdate.getCreationDate() + Environment.NewLine); Console.Write("Rebill Next Date: " + rebillUpdate.getNextDate() + Environment.NewLine); Console.Write("Rebill Last Date: " + rebillUpdate.getLastDate() + Environment.NewLine); Console.Write("Rebill Schedule Expression: " + rebillUpdate.getSchedExpr() + Environment.NewLine); Console.Write("Rebill Cycles Remaining: " + rebillUpdate.getCyclesRemain() + Environment.NewLine); Console.Write("Rebill Amount: " + rebillUpdate.getRebillAmount() + Environment.NewLine); Console.Write("Rebill Next Amount: " + rebillUpdate.getNextAmount() + Environment.NewLine); } else { Console.Write(payment.getMessage()); } }
public static void Main() { string accountID = "MERCHANT'S ACCOUNT ID HERE"; string secretKey = "MERCHANT'S SECRET KEY HERE"; string mode = "TEST"; // Merchant's Account ID // Merchant's Secret Key // Transaction Mode: TEST (can also be LIVE) BluePayPayment_BP10Emu payment = new BluePayPayment_BP10Emu( accountID, secretKey, mode); // Routing Number: 071923307 // Account Number: 0523421 // Account Type: Checking // ACH Document Type: WEB payment.setACHInformation( "071923307", "0523421", "C", "WEB"); // First Name: Bob // Last Name: Tester // Address1: 123 Test St. // Address2: Apt #500 // City: Testville // State: IL // Zip: 54321 // Country: USA payment.setCustomerInformation( "Bob", "Tester", "123 Test St.", "Apt #500", "Testville", "IL", "54321", "USA"); // Phone #: 123-123-1234 payment.setPhone("1231231234"); // Email Address: [email protected] payment.setEmail("*****@*****.**"); // Sale Amount: $3.00 payment.sale("3.00"); payment.Process(); // Outputs response from BluePay gateway Console.Write("Transaction ID: " + payment.getTransID() + Environment.NewLine); Console.Write("Message: " + payment.getMessage() + Environment.NewLine); Console.Write("Status: " + payment.getStatus() + Environment.NewLine); Console.Write("AVS Result: " + payment.getAVS() + Environment.NewLine); Console.Write("CVV2 Result: " + payment.getCVV2() + Environment.NewLine); Console.Write("Masked Payment Account: " + payment.getMaskedPaymentAccount() + Environment.NewLine); Console.Write("Bank Name: " + payment.getBank() + Environment.NewLine); Console.Write("Authorization Code: " + payment.getAuthCode() + Environment.NewLine); }
public static void Main() { HttpListener listener = new HttpListener(); string secretKey = ""; string response = ""; try { // Listen for incoming data listener.Start(); } catch (HttpListenerException) { return; } while (listener.IsListening) { var context = listener.GetContext(); var body = new StreamReader(context.Request.InputStream).ReadToEnd(); byte[] b = Encoding.UTF8.GetBytes("ACK"); // Return HTTP Status of 200 to BluePay context.Response.StatusCode = 200; context.Response.KeepAlive = false; context.Response.ContentLength64 = b.Length; var output = context.Response.OutputStream; output.Write(b, 0, b.Length); // Get Reponse using (StreamReader reader = new StreamReader(output)) { response = reader.ReadToEnd(); } context.Response.Close(); } listener.Close(); NameValueCollection vals = HttpUtility.ParseQueryString(response); // Parse data into a NVP collection string transID = vals["trans_id"]; string transStatus = vals["trans_stats"]; string transType = vals["trans_type"]; string amount = vals["amount"]; string batchID = vals["batch_id"]; string batchStatus = vals["batch_status"]; string totalCount = vals["total_count"]; string totalAmount = vals["total_amount"]; string batchUploadID = vals["batch_upload_id"]; string rebillID = vals["rebill_id"]; string rebillAmount = vals["rebill_amount"]; string rebillStatus = vals["rebill_status"]; // calculate the expected BP_STAMP string bpStamp = BluePayPayment_BP10Emu.calcTransNotifyTPS(secretKey, vals["trans_id"], vals["trans_stats"], vals["trans_type"], vals["amount"], vals["batch_id"], vals["batch_status"], vals["total_count"], vals["total_amount"], vals["batch_upload_id"], vals["rebill_id"], vals["rebill_amount"], vals["rebill_status"]); // Output data if the expected BP_STAMP matches the actual BP_STAMP if (bpStamp == vals["BP_STAMP"]) { Console.Write("Transaction ID: " + transID); Console.Write("Transaction Status: " + transStatus); Console.Write("Transaction Type: " + transType); Console.Write("Transaction Amount: " + amount); Console.Write("Rebill ID: " + rebillID); Console.Write("Rebill Amount: " + rebillAmount); Console.Write("Rebill Status: " + rebillStatus); } else { Console.Write("ERROR IN RECEIVING DATA FROM BLUEPAY"); } }
public static void Main() { string accountID = "MERCHANT'S ACCOUNT ID HERE"; string secretKey = "MERCHANT'S SECRET KEY HERE"; string mode = "TEST"; // Merchant's Account ID // Merchant's Secret Key // Transaction Mode: TEST (can also be LIVE) BluePayPayment_BP10Emu payment = new BluePayPayment_BP10Emu( accountID, secretKey, mode); // Card Number: 4111111111111111 // Card Expire: 12/15 // Card CVV2: 123 payment.setCCInformation( "4111111111111111", "1215", "123"); // First Name: Bob // Last Name: Tester // Address1: 123 Test St. // Address2: Apt #500 // City: Testville // State: IL // Zip: 54321 // Country: USA payment.setCustomerInformation( "Bob", "Tester", "123 Test St.", "Apt #500", "Testville", "IL", "54321", "USA"); // Phone #: 123-123-1234 payment.setPhone("1231231234"); // Email Address: [email protected] payment.setEmail("*****@*****.**"); // Custom ID1: 12345 payment.setCustomID1("12345"); // Custom ID2: 09866 payment.setCustomID2("09866"); // Invoice ID: 50000 payment.setInvoiceID("500000"); // Order ID: 10023145 payment.setOrderID("10023145"); // Tip Amount: $6.00 payment.setAmountTip("6.00"); // Tax Amount: $3.50 payment.setAmountTax("3.50"); // Food Amount: $3.11 payment.setAmountFood("3.11"); // Miscellaneous Amount: $5.00 payment.setAmountMisc("5.00"); // Sale Amount: $15.00 payment.sale("15.00"); payment.Process(); // Outputs response from BluePay gateway Console.Write("Transaction ID: " + payment.getTransID() + Environment.NewLine); Console.Write("Message: " + payment.getMessage() + Environment.NewLine); Console.Write("Status: " + payment.getStatus() + Environment.NewLine); Console.Write("AVS Result: " + payment.getAVS() + Environment.NewLine); Console.Write("CVV2 Result: " + payment.getCVV2() + Environment.NewLine); Console.Write("Masked Payment Account: " + payment.getMaskedPaymentAccount() + Environment.NewLine); Console.Write("Card Type: " + payment.getCardType() + Environment.NewLine); Console.Write("Authorization Code: " + payment.getAuthCode() + Environment.NewLine); }
public static void Main() { string accountID = "MERCHANT'S ACCOUNT ID HERE"; string secretKey = "MERCHANT'S SECRET KEY HERE"; string mode = "TEST"; // Merchant's Account ID // Merchant's Secret Key // Transaction Mode: TEST (can also be LIVE) BluePayPayment_BP10Emu payment = new BluePayPayment_BP10Emu( accountID, secretKey, mode); // Card Number: 4111111111111111 // Card Expire: 12/15 // Card CVV2: 123 payment.setCCInformation( "4111111111111111", "1215", "123"); // First Name: Bob // Last Name: Tester // Address1: 123 Test St. // Address2: Apt #500 // City: Testville // State: IL // Zip: 54321 // Country: USA payment.setCustomerInformation( "Bob", "Tester", "123 Test St.", "Apt #500", "Testville", "IL", "54321", "USA"); // Rebill Amount: $3.50 // Rebill Start Date: Jan. 5, 2015 // Rebill Frequency: 1 MONTH // Rebill # of Cycles: 5 payment.setRebillingInformation( "3.50", "2015-01-05", "1 MONTH", "5"); // Phone #: 123-123-1234 payment.setPhone("1231231234"); // Email Address: [email protected] payment.setEmail("*****@*****.**"); // Sale Amount: $3.00 payment.sale("3.00"); payment.Process(); // Outputs response from BluePay gateway Console.Write("Transaction ID: " + payment.getTransID() + Environment.NewLine); Console.Write("Rebill ID: " + payment.getRebillID() + Environment.NewLine); Console.Write("Message: " + payment.getMessage() + Environment.NewLine); Console.Write("Status: " + payment.getStatus() + Environment.NewLine); Console.Write("AVS Result: " + payment.getAVS() + Environment.NewLine); Console.Write("CVV2 Result: " + payment.getCVV2() + Environment.NewLine); Console.Write("Masked Payment Account: " + payment.getMaskedPaymentAccount() + Environment.NewLine); Console.Write("Card Type: " + payment.getCardType() + Environment.NewLine); Console.Write("Authorization Code: " + payment.getAuthCode() + Environment.NewLine); }