bluepay 1.0.1 → 1.0.2

Sign up to get free protection for your applications and to get access to all the features.
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,96 @@
1
+ ##
2
+ # BluePay Ruby Sample code.
3
+ #
4
+ # This code sample runs a $0.00 Credit Card Auth transaction
5
+ # against a customer using test payment information, sets up
6
+ # a rebilling cycle, and also shows how to cancel that rebilling cycle.
7
+ # See comments below on the details of the initial setup of the
8
+ # rebilling cycle.
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
+ payment = BluePay.new(
21
+ $ACCOUNT_ID,
22
+ $SECRET_KEY,
23
+ $MODE)
24
+
25
+ # Card Number: 4111111111111111
26
+ # Card Expire: 12/15
27
+ # Card CVV2: 123
28
+ payment.set_cc_information(
29
+ "4111111111111111",
30
+ "1215",
31
+ "123")
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
+ # Auth Amount: $0.00
68
+ payment.auth("0.00")
69
+
70
+ response = payment.process()
71
+
72
+ # If transaction was approved..
73
+ if (payment.get_status() == "APPROVED") then
74
+ rebill_cancel = BluePay.new(
75
+ $ACCOUNT_ID,
76
+ $SECRET_KEY,
77
+ $MODE)
78
+
79
+ # Cancel rebilling cycle from above transaction
80
+ rebill_cancel.cancel_rebilling_cycle(payment.get_rebill_id())
81
+
82
+ rebill_cancel.process()
83
+
84
+ # Read response from BluePay
85
+ puts "REBILL STATUS: " + rebill_cancel.get_rebill_status()
86
+ puts "REBILL ID: " + rebill_cancel.get_reb_id()
87
+ puts "REBILL CREATION DATE: " + rebill_cancel.get_creation_date()
88
+ puts "REBILL NEXT DATE: " + rebill_cancel.get_next_date()
89
+ puts "REBILL LAST DATE: " + rebill_cancel.get_last_date()
90
+ puts "REBILL SCHEDULE EXPRESSION: " + rebill_cancel.get_sched_expression()
91
+ puts "REBILL CYCLES REMAINING: " + rebill_cancel.get_cycles_remaining()
92
+ puts "REBILL AMOUNT: " + rebill_cancel.get_rebill_amount()
93
+ puts "REBILL NEXT AMOUNT: " + rebill_cancel.get_next_amount()
94
+ else
95
+ puts payment.get_message()
96
+ end
@@ -0,0 +1,84 @@
1
+ ##
2
+ # BluePay Ruby Sample code.
3
+ #
4
+ # This code sample runs a $0.00 Credit Card Auth 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
+ # Card Number: 4111111111111111
24
+ # Card Expire: 12/15
25
+ # Card CVV2: 123
26
+ payment.set_cc_information(
27
+ "4111111111111111",
28
+ "1215",
29
+ "123")
30
+
31
+ # First Name: Bob
32
+ # Last Name: Tester
33
+ # Address1: 123 Test St.
34
+ # Address2: Apt #500
35
+ # City: Testville
36
+ # State: IL
37
+ # Zip: 54321
38
+ # Country: USA
39
+ payment.set_customer_information(
40
+ "Bob",
41
+ "Tester",
42
+ "123 Test St.",
43
+ "Testville",
44
+ "IL",
45
+ "54321",
46
+ "Apt #500",
47
+ "USA")
48
+
49
+ # Rebill Start Date: Jan. 5, 2015
50
+ # Rebill Frequency: 1 MONTH
51
+ # Rebill # of Cycles: 5
52
+ # Rebill Amount: $3.50
53
+ payment.add_recurring_fields(
54
+ "2015-01-05",
55
+ "1 MONTH",
56
+ "5",
57
+ "3.50")
58
+
59
+ # Phone #: 123-123-1234
60
+ payment.set_phone("1231231234")
61
+
62
+ # Email Address: test@bluepay.com
63
+ payment.set_email("test@bluepay.com")
64
+
65
+ # Auth Amount: $0.00
66
+ payment.auth("0.00")
67
+
68
+ response = payment.process()
69
+
70
+ # If transaction was approved..
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
@@ -0,0 +1,97 @@
1
+ ##
2
+ # BluePay Ruby Sample code.
3
+ #
4
+ # This code sample runs a $0.00 Credit Card Auth transaction
5
+ # against a customer using test payment information.
6
+ # Once the rebilling cycle is created, this sample shows how to
7
+ # get information back on this rebilling cycle.
8
+ # See comments below on the details of the initial setup of the
9
+ # rebilling cycle.
10
+ ##
11
+
12
+ require "bluepay"
13
+
14
+ $ACCOUNT_ID = "MERCHANT'S ACCOUNT ID HERE"
15
+ $SECRET_KEY = "MERCHANT'S SECRET KEY HERE"
16
+ $MODE = "TEST"
17
+
18
+ # Merchant's Account ID
19
+ # Merchant's Secret Key
20
+ # Transaction Mode: TEST (can also be LIVE)
21
+ payment = BluePay.new(
22
+ $ACCOUNT_ID,
23
+ $SECRET_KEY,
24
+ $MODE)
25
+
26
+ # Card Number: 4111111111111111
27
+ # Card Expire: 12/15
28
+ # Card CVV2: 123
29
+ payment.set_cc_information(
30
+ "4111111111111111",
31
+ "1215",
32
+ "123")
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
+ # Rebill Start Date: Jan. 5, 2015
53
+ # Rebill Frequency: 1 MONTH
54
+ # Rebill # of Cycles: 5
55
+ # Rebill Amount: $3.50
56
+ payment.add_recurring_fields(
57
+ "2015-01-05",
58
+ "1 MONTH",
59
+ "5",
60
+ "3.50")
61
+
62
+ # Phone #: 123-123-1234
63
+ payment.set_phone("1231231234")
64
+
65
+ # Email Address: test@bluepay.com
66
+ payment.set_email("test@bluepay.com")
67
+
68
+ # Auth Amount: $0.00
69
+ payment.auth("0.00")
70
+
71
+ response = payment.process()
72
+
73
+ # If transaction was approved..
74
+ if (payment.get_status() == "APPROVED") then
75
+ rebill_status = BluePay.new(
76
+ $ACCOUNT_ID,
77
+ $SECRET_KEY,
78
+ $MODE)
79
+
80
+ # Cancel rebilling cycle from above transaction
81
+ rebill_status.get_rebilling_cycle_status(payment.get_rebill_id())
82
+
83
+ rebill_status.process()
84
+
85
+ # Read response from BluePay
86
+ puts "REBILL STATUS: " + rebill_status.get_rebill_status()
87
+ puts "REBILL ID: " + rebill_status.get_reb_id()
88
+ puts "REBILL CREATION DATE: " + rebill_status.get_creation_date()
89
+ puts "REBILL NEXT DATE: " + rebill_status.get_next_date()
90
+ puts "REBILL LAST DATE: " + rebill_status.get_last_date()
91
+ puts "REBILL SCHEDULE EXPRESSION: " + rebill_status.get_sched_expression()
92
+ puts "REBILL CYCLES REMAINING: " + rebill_status.get_cycles_remaining()
93
+ puts "REBILL AMOUNT: " + rebill_status.get_rebill_amount()
94
+ puts "REBILL NEXT AMOUNT: " + rebill_status.get_next_amount()
95
+ else
96
+ puts payment.get_message()
97
+ end
@@ -0,0 +1,128 @@
1
+ ##
2
+ # BluePay Ruby Sample code.
3
+ #
4
+ # This code sample runs a $0.00 Credit Card Auth transaction
5
+ # against a customer using test payment information.
6
+ # Once the rebilling cycle is created, this sample shows how to
7
+ # update the rebilling cycle. See comments below
8
+ # on the details of the initial setup of the rebilling cycle as well as the
9
+ # updated rebilling cycle.
10
+ ##
11
+
12
+ require "bluepay"
13
+
14
+ $ACCOUNT_ID = "MERCHANT'S ACCOUNT ID HERE"
15
+ $SECRET_KEY = "MERCHANT'S SECRET KEY HERE"
16
+ $MODE = "TEST"
17
+
18
+ # Merchant's Account ID
19
+ # Merchant's Secret Key
20
+ # Transaction Mode: TEST (can also be LIVE)
21
+ payment = BluePay.new(
22
+ $ACCOUNT_ID,
23
+ $SECRET_KEY,
24
+ $MODE)
25
+
26
+ # Card Number: 4111111111111111
27
+ # Card Expire: 12/15
28
+ # Card CVV2: 123
29
+ payment.set_cc_information(
30
+ "4111111111111111",
31
+ "1215",
32
+ "123")
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
+ # Rebill Start Date: Jan. 5, 2015
53
+ # Rebill Frequency: 1 MONTH
54
+ # Rebill # of Cycles: 5
55
+ # Rebill Amount: $3.50
56
+ payment.add_recurring_fields(
57
+ "2015-01-05",
58
+ "1 MONTH",
59
+ "5",
60
+ "3.50")
61
+
62
+ # Phone #: 123-123-1234
63
+ payment.set_phone("1231231234")
64
+
65
+ # Email Address: test@bluepay.com
66
+ payment.set_email("test@bluepay.com")
67
+
68
+ # Auth Amount: $0.00
69
+ payment.auth("0.00")
70
+
71
+ response = payment.process()
72
+
73
+ # If transaction was approved..
74
+ if (payment.get_status() == "APPROVED") then
75
+ update_payment_information = BluePay.new(
76
+ $ACCOUNT_ID,
77
+ $SECRET_KEY,
78
+ $MODE)
79
+
80
+ # Card Number: 4111111111111111
81
+ # Card Expire: 01/21
82
+ update_payment_information.set_cc_information(
83
+ "4111111111111111",
84
+ "0121")
85
+
86
+ # Stores new card expiration date
87
+ update_payment_information.auth("0.00", payment.get_trans_id())
88
+
89
+ update_payment_information.process()
90
+
91
+ update_rebill = BluePay.new(
92
+ $ACCOUNT_ID,
93
+ $SECRET_KEY,
94
+ $MODE)
95
+
96
+ # Attempts to cancel rebill using Rebill ID token returned
97
+ # Rebill Start Date: March 1, 2015
98
+ # Rebill Frequency: 1 MONTH
99
+ # Rebill # of Cycles: 8
100
+ # Rebill Amount: $5.15
101
+ # Rebill Next Amount: $1.50
102
+ update_rebill.update_rebilling_cycle(
103
+ payment.get_rebill_id(),
104
+ "2015-03-01",
105
+ "1 MONTH",
106
+ "8",
107
+ "5.15",
108
+ "1.50")
109
+
110
+ # Updates the payment information portion of the rebilling cycle to the
111
+ # new card expiration date entered above
112
+ update_rebill.update_rebilling_payment_information(update_payment_information.get_trans_id())
113
+
114
+ update_rebill.process()
115
+
116
+ # Read response from BluePay
117
+ puts "REBILL STATUS: " + update_rebill.get_rebill_status()
118
+ puts "REBILL ID: " + update_rebill.get_reb_id()
119
+ puts "REBILL CREATION DATE: " + update_rebill.get_creation_date()
120
+ puts "REBILL NEXT DATE: " + update_rebill.get_next_date()
121
+ puts "REBILL LAST DATE: " + update_rebill.get_last_date()
122
+ puts "REBILL SCHEDULE EXPRESSION: " + update_rebill.get_sched_expression()
123
+ puts "REBILL CYCLES REMAINING: " + update_rebill.get_cycles_remaining()
124
+ puts "REBILL AMOUNT: " + update_rebill.get_rebill_amount()
125
+ puts "REBILL NEXT AMOUNT: " + update_rebill.get_next_amount()
126
+ else
127
+ puts payment.get_message()
128
+ end
@@ -0,0 +1,85 @@
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 approved, a 2nd transaction is run to cancel this transaction.
7
+ # If using TEST mode, odd dollar amounts will return
8
+ # an approval and even dollar amounts will return a decline.
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
+ payment = BluePay.new(
21
+ $ACCOUNT_ID,
22
+ $SECRET_KEY,
23
+ $MODE)
24
+
25
+ # Card Number: 4111111111111111
26
+ # Card Expire: 12/15
27
+ # Card CVV2: 123
28
+ payment.set_cc_information(
29
+ "4111111111111111",
30
+ "1215",
31
+ "123")
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
+ # Phone #: 123-123-1234
52
+ payment.set_phone("1231231234")
53
+
54
+ # Email Address: test@bluepay.com
55
+ payment.set_email("test@bluepay.com")
56
+
57
+ # Sale Amount: $3.00
58
+ payment.sale("3.00")
59
+
60
+ response = payment.process()
61
+
62
+ # If transaction was approved..
63
+ if (payment.get_status() == "APPROVED") then
64
+ payment_void = BluePay.new(
65
+ $ACCOUNT_ID,
66
+ $SECRET_KEY,
67
+ $MODE)
68
+
69
+ # Attempts to void above Sale transaction
70
+ payment_void.void(payment.get_trans_id())
71
+
72
+ payment_void.process()
73
+
74
+ # Read response from BluePay
75
+ puts "TRANSACTION STATUS: " + payment.get_status()
76
+ puts "TRANSACTION MESSAGE: " + payment.get_message()
77
+ puts "TRANSACTION ID: " + payment.get_trans_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 "CARD TYPE: " + payment.get_card_type()
82
+ puts "AUTH CODE: " + payment.get_auth_code()
83
+ else
84
+ puts payment.get_message()
85
+ end