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); // 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("*****@*****.**"); // Auth Amount: $3.00 payment.auth("3.00"); payment.Process(); string result = payment.Process(); // If transaction was approved.. if (result == "APPROVED") { BluePayPayment_BP10Emu paymentCapture = new BluePayPayment_BP10Emu( accountID, secretKey, mode); // Refunds paymentCapture.capture(payment.getTransID()); paymentCapture.Process(); // Outputs response from BluePay gateway Console.Write("Transaction ID: " + paymentCapture.getTransID() + Environment.NewLine); Console.Write("Message: " + paymentCapture.getMessage() + Environment.NewLine); Console.Write("Status: " + paymentCapture.getStatus() + Environment.NewLine); Console.Write("AVS Result: " + paymentCapture.getAVS() + Environment.NewLine); Console.Write("CVV2 Result: " + paymentCapture.getCVV2() + Environment.NewLine); Console.Write("Masked Payment Account: " + paymentCapture.getMaskedPaymentAccount() + Environment.NewLine); Console.Write("Card Type: " + paymentCapture.getCardType() + Environment.NewLine); Console.Write("Authorization Code: " + paymentCapture.getAuthCode() + Environment.NewLine); } else { Console.Write(payment.getMessage()); } }