workarea-authorize_cim 2.1.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (118) hide show
  1. checksums.yaml +7 -0
  2. data/.editorconfig +20 -0
  3. data/.github/ISSUE_TEMPLATE/bug_report.md +37 -0
  4. data/.github/ISSUE_TEMPLATE/documentation-request.md +17 -0
  5. data/.github/ISSUE_TEMPLATE/feature_request.md +20 -0
  6. data/.gitignore +13 -0
  7. data/.rails-rubocop.yml +130 -0
  8. data/.rubocop.yml +13 -0
  9. data/CHANGELOG.md +90 -0
  10. data/CODE_OF_CONDUCT.md +3 -0
  11. data/CONTRIBUTING.md +3 -0
  12. data/Gemfile +12 -0
  13. data/LICENSE +52 -0
  14. data/LICENSE.md +3 -0
  15. data/README.md +40 -0
  16. data/Rakefile +50 -0
  17. data/app/errors/workarea/payment/create_profile_error.rb +19 -0
  18. data/app/models/workarea/payment.decorator +14 -0
  19. data/app/models/workarea/payment/authorize/credit_card.decorator +61 -0
  20. data/app/models/workarea/payment/capture/credit_card.decorator +38 -0
  21. data/app/models/workarea/payment/profile.decorator +169 -0
  22. data/app/models/workarea/payment/purchase/credit_card.decorator +61 -0
  23. data/app/models/workarea/payment/refund.decorator +19 -0
  24. data/app/models/workarea/payment/refund/credit_card.decorator +39 -0
  25. data/app/models/workarea/payment/store_credit_card.decorator +122 -0
  26. data/app/models/workarea/payment/tender/credit_card.decorator +25 -0
  27. data/app/models/workarea/payment/transaction.decorator +16 -0
  28. data/bin/rails +17 -0
  29. data/bin/rake +17 -0
  30. data/bin/rspec +17 -0
  31. data/bin/rubocop +17 -0
  32. data/config/initializers/configuration.rb +3 -0
  33. data/lib/active_merchant/billing/bogus_authorize_net_cim_gateway.rb +99 -0
  34. data/lib/workarea/authorize_cim.rb +47 -0
  35. data/lib/workarea/authorize_cim/engine.rb +10 -0
  36. data/lib/workarea/authorize_cim/error.rb +12 -0
  37. data/lib/workarea/authorize_cim/version.rb +7 -0
  38. data/test/dummy/Rakefile +6 -0
  39. data/test/dummy/app/assets/config/manifest.js +4 -0
  40. data/test/dummy/app/assets/images/.keep +0 -0
  41. data/test/dummy/app/assets/javascripts/application.js +13 -0
  42. data/test/dummy/app/assets/stylesheets/application.css +15 -0
  43. data/test/dummy/app/controllers/application_controller.rb +3 -0
  44. data/test/dummy/app/controllers/concerns/.keep +0 -0
  45. data/test/dummy/app/helpers/application_helper.rb +2 -0
  46. data/test/dummy/app/jobs/application_job.rb +2 -0
  47. data/test/dummy/app/mailers/application_mailer.rb +4 -0
  48. data/test/dummy/app/models/concerns/.keep +0 -0
  49. data/test/dummy/app/views/layouts/application.html.erb +14 -0
  50. data/test/dummy/app/views/layouts/mailer.html.erb +13 -0
  51. data/test/dummy/app/views/layouts/mailer.text.erb +1 -0
  52. data/test/dummy/bin/bundle +3 -0
  53. data/test/dummy/bin/rails +4 -0
  54. data/test/dummy/bin/rake +4 -0
  55. data/test/dummy/bin/setup +34 -0
  56. data/test/dummy/bin/update +29 -0
  57. data/test/dummy/config.ru +5 -0
  58. data/test/dummy/config/application.rb +20 -0
  59. data/test/dummy/config/boot.rb +5 -0
  60. data/test/dummy/config/cable.yml +9 -0
  61. data/test/dummy/config/environment.rb +5 -0
  62. data/test/dummy/config/environments/development.rb +56 -0
  63. data/test/dummy/config/environments/production.rb +86 -0
  64. data/test/dummy/config/environments/test.rb +43 -0
  65. data/test/dummy/config/initializers/application_controller_renderer.rb +6 -0
  66. data/test/dummy/config/initializers/assets.rb +11 -0
  67. data/test/dummy/config/initializers/backtrace_silencers.rb +7 -0
  68. data/test/dummy/config/initializers/cookies_serializer.rb +5 -0
  69. data/test/dummy/config/initializers/filter_parameter_logging.rb +4 -0
  70. data/test/dummy/config/initializers/inflections.rb +16 -0
  71. data/test/dummy/config/initializers/mime_types.rb +4 -0
  72. data/test/dummy/config/initializers/new_framework_defaults.rb +21 -0
  73. data/test/dummy/config/initializers/session_store.rb +3 -0
  74. data/test/dummy/config/initializers/workarea.rb +5 -0
  75. data/test/dummy/config/initializers/wrap_parameters.rb +14 -0
  76. data/test/dummy/config/locales/en.yml +23 -0
  77. data/test/dummy/config/puma.rb +47 -0
  78. data/test/dummy/config/routes.rb +5 -0
  79. data/test/dummy/config/secrets.yml +22 -0
  80. data/test/dummy/config/spring.rb +6 -0
  81. data/test/dummy/db/seeds.rb +3 -0
  82. data/test/dummy/lib/assets/.keep +0 -0
  83. data/test/dummy/log/.keep +0 -0
  84. data/test/dummy/public/404.html +67 -0
  85. data/test/dummy/public/422.html +67 -0
  86. data/test/dummy/public/500.html +66 -0
  87. data/test/dummy/public/apple-touch-icon-precomposed.png +0 -0
  88. data/test/dummy/public/apple-touch-icon.png +0 -0
  89. data/test/dummy/public/favicon.ico +0 -0
  90. data/test/factories/workarea/factories/authorize_cim_factory.rb +14 -0
  91. data/test/models/workarea/payment/authorize/credit_card_test.decorator +17 -0
  92. data/test/models/workarea/payment/authorize_cim_integration_test.rb +137 -0
  93. data/test/models/workarea/payment/capture/credit_card_test.decorator +80 -0
  94. data/test/models/workarea/payment/credit_card_integration_test.decorator +30 -0
  95. data/test/models/workarea/payment/profile_test.rb +60 -0
  96. data/test/models/workarea/payment/purchase/credit_card_test.decorator +17 -0
  97. data/test/models/workarea/payment/refund/credit_card_test.decorator +95 -0
  98. data/test/models/workarea/payment/refund_test.decorator +14 -0
  99. data/test/models/workarea/payment/store_credit_card_test.decorator +7 -0
  100. data/test/services/workarea/cancel_order_test.decorator +55 -0
  101. data/test/support/workarea/authorize_cim_gateway_duplicate_window_patch.rb +14 -0
  102. data/test/support/workarea/authorize_cim_gateway_vcr_config.rb +22 -0
  103. data/test/support/workarea/workarea_3_2_backports.rb +57 -0
  104. data/test/system/workarea/storefront/orders_system_test.decorator +28 -0
  105. data/test/test_helper.rb +17 -0
  106. data/test/vcr_cassettes/authorize_net_cim/auth_capture.yml +435 -0
  107. data/test/vcr_cassettes/authorize_net_cim/auth_void.yml +436 -0
  108. data/test/vcr_cassettes/authorize_net_cim/purchase_void.yml +436 -0
  109. data/test/vcr_cassettes/authorize_net_cim/store_auth.yml +371 -0
  110. data/test/vcr_cassettes/authorize_net_cim/store_purchase.yml +371 -0
  111. data/test/vcr_cassettes/credit_card/auth_capture.yml +438 -0
  112. data/test/vcr_cassettes/credit_card/auth_void.yml +439 -0
  113. data/test/vcr_cassettes/credit_card/purchase_void.yml +439 -0
  114. data/test/vcr_cassettes/credit_card/store_auth.yml +374 -0
  115. data/test/vcr_cassettes/credit_card/store_purchase.yml +374 -0
  116. data/test/workers/workarea/send_refund_email_test.decorator +70 -0
  117. data/workarea-authorize_cim.gemspec +27 -0
  118. metadata +187 -0
@@ -0,0 +1,374 @@
1
+ ---
2
+ http_interactions:
3
+ - request:
4
+ method: post
5
+ uri: https://apitest.authorize.net/xml/v1/request.api
6
+ body:
7
+ encoding: UTF-8
8
+ string: |
9
+ <?xml version="1.0" encoding="utf-8"?>
10
+ <createCustomerProfileRequest xmlns="AnetApi/xml/v1/schema/AnetApiSchema.xsd">
11
+ <merchantAuthentication>
12
+ <name>a</name>
13
+ <transactionKey>b</transactionKey>
14
+ </merchantAuthentication>
15
+ <profile>
16
+ <email>user@workarea.com</email>
17
+ </profile>
18
+ </createCustomerProfileRequest>
19
+ headers:
20
+ Content-Type:
21
+ - text/xml
22
+ Connection:
23
+ - close
24
+ Accept-Encoding:
25
+ - gzip;q=1.0,deflate;q=0.6,identity;q=0.3
26
+ Accept:
27
+ - "*/*"
28
+ User-Agent:
29
+ - Ruby
30
+ response:
31
+ status:
32
+ code: 200
33
+ message: OK
34
+ headers:
35
+ Cache-Control:
36
+ - private
37
+ Content-Type:
38
+ - application/xml; charset=utf-8
39
+ Access-Control-Allow-Origin:
40
+ - "*"
41
+ Access-Control-Allow-Headers:
42
+ - x-requested-with,cache-control,content-type,origin,method,SOAPAction
43
+ Access-Control-Allow-Credentials:
44
+ - 'true'
45
+ Access-Control-Allow-Methods:
46
+ - PUT,OPTIONS,POST,GET
47
+ X-Cnection:
48
+ - close
49
+ Content-Length:
50
+ - '503'
51
+ Date:
52
+ - Fri, 31 Aug 2018 14:03:36 GMT
53
+ Connection:
54
+ - close
55
+ body:
56
+ encoding: ASCII-8BIT
57
+ string: !binary |-
58
+ 77u/PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0idXRmLTgiPz48Y3JlYXRlQ3VzdG9tZXJQcm9maWxlUmVzcG9uc2UgeG1sbnM6eHNpPSJodHRwOi8vd3d3LnczLm9yZy8yMDAxL1hNTFNjaGVtYS1pbnN0YW5jZSIgeG1sbnM6eHNkPSJodHRwOi8vd3d3LnczLm9yZy8yMDAxL1hNTFNjaGVtYSIgeG1sbnM9IkFuZXRBcGkveG1sL3YxL3NjaGVtYS9BbmV0QXBpU2NoZW1hLnhzZCI+PG1lc3NhZ2VzPjxyZXN1bHRDb2RlPkVycm9yPC9yZXN1bHRDb2RlPjxtZXNzYWdlPjxjb2RlPkUwMDAzOTwvY29kZT48dGV4dD5BIGR1cGxpY2F0ZSByZWNvcmQgd2l0aCBJRCAxODEzODc3NzkzIGFscmVhZHkgZXhpc3RzLjwvdGV4dD48L21lc3NhZ2U+PC9tZXNzYWdlcz48Y3VzdG9tZXJQYXltZW50UHJvZmlsZUlkTGlzdCAvPjxjdXN0b21lclNoaXBwaW5nQWRkcmVzc0lkTGlzdCAvPjx2YWxpZGF0aW9uRGlyZWN0UmVzcG9uc2VMaXN0IC8+PC9jcmVhdGVDdXN0b21lclByb2ZpbGVSZXNwb25zZT4=
59
+ http_version:
60
+ recorded_at: Fri, 31 Aug 2018 14:03:36 GMT
61
+ - request:
62
+ method: post
63
+ uri: https://apitest.authorize.net/xml/v1/request.api
64
+ body:
65
+ encoding: UTF-8
66
+ string: |
67
+ <?xml version="1.0" encoding="utf-8"?>
68
+ <getCustomerProfileRequest xmlns="AnetApi/xml/v1/schema/AnetApiSchema.xsd">
69
+ <merchantAuthentication>
70
+ <name>a</name>
71
+ <transactionKey>b</transactionKey>
72
+ </merchantAuthentication>
73
+ <customerProfileId>1813877793</customerProfileId>
74
+ </getCustomerProfileRequest>
75
+ headers:
76
+ Content-Type:
77
+ - text/xml
78
+ Connection:
79
+ - close
80
+ Accept-Encoding:
81
+ - gzip;q=1.0,deflate;q=0.6,identity;q=0.3
82
+ Accept:
83
+ - "*/*"
84
+ User-Agent:
85
+ - Ruby
86
+ response:
87
+ status:
88
+ code: 200
89
+ message: OK
90
+ headers:
91
+ Cache-Control:
92
+ - private
93
+ Content-Type:
94
+ - application/xml; charset=utf-8
95
+ Access-Control-Allow-Origin:
96
+ - "*"
97
+ Access-Control-Allow-Headers:
98
+ - x-requested-with,cache-control,content-type,origin,method,SOAPAction
99
+ Access-Control-Allow-Credentials:
100
+ - 'true'
101
+ Access-Control-Allow-Methods:
102
+ - PUT,OPTIONS,POST,GET
103
+ X-Cnection:
104
+ - close
105
+ Content-Length:
106
+ - '895'
107
+ Date:
108
+ - Fri, 31 Aug 2018 14:03:36 GMT
109
+ Connection:
110
+ - close
111
+ body:
112
+ encoding: ASCII-8BIT
113
+ string: !binary |-
114
+ 77u/PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0idXRmLTgiPz48Z2V0Q3VzdG9tZXJQcm9maWxlUmVzcG9uc2UgeG1sbnM6eHNpPSJodHRwOi8vd3d3LnczLm9yZy8yMDAxL1hNTFNjaGVtYS1pbnN0YW5jZSIgeG1sbnM6eHNkPSJodHRwOi8vd3d3LnczLm9yZy8yMDAxL1hNTFNjaGVtYSIgeG1sbnM9IkFuZXRBcGkveG1sL3YxL3NjaGVtYS9BbmV0QXBpU2NoZW1hLnhzZCI+PG1lc3NhZ2VzPjxyZXN1bHRDb2RlPk9rPC9yZXN1bHRDb2RlPjxtZXNzYWdlPjxjb2RlPkkwMDAwMTwvY29kZT48dGV4dD5TdWNjZXNzZnVsLjwvdGV4dD48L21lc3NhZ2U+PC9tZXNzYWdlcz48cHJvZmlsZT48ZW1haWw+dXNlckB3b3JrYXJlYS5jb208L2VtYWlsPjxjdXN0b21lclByb2ZpbGVJZD4xODEzODc3NzkzPC9jdXN0b21lclByb2ZpbGVJZD48cGF5bWVudFByb2ZpbGVzPjxiaWxsVG8+PGZpcnN0TmFtZT5CZW48L2ZpcnN0TmFtZT48bGFzdE5hbWU+Q3JvdXNlPC9sYXN0TmFtZT48YWRkcmVzcz4yMiBzLiAzcmQgc3QuPC9hZGRyZXNzPjxjaXR5PlBoaWxhZGVscGhpYTwvY2l0eT48c3RhdGU+UEE8L3N0YXRlPjx6aXA+MTkxMDY8L3ppcD48Y291bnRyeT5Vbml0ZWQgU3RhdGVzIG9mIEFtZXJpY2E8L2NvdW50cnk+PC9iaWxsVG8+PGN1c3RvbWVyUGF5bWVudFByb2ZpbGVJZD4xODA4NTg4NjczPC9jdXN0b21lclBheW1lbnRQcm9maWxlSWQ+PHBheW1lbnQ+PGNyZWRpdENhcmQ+PGNhcmROdW1iZXI+WFhYWDExMTE8L2NhcmROdW1iZXI+PGV4cGlyYXRpb25EYXRlPlhYWFg8L2V4cGlyYXRpb25EYXRlPjxjYXJkVHlwZT5WaXNhPC9jYXJkVHlwZT48L2NyZWRpdENhcmQ+PC9wYXltZW50PjwvcGF5bWVudFByb2ZpbGVzPjwvcHJvZmlsZT48L2dldEN1c3RvbWVyUHJvZmlsZVJlc3BvbnNlPg==
115
+ http_version:
116
+ recorded_at: Fri, 31 Aug 2018 14:03:36 GMT
117
+ - request:
118
+ method: post
119
+ uri: https://apitest.authorize.net/xml/v1/request.api
120
+ body:
121
+ encoding: UTF-8
122
+ string: |
123
+ <?xml version="1.0" encoding="utf-8"?>
124
+ <getCustomerProfileRequest xmlns="AnetApi/xml/v1/schema/AnetApiSchema.xsd">
125
+ <merchantAuthentication>
126
+ <name>a</name>
127
+ <transactionKey>b</transactionKey>
128
+ </merchantAuthentication>
129
+ <customerProfileId>1813877793</customerProfileId>
130
+ </getCustomerProfileRequest>
131
+ headers:
132
+ Content-Type:
133
+ - text/xml
134
+ Connection:
135
+ - close
136
+ Accept-Encoding:
137
+ - gzip;q=1.0,deflate;q=0.6,identity;q=0.3
138
+ Accept:
139
+ - "*/*"
140
+ User-Agent:
141
+ - Ruby
142
+ response:
143
+ status:
144
+ code: 200
145
+ message: OK
146
+ headers:
147
+ Cache-Control:
148
+ - private
149
+ Content-Type:
150
+ - application/xml; charset=utf-8
151
+ Access-Control-Allow-Origin:
152
+ - "*"
153
+ Access-Control-Allow-Headers:
154
+ - x-requested-with,cache-control,content-type,origin,method,SOAPAction
155
+ Access-Control-Allow-Credentials:
156
+ - 'true'
157
+ Access-Control-Allow-Methods:
158
+ - PUT,OPTIONS,POST,GET
159
+ X-Cnection:
160
+ - close
161
+ Content-Length:
162
+ - '895'
163
+ Date:
164
+ - Fri, 31 Aug 2018 14:03:36 GMT
165
+ Connection:
166
+ - close
167
+ body:
168
+ encoding: ASCII-8BIT
169
+ string: !binary |-
170
+ 77u/PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0idXRmLTgiPz48Z2V0Q3VzdG9tZXJQcm9maWxlUmVzcG9uc2UgeG1sbnM6eHNpPSJodHRwOi8vd3d3LnczLm9yZy8yMDAxL1hNTFNjaGVtYS1pbnN0YW5jZSIgeG1sbnM6eHNkPSJodHRwOi8vd3d3LnczLm9yZy8yMDAxL1hNTFNjaGVtYSIgeG1sbnM9IkFuZXRBcGkveG1sL3YxL3NjaGVtYS9BbmV0QXBpU2NoZW1hLnhzZCI+PG1lc3NhZ2VzPjxyZXN1bHRDb2RlPk9rPC9yZXN1bHRDb2RlPjxtZXNzYWdlPjxjb2RlPkkwMDAwMTwvY29kZT48dGV4dD5TdWNjZXNzZnVsLjwvdGV4dD48L21lc3NhZ2U+PC9tZXNzYWdlcz48cHJvZmlsZT48ZW1haWw+dXNlckB3b3JrYXJlYS5jb208L2VtYWlsPjxjdXN0b21lclByb2ZpbGVJZD4xODEzODc3NzkzPC9jdXN0b21lclByb2ZpbGVJZD48cGF5bWVudFByb2ZpbGVzPjxiaWxsVG8+PGZpcnN0TmFtZT5CZW48L2ZpcnN0TmFtZT48bGFzdE5hbWU+Q3JvdXNlPC9sYXN0TmFtZT48YWRkcmVzcz4yMiBzLiAzcmQgc3QuPC9hZGRyZXNzPjxjaXR5PlBoaWxhZGVscGhpYTwvY2l0eT48c3RhdGU+UEE8L3N0YXRlPjx6aXA+MTkxMDY8L3ppcD48Y291bnRyeT5Vbml0ZWQgU3RhdGVzIG9mIEFtZXJpY2E8L2NvdW50cnk+PC9iaWxsVG8+PGN1c3RvbWVyUGF5bWVudFByb2ZpbGVJZD4xODA4NTg4NjczPC9jdXN0b21lclBheW1lbnRQcm9maWxlSWQ+PHBheW1lbnQ+PGNyZWRpdENhcmQ+PGNhcmROdW1iZXI+WFhYWDExMTE8L2NhcmROdW1iZXI+PGV4cGlyYXRpb25EYXRlPlhYWFg8L2V4cGlyYXRpb25EYXRlPjxjYXJkVHlwZT5WaXNhPC9jYXJkVHlwZT48L2NyZWRpdENhcmQ+PC9wYXltZW50PjwvcGF5bWVudFByb2ZpbGVzPjwvcHJvZmlsZT48L2dldEN1c3RvbWVyUHJvZmlsZVJlc3BvbnNlPg==
171
+ http_version:
172
+ recorded_at: Fri, 31 Aug 2018 14:03:36 GMT
173
+ - request:
174
+ method: post
175
+ uri: https://apitest.authorize.net/xml/v1/request.api
176
+ body:
177
+ encoding: UTF-8
178
+ string: |
179
+ <?xml version="1.0" encoding="utf-8"?>
180
+ <getCustomerPaymentProfileRequest xmlns="AnetApi/xml/v1/schema/AnetApiSchema.xsd">
181
+ <merchantAuthentication>
182
+ <name>a</name>
183
+ <transactionKey>b</transactionKey>
184
+ </merchantAuthentication>
185
+ <customerProfileId>1813877793</customerProfileId>
186
+ <customerPaymentProfileId>1808588673</customerPaymentProfileId>
187
+ </getCustomerPaymentProfileRequest>
188
+ headers:
189
+ Content-Type:
190
+ - text/xml
191
+ Connection:
192
+ - close
193
+ Accept-Encoding:
194
+ - gzip;q=1.0,deflate;q=0.6,identity;q=0.3
195
+ Accept:
196
+ - "*/*"
197
+ User-Agent:
198
+ - Ruby
199
+ response:
200
+ status:
201
+ code: 200
202
+ message: OK
203
+ headers:
204
+ Cache-Control:
205
+ - private
206
+ Content-Type:
207
+ - application/xml; charset=utf-8
208
+ Access-Control-Allow-Origin:
209
+ - "*"
210
+ Access-Control-Allow-Headers:
211
+ - x-requested-with,cache-control,content-type,origin,method,SOAPAction
212
+ Access-Control-Allow-Credentials:
213
+ - 'true'
214
+ Access-Control-Allow-Methods:
215
+ - PUT,OPTIONS,POST,GET
216
+ X-Cnection:
217
+ - close
218
+ Content-Length:
219
+ - '856'
220
+ Date:
221
+ - Fri, 31 Aug 2018 14:03:37 GMT
222
+ Connection:
223
+ - close
224
+ body:
225
+ encoding: ASCII-8BIT
226
+ string: !binary |-
227
+ 77u/PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0idXRmLTgiPz48Z2V0Q3VzdG9tZXJQYXltZW50UHJvZmlsZVJlc3BvbnNlIHhtbG5zOnhzaT0iaHR0cDovL3d3dy53My5vcmcvMjAwMS9YTUxTY2hlbWEtaW5zdGFuY2UiIHhtbG5zOnhzZD0iaHR0cDovL3d3dy53My5vcmcvMjAwMS9YTUxTY2hlbWEiIHhtbG5zPSJBbmV0QXBpL3htbC92MS9zY2hlbWEvQW5ldEFwaVNjaGVtYS54c2QiPjxtZXNzYWdlcz48cmVzdWx0Q29kZT5PazwvcmVzdWx0Q29kZT48bWVzc2FnZT48Y29kZT5JMDAwMDE8L2NvZGU+PHRleHQ+U3VjY2Vzc2Z1bC48L3RleHQ+PC9tZXNzYWdlPjwvbWVzc2FnZXM+PHBheW1lbnRQcm9maWxlPjxiaWxsVG8+PGZpcnN0TmFtZT5CZW48L2ZpcnN0TmFtZT48bGFzdE5hbWU+Q3JvdXNlPC9sYXN0TmFtZT48YWRkcmVzcz4yMiBzLiAzcmQgc3QuPC9hZGRyZXNzPjxjaXR5PlBoaWxhZGVscGhpYTwvY2l0eT48c3RhdGU+UEE8L3N0YXRlPjx6aXA+MTkxMDY8L3ppcD48Y291bnRyeT5Vbml0ZWQgU3RhdGVzIG9mIEFtZXJpY2E8L2NvdW50cnk+PC9iaWxsVG8+PGN1c3RvbWVyUHJvZmlsZUlkPjE4MTM4Nzc3OTM8L2N1c3RvbWVyUHJvZmlsZUlkPjxjdXN0b21lclBheW1lbnRQcm9maWxlSWQ+MTgwODU4ODY3MzwvY3VzdG9tZXJQYXltZW50UHJvZmlsZUlkPjxwYXltZW50PjxjcmVkaXRDYXJkPjxjYXJkTnVtYmVyPlhYWFgxMTExPC9jYXJkTnVtYmVyPjxleHBpcmF0aW9uRGF0ZT5YWFhYPC9leHBpcmF0aW9uRGF0ZT48Y2FyZFR5cGU+VmlzYTwvY2FyZFR5cGU+PC9jcmVkaXRDYXJkPjwvcGF5bWVudD48L3BheW1lbnRQcm9maWxlPjwvZ2V0Q3VzdG9tZXJQYXltZW50UHJvZmlsZVJlc3BvbnNlPg==
228
+ http_version:
229
+ recorded_at: Fri, 31 Aug 2018 14:03:37 GMT
230
+ - request:
231
+ method: post
232
+ uri: https://apitest.authorize.net/xml/v1/request.api
233
+ body:
234
+ encoding: UTF-8
235
+ string: |
236
+ <?xml version="1.0" encoding="utf-8"?>
237
+ <updateCustomerPaymentProfileRequest xmlns="AnetApi/xml/v1/schema/AnetApiSchema.xsd">
238
+ <merchantAuthentication>
239
+ <name>a</name>
240
+ <transactionKey>b</transactionKey>
241
+ </merchantAuthentication>
242
+ <customerProfileId>1813877793</customerProfileId>
243
+ <paymentProfile>
244
+ <billTo>
245
+ <firstName>Ben</firstName>
246
+ <lastName>Crouse</lastName>
247
+ <company/>
248
+ <address>22 s. 3rd st.</address>
249
+ <city>Philadelphia</city>
250
+ <state>PA</state>
251
+ <zip>19106</zip>
252
+ <country>United States of America</country>
253
+ </billTo>
254
+ <payment>
255
+ <creditCard>
256
+ <cardNumber>XXXX1111</cardNumber>
257
+ <expirationDate>2019-01</expirationDate>
258
+ <cardCode>999</cardCode>
259
+ </creditCard>
260
+ </payment>
261
+ <customerPaymentProfileId>1808588673</customerPaymentProfileId>
262
+ </paymentProfile>
263
+ </updateCustomerPaymentProfileRequest>
264
+ headers:
265
+ Content-Type:
266
+ - text/xml
267
+ Connection:
268
+ - close
269
+ Accept-Encoding:
270
+ - gzip;q=1.0,deflate;q=0.6,identity;q=0.3
271
+ Accept:
272
+ - "*/*"
273
+ User-Agent:
274
+ - Ruby
275
+ response:
276
+ status:
277
+ code: 200
278
+ message: OK
279
+ headers:
280
+ Cache-Control:
281
+ - private
282
+ Content-Type:
283
+ - application/xml; charset=utf-8
284
+ Access-Control-Allow-Origin:
285
+ - "*"
286
+ Access-Control-Allow-Headers:
287
+ - x-requested-with,cache-control,content-type,origin,method,SOAPAction
288
+ Access-Control-Allow-Credentials:
289
+ - 'true'
290
+ Access-Control-Allow-Methods:
291
+ - PUT,OPTIONS,POST,GET
292
+ X-Cnection:
293
+ - close
294
+ Content-Length:
295
+ - '375'
296
+ Date:
297
+ - Fri, 31 Aug 2018 14:03:37 GMT
298
+ Connection:
299
+ - close
300
+ body:
301
+ encoding: ASCII-8BIT
302
+ string: !binary |-
303
+ 77u/PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0idXRmLTgiPz48dXBkYXRlQ3VzdG9tZXJQYXltZW50UHJvZmlsZVJlc3BvbnNlIHhtbG5zOnhzaT0iaHR0cDovL3d3dy53My5vcmcvMjAwMS9YTUxTY2hlbWEtaW5zdGFuY2UiIHhtbG5zOnhzZD0iaHR0cDovL3d3dy53My5vcmcvMjAwMS9YTUxTY2hlbWEiIHhtbG5zPSJBbmV0QXBpL3htbC92MS9zY2hlbWEvQW5ldEFwaVNjaGVtYS54c2QiPjxtZXNzYWdlcz48cmVzdWx0Q29kZT5PazwvcmVzdWx0Q29kZT48bWVzc2FnZT48Y29kZT5JMDAwMDE8L2NvZGU+PHRleHQ+U3VjY2Vzc2Z1bC48L3RleHQ+PC9tZXNzYWdlPjwvbWVzc2FnZXM+PC91cGRhdGVDdXN0b21lclBheW1lbnRQcm9maWxlUmVzcG9uc2U+
304
+ http_version:
305
+ recorded_at: Fri, 31 Aug 2018 14:03:37 GMT
306
+ - request:
307
+ method: post
308
+ uri: https://apitest.authorize.net/xml/v1/request.api
309
+ body:
310
+ encoding: UTF-8
311
+ string: |
312
+ <?xml version="1.0" encoding="utf-8"?>
313
+ <createCustomerProfileTransactionRequest xmlns="AnetApi/xml/v1/schema/AnetApiSchema.xsd">
314
+ <merchantAuthentication>
315
+ <name>a</name>
316
+ <transactionKey>b</transactionKey>
317
+ </merchantAuthentication>
318
+ <transaction>
319
+ <profileTransAuthCapture>
320
+ <amount>5.0</amount>
321
+ <customerProfileId>1813877793</customerProfileId>
322
+ <customerPaymentProfileId>1808588673</customerPaymentProfileId>
323
+ <order>
324
+ <invoiceNumber>238F782583</invoiceNumber>
325
+ </order>
326
+ </profileTransAuthCapture>
327
+ </transaction>
328
+ <extraOptions>
329
+ <![CDATA[x_duplicate_window=0]]>
330
+ </extraOptions>
331
+ </createCustomerProfileTransactionRequest>
332
+ headers:
333
+ Content-Type:
334
+ - text/xml
335
+ Connection:
336
+ - close
337
+ Accept-Encoding:
338
+ - gzip;q=1.0,deflate;q=0.6,identity;q=0.3
339
+ Accept:
340
+ - "*/*"
341
+ User-Agent:
342
+ - Ruby
343
+ response:
344
+ status:
345
+ code: 200
346
+ message: OK
347
+ headers:
348
+ Cache-Control:
349
+ - private
350
+ Content-Type:
351
+ - application/xml; charset=utf-8
352
+ Access-Control-Allow-Origin:
353
+ - "*"
354
+ Access-Control-Allow-Headers:
355
+ - x-requested-with,cache-control,content-type,origin,method,SOAPAction
356
+ Access-Control-Allow-Credentials:
357
+ - 'true'
358
+ Access-Control-Allow-Methods:
359
+ - PUT,OPTIONS,POST,GET
360
+ X-Cnection:
361
+ - close
362
+ Content-Length:
363
+ - '696'
364
+ Date:
365
+ - Fri, 31 Aug 2018 14:03:38 GMT
366
+ Connection:
367
+ - close
368
+ body:
369
+ encoding: ASCII-8BIT
370
+ string: !binary |-
371
+ 77u/PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0idXRmLTgiPz48Y3JlYXRlQ3VzdG9tZXJQcm9maWxlVHJhbnNhY3Rpb25SZXNwb25zZSB4bWxuczp4c2k9Imh0dHA6Ly93d3cudzMub3JnLzIwMDEvWE1MU2NoZW1hLWluc3RhbmNlIiB4bWxuczp4c2Q9Imh0dHA6Ly93d3cudzMub3JnLzIwMDEvWE1MU2NoZW1hIiB4bWxucz0iQW5ldEFwaS94bWwvdjEvc2NoZW1hL0FuZXRBcGlTY2hlbWEueHNkIj48bWVzc2FnZXM+PHJlc3VsdENvZGU+T2s8L3Jlc3VsdENvZGU+PG1lc3NhZ2U+PGNvZGU+STAwMDAxPC9jb2RlPjx0ZXh0PlN1Y2Nlc3NmdWwuPC90ZXh0PjwvbWVzc2FnZT48L21lc3NhZ2VzPjxkaXJlY3RSZXNwb25zZT4xLDEsMSxUaGlzIHRyYW5zYWN0aW9uIGhhcyBiZWVuIGFwcHJvdmVkLiw1SkpTMlIsWSw2MDEwNzc5NDE1MCwyMzhGNzgyNTgzLCw1LjAwLENDLGF1dGhfY2FwdHVyZSwsQmVuLENyb3VzZSwsMjIgcy4gM3JkIHN0LixQaGlsYWRlbHBoaWEsUEEsMTkxMDYsVW5pdGVkIFN0YXRlcyBvZiBBbWVyaWNhLCwsdXNlckB3b3JrYXJlYS5jb20sLCwsLCwsLCwsLCwsLDdCMUQ4OTBEQ0NGMkZCNzUxOTBGNjlGMUMxQTQxM0VELFAsMiwsLCwsLCwsLCwsWFhYWDExMTEsVmlzYSwsLCwsLCwsLCwsLCwsLCwsPC9kaXJlY3RSZXNwb25zZT48L2NyZWF0ZUN1c3RvbWVyUHJvZmlsZVRyYW5zYWN0aW9uUmVzcG9uc2U+
372
+ http_version:
373
+ recorded_at: Fri, 31 Aug 2018 14:03:38 GMT
374
+ recorded_with: VCR 2.9.3
@@ -0,0 +1,70 @@
1
+ module Workarea
2
+ decorate SendRefundEmailTest, with: :cim do
3
+ def test_perform
4
+ SendRefundEmail.enable
5
+ payment.purchase!
6
+
7
+ refund = Payment::Refund.new(
8
+ payment: payment,
9
+ amounts: { payment.credit_card.id => 5.to_m }
10
+ )
11
+
12
+ age_capture_or_purchase_transactions_for(payment)
13
+
14
+ assert(refund.complete!)
15
+
16
+ email = ActionMailer::Base.deliveries.last
17
+ assert_includes(email.to, 'test@workarea.com')
18
+ assert_includes(
19
+ email.subject,
20
+ I18n.t('workarea.storefront.email.order_refund.subject', order_id: order.id)
21
+ )
22
+ ensure
23
+ SendRefundEmail.disable
24
+ end
25
+
26
+ def test_no_email_sent_when_amount_is_zero
27
+ SendRefundEmail.enable
28
+ payment.purchase!
29
+
30
+ travel(3.days) do
31
+ refund = Payment::Refund.new(
32
+ payment: payment,
33
+ amounts: { payment.credit_card.id => 0.to_m }
34
+ )
35
+
36
+ assert(refund.complete!)
37
+ assert_empty(ActionMailer::Base.deliveries)
38
+ end
39
+ ensure
40
+ SendRefundEmail.disable
41
+ end
42
+
43
+ def payment
44
+ @payment ||=
45
+ begin
46
+ profile = create_payment_profile
47
+ create_payment(id: order.id, profile_id: profile.id).tap do |payment|
48
+ payment.set_address(
49
+ first_name: 'Ben',
50
+ last_name: 'Crouse',
51
+ street: '22 S. 3rd St.',
52
+ city: 'Philadelphia',
53
+ region: 'PA',
54
+ postal_code: '19106',
55
+ country: 'US',
56
+ phone_number: '2159251800'
57
+ )
58
+
59
+ payment.set_credit_card(
60
+ number: '1',
61
+ month: 1,
62
+ year: Time.current.year + 1,
63
+ cvv: '999',
64
+ amount: 5.to_m
65
+ )
66
+ end
67
+ end
68
+ end
69
+ end
70
+ end
@@ -0,0 +1,27 @@
1
+ # frozen_string_literal: true
2
+
3
+ $LOAD_PATH.push File.expand_path('../lib', __FILE__)
4
+
5
+ # Maintain your gem's version:
6
+ require 'workarea/authorize_cim/version'
7
+
8
+ # Describe your gem and declare its dependencies:
9
+ Gem::Specification.new do |s|
10
+ s.name = 'workarea-authorize_cim'
11
+ s.version = Workarea::AuthorizeCim::VERSION
12
+ s.authors = ['Tom Scott']
13
+ s.email = ['tscott@workarea.com']
14
+ s.homepage = 'https://github.com/workarea-commerce/workarea-authorize_cim'
15
+ s.summary = 'Authorize.Net CIM Integration for WorkArea'
16
+ s.description = 'Authorize.Net CIM Integration for WorkArea'
17
+
18
+ s.files = `git ls-files`.split("\n")
19
+
20
+ s.license = 'Business Software License'
21
+
22
+ s.required_ruby_version = '>= 2.0.0'
23
+
24
+ s.add_dependency 'workarea', '~> 3.x'
25
+
26
+ s.add_development_dependency 'rubocop', '~> 0'
27
+ end