bluepay 1.0.3 → 1.0.4

Sign up to get free protection for your applications and to get access to all the features.
Files changed (89) hide show
  1. checksums.yaml +7 -7
  2. data/Rakefile +1 -1
  3. data/bluepay.gemspec +3 -3
  4. data/lib/api_request.rb +125 -0
  5. data/lib/api_response.rb +150 -0
  6. data/lib/bluepay.rb +94 -332
  7. data/lib/cacert.pem +3860 -0
  8. data/test/Get_Data/Retrieve_Settlement_Data.rb +34 -0
  9. data/test/Get_Data/Retrieve_Transaction_Data.rb +33 -0
  10. data/test/Get_Data/Single_Transaction_Query.rb +42 -0
  11. data/test/Get_Data/Transaction_Notification.rb +61 -0
  12. data/test/Rebill/Cancel_Recurring_Payment.rb +82 -0
  13. data/test/Rebill/Create_Recurring_Payment_ACH.rb +60 -0
  14. data/test/Rebill/Create_Recurring_Payment_CC.rb +62 -0
  15. data/test/Rebill/Get_Recurring_Payment_Status.rb +82 -0
  16. data/test/Rebill/Update_Recurring_Payment.rb +111 -0
  17. data/test/Transactions/Cancel_Transaction.rb +74 -0
  18. data/test/Transactions/Charge_Customer_ACH.rb +54 -0
  19. data/test/Transactions/Charge_Customer_CC.rb +60 -0
  20. data/test/Transactions/Check_Customer_Credit.rb +58 -0
  21. data/test/Transactions/Customer_Defined_Data.rb +71 -0
  22. data/test/Transactions/How_To_Use_Token.rb +42 -0
  23. data/test/Transactions/Return_Funds.rb +77 -0
  24. data/test/Transactions/Store_Payment_Information.rb +58 -0
  25. metadata +42 -93
  26. data/doc/BluePay.html +0 -2699
  27. data/doc/README.html +0 -174
  28. data/doc/created.rid +0 -3
  29. data/doc/fonts.css +0 -167
  30. data/doc/fonts/Lato-Light.ttf +0 -0
  31. data/doc/fonts/Lato-LightItalic.ttf +0 -0
  32. data/doc/fonts/Lato-Regular.ttf +0 -0
  33. data/doc/fonts/Lato-RegularItalic.ttf +0 -0
  34. data/doc/fonts/SourceCodePro-Bold.ttf +0 -0
  35. data/doc/fonts/SourceCodePro-Regular.ttf +0 -0
  36. data/doc/images/add.png +0 -0
  37. data/doc/images/arrow_up.png +0 -0
  38. data/doc/images/brick.png +0 -0
  39. data/doc/images/brick_link.png +0 -0
  40. data/doc/images/bug.png +0 -0
  41. data/doc/images/bullet_black.png +0 -0
  42. data/doc/images/bullet_toggle_minus.png +0 -0
  43. data/doc/images/bullet_toggle_plus.png +0 -0
  44. data/doc/images/date.png +0 -0
  45. data/doc/images/delete.png +0 -0
  46. data/doc/images/find.png +0 -0
  47. data/doc/images/loadingAnimation.gif +0 -0
  48. data/doc/images/macFFBgHack.png +0 -0
  49. data/doc/images/package.png +0 -0
  50. data/doc/images/page_green.png +0 -0
  51. data/doc/images/page_white_text.png +0 -0
  52. data/doc/images/page_white_width.png +0 -0
  53. data/doc/images/plugin.png +0 -0
  54. data/doc/images/ruby.png +0 -0
  55. data/doc/images/tag_blue.png +0 -0
  56. data/doc/images/tag_green.png +0 -0
  57. data/doc/images/transparent.png +0 -0
  58. data/doc/images/wrench.png +0 -0
  59. data/doc/images/wrench_orange.png +0 -0
  60. data/doc/images/zoom.png +0 -0
  61. data/doc/index.html +0 -92
  62. data/doc/js/darkfish.js +0 -140
  63. data/doc/js/jquery.js +0 -18
  64. data/doc/js/navigation.js +0 -142
  65. data/doc/js/search.js +0 -109
  66. data/doc/js/search_index.js +0 -1
  67. data/doc/js/searcher.js +0 -228
  68. data/doc/rdoc.css +0 -580
  69. data/doc/table_of_contents.html +0 -405
  70. data/test/get_data/retrieve_settlement_data.rb +0 -39
  71. data/test/get_data/retrieve_transaction_data.rb +0 -37
  72. data/test/get_data/transaction_query.rb +0 -48
  73. data/test/getting_stuff_done/get_transaction_data.rb +0 -37
  74. data/test/getting_stuff_done/run_ach_payment.rb +0 -75
  75. data/test/getting_stuff_done/run_cc_payment.rb +0 -73
  76. data/test/getting_stuff_done/set_up_rebill_ach.rb +0 -85
  77. data/test/getting_stuff_done/set_up_rebill_cc.rb +0 -84
  78. data/test/rebills/cancel_rebill.rb +0 -96
  79. data/test/rebills/create_rebill.rb +0 -84
  80. data/test/rebills/get_rebill.rb +0 -97
  81. data/test/rebills/update_rebill.rb +0 -128
  82. data/test/transactions/cancel_transaction.rb +0 -85
  83. data/test/transactions/charge_customer.rb +0 -74
  84. data/test/transactions/check_customer_credit.rb +0 -74
  85. data/test/transactions/credit_customer.rb +0 -75
  86. data/test/transactions/customer_defined_data.rb +0 -99
  87. data/test/transactions/return_funds.rb +0 -86
  88. data/test/transactions/store_payment_information.rb +0 -74
  89. data/test/transactions/use_token.rb +0 -44
@@ -1,84 +0,0 @@
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
@@ -1,97 +0,0 @@
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
@@ -1,128 +0,0 @@
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
@@ -1,85 +0,0 @@
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
@@ -1,74 +0,0 @@
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 transaction was approved..
62
- if (payment.get_status() == "APPROVED") then
63
- # Read response from BluePay
64
- puts "TRANSACTION STATUS: " + payment.get_status()
65
- puts "TRANSACTION MESSAGE: " + payment.get_message()
66
- puts "TRANSACTION ID: " + payment.get_trans_id()
67
- puts "AVS RESPONSE: " + payment.get_avs_code()
68
- puts "CVV2 RESPONSE: " + payment.get_cvv2_code()
69
- puts "MASKED PAYMENT ACCOUNT: " + payment.get_masked_account()
70
- puts "CARD TYPE: " + payment.get_card_type()
71
- puts "AUTH CODE: " + payment.get_auth_code()
72
- else
73
- puts payment.get_message()
74
- end