-
Notifications
You must be signed in to change notification settings - Fork 31
/
Copy pathCheck_Customer_Credit.cs
executable file
·75 lines (67 loc) · 2.47 KB
/
Check_Customer_Credit.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
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
/*
* BluePay C#.NET Sample code.
*
* This code sample runs a $3.00 Credit Card Authorization transaction
* against a customer using test payment information.
* If using TEST mode, odd dollar amounts will return
* an approval and even dollar amounts will return a decline.
*/
using System;
using BluePayLibrary;
namespace Transactions
{
public class CheckCustomerCredit
{
public static void Main()
{
string accountID = "Merchant's Account ID Here";
string secretKey = "Merchant's Secret Key Here";
string mode = "TEST";
BluePay payment = new BluePay
(
accountID,
secretKey,
mode
);
payment.SetCustomerInformation
(
firstName: "Bob",
lastName: "Tester",
address1: "1234 Test St.",
address2: "Apt #500",
city: "Testville",
state: "IL",
zip: "54321",
country: "USA",
phone: "123-123-12345",
email: "test@bluepay.com"
);
payment.SetCCInformation
(
ccNumber: "4111111111111111",
ccExpiration: "1225",
cvv2: "123"
);
// Auth Amount: $3.00
payment.Auth(amount: "3.00");
// Makes the API Request with BluePay
payment.Process();
// If transaction was successful reads the responses from BluePay
if (payment.IsSuccessfulTransaction())
{
Console.WriteLine("Transaction Status: " + payment.GetStatus());
Console.WriteLine("Transaction ID: " + payment.GetTransID());
Console.WriteLine("Transaction Message: " + payment.GetMessage());
Console.WriteLine("AVS Response: " + payment.GetAVS());
Console.WriteLine("CVV2 Response: " + payment.GetCVV2());
Console.WriteLine("Masked Payment Account: " + payment.GetMaskedPaymentAccount());
Console.WriteLine("Card Type: " + payment.GetCardType());
Console.WriteLine("Authorization Code: " + payment.GetAuthCode());
}
else
{
Console.WriteLine("Error: " + payment.GetMessage());
}
}
}
}