bluepay 1.0.1 → 1.0.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (72) hide show
  1. checksums.yaml +7 -0
  2. data/README +47 -15
  3. data/Rakefile +11 -63
  4. data/bluepay.gemspec +13 -0
  5. data/doc/BluePay.html +2699 -0
  6. data/doc/README.html +173 -0
  7. data/doc/created.rid +3 -0
  8. data/doc/fonts.css +167 -0
  9. data/doc/fonts/Lato-Light.ttf +0 -0
  10. data/doc/fonts/Lato-LightItalic.ttf +0 -0
  11. data/doc/fonts/Lato-Regular.ttf +0 -0
  12. data/doc/fonts/Lato-RegularItalic.ttf +0 -0
  13. data/doc/fonts/SourceCodePro-Bold.ttf +0 -0
  14. data/doc/fonts/SourceCodePro-Regular.ttf +0 -0
  15. data/doc/images/add.png +0 -0
  16. data/doc/images/arrow_up.png +0 -0
  17. data/doc/images/brick.png +0 -0
  18. data/doc/images/brick_link.png +0 -0
  19. data/doc/images/bug.png +0 -0
  20. data/doc/images/bullet_black.png +0 -0
  21. data/doc/images/bullet_toggle_minus.png +0 -0
  22. data/doc/images/bullet_toggle_plus.png +0 -0
  23. data/doc/images/date.png +0 -0
  24. data/doc/images/delete.png +0 -0
  25. data/doc/images/find.png +0 -0
  26. data/doc/images/loadingAnimation.gif +0 -0
  27. data/doc/images/macFFBgHack.png +0 -0
  28. data/doc/images/package.png +0 -0
  29. data/doc/images/page_green.png +0 -0
  30. data/doc/images/page_white_text.png +0 -0
  31. data/doc/images/page_white_width.png +0 -0
  32. data/doc/images/plugin.png +0 -0
  33. data/doc/images/ruby.png +0 -0
  34. data/doc/images/tag_blue.png +0 -0
  35. data/doc/images/tag_green.png +0 -0
  36. data/doc/images/transparent.png +0 -0
  37. data/doc/images/wrench.png +0 -0
  38. data/doc/images/wrench_orange.png +0 -0
  39. data/doc/images/zoom.png +0 -0
  40. data/doc/index.html +92 -0
  41. data/doc/js/darkfish.js +140 -0
  42. data/doc/js/jquery.js +18 -0
  43. data/doc/js/navigation.js +142 -0
  44. data/doc/js/search.js +109 -0
  45. data/doc/js/search_index.js +1 -0
  46. data/doc/js/searcher.js +228 -0
  47. data/doc/rdoc.css +580 -0
  48. data/doc/table_of_contents.html +405 -0
  49. data/lib/bluepay.rb +488 -0
  50. data/test/get_data/retrieve_settlement_data.rb +39 -0
  51. data/test/get_data/retrieve_transaction_data.rb +37 -0
  52. data/test/get_data/transaction_query.rb +48 -0
  53. data/test/getting_stuff_done/get_transaction_data.rb +37 -0
  54. data/test/getting_stuff_done/run_ach_payment.rb +75 -0
  55. data/test/getting_stuff_done/run_cc_payment.rb +73 -0
  56. data/test/getting_stuff_done/set_up_rebill_ach.rb +85 -0
  57. data/test/getting_stuff_done/set_up_rebill_cc.rb +84 -0
  58. data/test/rebills/cancel_rebill.rb +96 -0
  59. data/test/rebills/create_rebill.rb +84 -0
  60. data/test/rebills/get_rebill.rb +97 -0
  61. data/test/rebills/update_rebill.rb +128 -0
  62. data/test/transactions/cancel_transaction.rb +85 -0
  63. data/test/transactions/charge_customer.rb +74 -0
  64. data/test/transactions/check_customer_credit.rb +74 -0
  65. data/test/transactions/credit_customer.rb +75 -0
  66. data/test/transactions/customer_defined_data.rb +99 -0
  67. data/test/transactions/return_funds.rb +86 -0
  68. data/test/transactions/store_payment_information.rb +74 -0
  69. data/test/transactions/use_token.rb +44 -0
  70. metadata +106 -35
  71. data/lib/Bluepay.rb +0 -206
  72. data/test/bp20post_test.rb +0 -12
@@ -0,0 +1,39 @@
1
+ ##
2
+ # BluePay Ruby Sample code.
3
+ #
4
+ # This code sample runs a report that grabs data from the
5
+ # BluePay gateway based on certain criteria. This will ONLY return
6
+ # transactions that have already settled. See comments below
7
+ # on the details of the report.
8
+ # If using TEST mode, only TEST transactions will be returned.
9
+ ##
10
+
11
+ require "bluepay"
12
+
13
+ $ACCOUNT_ID = "MERCHANT'S ACCOUNT ID HERE"
14
+ $SECRET_KEY = "MERCHANT'S SECRET KEY HERE"
15
+ $MODE = "TEST"
16
+
17
+ # Merchant's Account ID
18
+ # Merchant's Secret Key
19
+ # Transaction Mode: TEST (can also be LIVE)
20
+ report = BluePay.new(
21
+ $ACCOUNT_ID,
22
+ $SECRET_KEY,
23
+ $MODE)
24
+
25
+ # Report Start Date: Jan. 1, 2013
26
+ # Report End Date: Jan. 15, 2013
27
+ # Also search subaccounts? Yes
28
+ # Output response without commas? Yes
29
+ # Do not include errored transactions? Yes
30
+ report.get_settled_transaction_report(
31
+ '2013-01-01',
32
+ '2013-01-15',
33
+ '1',
34
+ '1',
35
+ '1')
36
+ report.process()
37
+
38
+ # Read response from BluePay
39
+ puts report.get_response()
@@ -0,0 +1,37 @@
1
+ ##
2
+ # BluePay Ruby Sample code.
3
+ #
4
+ # This code sample runs a report that grabs data from the
5
+ # BluePay gateway based on certain criteria.
6
+ # If using TEST mode, only TEST transactions will be returned.
7
+ ##
8
+
9
+ require "bluepay"
10
+
11
+ $ACCOUNT_ID = "MERCHANT'S ACCOUNT ID HERE"
12
+ $SECRET_KEY = "MERCHANT'S SECRET KEY HERE"
13
+ $MODE = "TEST"
14
+
15
+ # Merchant's Account ID
16
+ # Merchant's Secret Key
17
+ # Transaction Mode: TEST (can also be LIVE)
18
+ report = BluePay.new(
19
+ $ACCOUNT_ID,
20
+ $SECRET_KEY,
21
+ $MODE)
22
+
23
+ # Report Start Date: Jan. 1, 2013
24
+ # Report End Date: Jan. 15, 2013
25
+ # Also search subaccounts? Yes
26
+ # Output response without commas? Yes
27
+ # Do not include errored transactions? Yes
28
+ report.get_transaction_report(
29
+ '2013-01-01',
30
+ '2013-01-15',
31
+ '1',
32
+ '1',
33
+ '1')
34
+ report.process()
35
+
36
+ # Read response from BluePay
37
+ puts report.get_response()
@@ -0,0 +1,48 @@
1
+ ##
2
+ # BluePay Ruby Sample code.
3
+ #
4
+ # This code sample runs a report that grabs a single transaction
5
+ # from the BluePay gateway based on certain criteria.
6
+ # See comments below on the details of the report.
7
+ # If using TEST mode, only TEST transactions will be returned.
8
+ ##
9
+
10
+ require "bluepay"
11
+
12
+ $ACCOUNT_ID = "MERCHANT'S ACCOUNT ID HERE"
13
+ $SECRET_KEY = "MERCHANT'S SECRET KEY HERE"
14
+ $MODE = "TEST"
15
+ $TRANSACTION_ID = "ENTER A TRANSACTION ID HERE"
16
+
17
+ # Merchant's Account ID
18
+ # Merchant's Secret Key
19
+ # Transaction Mode: TEST (can also be LIVE)
20
+ query = BluePay.new(
21
+ $ACCOUNT_ID,
22
+ $SECRET_KEY,
23
+ $MODE)
24
+
25
+ # Query Start Date: Jan. 1, 2013
26
+ # Query End Date: Jan. 15, 2013
27
+ # Do not include errored transactions? Yes
28
+ query.get_single_trans_query(
29
+ '2013-01-01',
30
+ '2013-01-15',
31
+ '1')
32
+
33
+ # Query by a specific Transaction ID
34
+ query.query_by_transaction_id($TRANSACTION_ID)
35
+
36
+ response = query.process()
37
+
38
+ if (query.get_id()) then
39
+ # Read response from BluePay
40
+ puts 'Transaction ID: ' + query.get_id()
41
+ puts 'First Name: ' + query.get_name1()
42
+ puts 'Last Name: ' + query.get_name2()
43
+ puts 'Payment Type: ' + query.get_payment_type()
44
+ puts 'Transaction Type: ' + query.get_trans_type()
45
+ puts 'Amount: ' + query.get_amount()
46
+ else
47
+ puts response
48
+ end
@@ -0,0 +1,37 @@
1
+ ##
2
+ # BluePay Ruby Sample code.
3
+ #
4
+ # This code sample runs a report that grabs data from the
5
+ # BluePay gateway based on certain criteria.
6
+ # If using TEST mode, only TEST transactions will be returned.
7
+ ##
8
+
9
+ require "bluepay"
10
+
11
+ $ACCOUNT_ID = "MERCHANT'S ACCOUNT ID HERE"
12
+ $SECRET_KEY = "MERCHANT'S SECRET KEY HERE"
13
+ $MODE = "TEST"
14
+
15
+ # Merchant's Account ID
16
+ # Merchant's Secret Key
17
+ # Transaction Mode: TEST (can also be LIVE)
18
+ report = BluePay.new(
19
+ $ACCOUNT_ID,
20
+ $SECRET_KEY,
21
+ $MODE)
22
+
23
+ # Report Start Date: Jan. 1, 2013
24
+ # Report End Date: Jan. 15, 2013
25
+ # Also search subaccounts? Yes
26
+ # Output response without commas? Yes
27
+ # Do not include errored transactions? Yes
28
+ report.get_transaction_report(
29
+ '2013-01-01',
30
+ '2013-01-15',
31
+ '1',
32
+ '1',
33
+ '1')
34
+ report.process()
35
+
36
+ # Read response from BluePay
37
+ puts report.get_response()
@@ -0,0 +1,75 @@
1
+ ##
2
+ # BluePay Ruby Sample code.
3
+ #
4
+ # This code sample runs a $3.00 ACH Sale transaction
5
+ # against a customer using test payment information.
6
+
7
+ ##
8
+
9
+ require "test/unit"
10
+ require "bluepay"
11
+
12
+ $ACCOUNT_ID = "MERCHANT'S ACCOUNT ID HERE"
13
+ $SECRET_KEY = "MERCHANT'S SECRET KEY HERE"
14
+ $MODE = "TEST"
15
+
16
+ # Merchant's Account ID
17
+ # Merchant's Secret Key
18
+ # Transaction Mode: TEST (can also be LIVE)
19
+ payment = BluePay.new(
20
+ $ACCOUNT_ID,
21
+ $SECRET_KEY,
22
+ $MODE)
23
+
24
+ # Routing Number: 123123123
25
+ # Account Number: 123456789
26
+ # Account Type: Checking
27
+ # ACH Document Type: WEB
28
+ payment.set_ach_information(
29
+ "123123123",
30
+ "123456789",
31
+ 'C',
32
+ "WEB")
33
+
34
+ # First Name: Bob
35
+ # Last Name: Tester
36
+ # Address1: 123 Test St.
37
+ # Address2: Apt #500
38
+ # City: Testville
39
+ # State: IL
40
+ # Zip: 54321
41
+ # Country: USA
42
+ payment.set_customer_information(
43
+ "Bob",
44
+ "Tester",
45
+ "123 Test St.",
46
+ "Testville",
47
+ "IL",
48
+ "54321",
49
+ "Apt #500",
50
+ "USA")
51
+
52
+ # Phone #: 123-123-1234
53
+ payment.set_phone("1231231234")
54
+
55
+ # Email Address: test@bluepay.com
56
+ payment.set_email("test@bluepay.com")
57
+
58
+ # Sale Amount: $3.00
59
+ payment.sale("3.00")
60
+
61
+ response = payment.process()
62
+
63
+ if (payment.get_status() == "APPROVED") then
64
+ # Read response from BluePay
65
+ puts "TRANSACTION STATUS: " + payment.get_status()
66
+ puts "TRANSACTION MESSAGE: " + payment.get_message()
67
+ puts "TRANSACTION ID: " + payment.get_trans_id()
68
+ puts "AVS RESPONSE: " + payment.get_avs_code()
69
+ puts "CVV2 RESPONSE: " + payment.get_cvv2_code()
70
+ puts "MASKED PAYMENT ACCOUNT: " + payment.get_masked_account()
71
+ puts "CUSTOMER BANK NAME: " + payment.get_bank_name()
72
+ puts "AUTH CODE: " + payment.get_auth_code()
73
+ else
74
+ puts payment.get_message()
75
+ end
@@ -0,0 +1,73 @@
1
+ ##
2
+ # BluePay Ruby Sample code.
3
+ #
4
+ # This code sample runs a $3.00 Credit Card Sale transaction
5
+ # against a customer using test payment information.
6
+ # If using TEST mode, odd dollar amounts will return
7
+ # an approval and even dollar amounts will return a decline.
8
+ ##
9
+
10
+ require "bluepay"
11
+
12
+ $ACCOUNT_ID = "MERCHANT'S ACCOUNT ID HERE"
13
+ $SECRET_KEY = "MERCHANT'S SECRET KEY HERE"
14
+ $MODE = "TEST"
15
+
16
+ # Merchant's Account ID
17
+ # Merchant's Secret Key
18
+ # Transaction Mode: TEST (can also be LIVE)
19
+ payment = BluePay.new(
20
+ $ACCOUNT_ID,
21
+ $SECRET_KEY,
22
+ $MODE)
23
+
24
+ # Card Number: 4111111111111111
25
+ # Card Expire: 12/15
26
+ # Card CVV2: 123
27
+ payment.set_cc_information(
28
+ "4111111111111111",
29
+ "1215",
30
+ "123")
31
+
32
+ # First Name: Bob
33
+ # Last Name: Tester
34
+ # Address1: 123 Test St.
35
+ # Address2: Apt #500
36
+ # City: Testville
37
+ # State: IL
38
+ # Zip: 54321
39
+ # Country: USA
40
+ payment.set_customer_information(
41
+ "Bob",
42
+ "Tester",
43
+ "123 Test St.",
44
+ "Testville",
45
+ "IL",
46
+ "54321",
47
+ "Apt #500",
48
+ "USA")
49
+
50
+ # Phone #: 123-123-1234
51
+ payment.set_phone("1231231234")
52
+
53
+ # Email Address: test@bluepay.com
54
+ payment.set_email("test@bluepay.com")
55
+
56
+ # Sale Amount: $3.00
57
+ payment.sale("3.00")
58
+
59
+ response = payment.process()
60
+
61
+ if (payment.get_status() == "APPROVED") then
62
+ # Read response from BluePay
63
+ puts "TRANSACTION STATUS: " + payment.get_status()
64
+ puts "TRANSACTION MESSAGE: " + payment.get_message()
65
+ puts "TRANSACTION ID: " + payment.get_trans_id()
66
+ puts "AVS RESPONSE: " + payment.get_avs_code()
67
+ puts "CVV2 RESPONSE: " + payment.get_cvv2_code()
68
+ puts "MASKED PAYMENT ACCOUNT: " + payment.get_masked_account()
69
+ puts "CARD TYPE: " + payment.get_card_type()
70
+ puts "AUTH CODE: " + payment.get_auth_code()
71
+ else
72
+ puts payment.get_message()
73
+ end
@@ -0,0 +1,85 @@
1
+ ##
2
+ # BluePay Ruby Sample code.
3
+ #
4
+ # This code sample runs a $3.00 ACH Sale transaction
5
+ # against a customer using test payment information. See comments below
6
+ # on the details of the initial setup of the rebilling cycle.
7
+ ##
8
+
9
+ require "bluepay"
10
+
11
+ $ACCOUNT_ID = "MERCHANT'S ACCOUNT ID HERE"
12
+ $SECRET_KEY = "MERCHANT'S SECRET KEY HERE"
13
+ $MODE = "TEST"
14
+
15
+ # Merchant's Account ID
16
+ # Merchant's Secret Key
17
+ # Transaction Mode: TEST (can also be LIVE)
18
+ payment = BluePay.new(
19
+ $ACCOUNT_ID,
20
+ $SECRET_KEY,
21
+ $MODE)
22
+
23
+ # Routing Number: 123123123
24
+ # Account Number: 123456789
25
+ # Account Type: Checking
26
+ # ACH Document Type: WEB
27
+ payment.set_ach_information(
28
+ "123123123",
29
+ "123456789",
30
+ 'C',
31
+ "WEB")
32
+
33
+ # First Name: Bob
34
+ # Last Name: Tester
35
+ # Address1: 123 Test St.
36
+ # Address2: Apt #500
37
+ # City: Testville
38
+ # State: IL
39
+ # Zip: 54321
40
+ # Country: USA
41
+ payment.set_customer_information(
42
+ "Bob",
43
+ "Tester",
44
+ "123 Test St.",
45
+ "Testville",
46
+ "IL",
47
+ "54321",
48
+ "Apt #500",
49
+ "USA")
50
+
51
+ # Rebill Start Date: Jan. 5, 2015
52
+ # Rebill Frequency: 1 MONTH
53
+ # Rebill # of Cycles: 5
54
+ # Rebill Amount: $3.50
55
+ payment.add_recurring_fields(
56
+ "2015-01-05",
57
+ "1 MONTH",
58
+ "5",
59
+ "3.50")
60
+
61
+ # Phone #: 123-123-1234
62
+ payment.set_phone("1231231234")
63
+
64
+ # Email Address: test@bluepay.com
65
+ payment.set_email("test@bluepay.com")
66
+
67
+ # Sale Amount: $3.00
68
+ payment.sale("3.00")
69
+
70
+ response = payment.process()
71
+
72
+ if (payment.get_status() == "APPROVED") then
73
+ # Read response from BluePay
74
+ puts "TRANSACTION STATUS: " + payment.get_status()
75
+ puts "TRANSACTION MESSAGE: " + payment.get_message()
76
+ puts "TRANSACTION ID: " + payment.get_trans_id()
77
+ puts "REBILL ID: " + payment.get_rebill_id()
78
+ puts "AVS RESPONSE: " + payment.get_avs_code()
79
+ puts "CVV2 RESPONSE: " + payment.get_cvv2_code()
80
+ puts "MASKED PAYMENT ACCOUNT: " + payment.get_masked_account()
81
+ puts "CUSTOMER BANK NAME: " + payment.get_bank_name()
82
+ puts "AUTH CODE: " + payment.get_auth_code()
83
+ else
84
+ puts payment.get_message()
85
+ end
@@ -0,0 +1,84 @@
1
+ #
2
+ # BluePay Ruby Sample code.
3
+ #
4
+ # This code sample runs a $3.00 Credit Card Sale transaction
5
+ # against a customer using test payment information.
6
+ # If using TEST mode, odd dollar amounts will return
7
+ # an approval and even dollar amounts will return a decline.
8
+ ##
9
+
10
+ require "bluepay"
11
+
12
+ $ACCOUNT_ID = "MERCHANT'S ACCOUNT ID HERE"
13
+ $SECRET_KEY = "MERCHANT'S SECRET KEY HERE"
14
+ $MODE = "TEST"
15
+
16
+ # Merchant's Account ID
17
+ # Merchant's Secret Key
18
+ # Transaction Mode: TEST (can also be LIVE)
19
+ payment = BluePay.new(
20
+ $ACCOUNT_ID,
21
+ $SECRET_KEY,
22
+ $MODE)
23
+
24
+ # Card Number: 4111111111111111
25
+ # Card Expire: 12/15
26
+ # Card CVV2: 123
27
+ payment.set_cc_information(
28
+ "4111111111111111",
29
+ "1215",
30
+ "123")
31
+
32
+ # First Name: Bob
33
+ # Last Name: Tester
34
+ # Address1: 123 Test St.
35
+ # Address2: Apt #500
36
+ # City: Testville
37
+ # State: IL
38
+ # Zip: 54321
39
+ # Country: USA
40
+ payment.set_customer_information(
41
+ "Bob",
42
+ "Tester",
43
+ "123 Test St.",
44
+ "Testville",
45
+ "IL",
46
+ "54321",
47
+ "Apt #500",
48
+ "USA")
49
+
50
+ # Rebill Start Date: Jan. 5, 2015
51
+ # Rebill Frequency: 1 MONTH
52
+ # Rebill # of Cycles: 5
53
+ # Rebill Amount: $3.50
54
+ payment.add_recurring_fields(
55
+ "2015-01-05",
56
+ "1 MONTH",
57
+ "5",
58
+ "3.50")
59
+
60
+ # Phone #: 123-123-1234
61
+ payment.set_phone("1231231234")
62
+
63
+ # Email Address: test@bluepay.com
64
+ payment.set_email("test@bluepay.com")
65
+
66
+ # Sale Amount: $3.00
67
+ payment.sale("3.00")
68
+
69
+ response = payment.process()
70
+
71
+ if (payment.get_status() == "APPROVED") then
72
+ # Read response from BluePay
73
+ puts "TRANSACTION STATUS: " + payment.get_status()
74
+ puts "TRANSACTION MESSAGE: " + payment.get_message()
75
+ puts "TRANSACTION ID: " + payment.get_trans_id()
76
+ puts "REBILL ID: " + payment.get_rebill_id()
77
+ puts "AVS RESPONSE: " + payment.get_avs_code()
78
+ puts "CVV2 RESPONSE: " + payment.get_cvv2_code()
79
+ puts "MASKED PAYMENT ACCOUNT: " + payment.get_masked_account()
80
+ puts "CARD TYPE: " + payment.get_card_type()
81
+ puts "AUTH CODE: " + payment.get_auth_code()
82
+ else
83
+ puts payment.get_message()
84
+ end