workarea-forter 1.2.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/.editorconfig +20 -0
- data/.github/ISSUE_TEMPLATE/bug_report.md +37 -0
- data/.github/ISSUE_TEMPLATE/documentation-request.md +17 -0
- data/.github/ISSUE_TEMPLATE/feature_request.md +20 -0
- data/.gitignore +17 -0
- data/CHANGELOG.md +63 -0
- data/CODE_OF_CONDUCT.md +3 -0
- data/CONTRIBUTING.md +3 -0
- data/Gemfile +25 -0
- data/LICENSE +52 -0
- data/LICENSE.md +3 -0
- data/README.md +113 -0
- data/Rakefile +60 -0
- data/app/controllers/workarea/admin/orders_controller.decorator +6 -0
- data/app/controllers/workarea/storefront/application_controller.decorator +10 -0
- data/app/models/search/admin/order.decorator +7 -0
- data/app/models/workarea/checkout/collect_payment.decorator +75 -0
- data/app/models/workarea/forter/decision.rb +18 -0
- data/app/models/workarea/forter/response.rb +15 -0
- data/app/models/workarea/fulfillment.decorator +77 -0
- data/app/models/workarea/order/status/suspected_fraud.rb +13 -0
- data/app/models/workarea/order.decorator +14 -0
- data/app/models/workarea/payment/saved_credit_card.decorator +14 -0
- data/app/models/workarea/payment/status/suspected_fraud.rb +13 -0
- data/app/models/workarea/payment/tender/credit_card.decorator +25 -0
- data/app/models/workarea/payment.decorator +13 -0
- data/app/services/workarea/forter/account.rb +42 -0
- data/app/services/workarea/forter/order.rb +145 -0
- data/app/services/workarea/forter/payment.rb +80 -0
- data/app/services/workarea/forter/tender/credit_card.rb +73 -0
- data/app/services/workarea/forter/tender/general.rb +29 -0
- data/app/services/workarea/forter/tender/gift_card.rb +23 -0
- data/app/services/workarea/forter/tender/paypal.rb +38 -0
- data/app/services/workarea/forter/tender/store_credit.rb +23 -0
- data/app/view_models/workarea/admin/order_view_model.decorator +7 -0
- data/app/views/workarea/admin/orders/_forter.html.haml +18 -0
- data/app/views/workarea/admin/orders/forter.html.haml +57 -0
- data/app/views/workarea/storefront/_forter_tracking.html.haml +4 -0
- data/app/workers/forter/update_status.rb +21 -0
- data/app/workers/workarea/save_user_order_details.decorator +34 -0
- data/bin/rails +20 -0
- data/config/initializers/appends.rb +9 -0
- data/config/initializers/workarea.rb +22 -0
- data/config/locales/en.yml +26 -0
- data/config/routes.rb +7 -0
- data/lib/workarea/forter/bogus_gateway.rb +62 -0
- data/lib/workarea/forter/decision_response.rb +60 -0
- data/lib/workarea/forter/engine.rb +8 -0
- data/lib/workarea/forter/gateway.rb +66 -0
- data/lib/workarea/forter/version.rb +5 -0
- data/lib/workarea/forter.rb +50 -0
- data/test/dummy/Rakefile +6 -0
- data/test/dummy/bin/bundle +3 -0
- data/test/dummy/bin/rails +4 -0
- data/test/dummy/bin/rake +4 -0
- data/test/dummy/bin/setup +30 -0
- data/test/dummy/bin/update +26 -0
- data/test/dummy/bin/yarn +11 -0
- data/test/dummy/config/application.rb +30 -0
- data/test/dummy/config/boot.rb +5 -0
- data/test/dummy/config/cable.yml +10 -0
- data/test/dummy/config/environment.rb +5 -0
- data/test/dummy/config/environments/development.rb +51 -0
- data/test/dummy/config/environments/production.rb +88 -0
- data/test/dummy/config/environments/test.rb +44 -0
- data/test/dummy/config/initializers/application_controller_renderer.rb +8 -0
- data/test/dummy/config/initializers/assets.rb +14 -0
- data/test/dummy/config/initializers/backtrace_silencers.rb +7 -0
- data/test/dummy/config/initializers/cookies_serializer.rb +5 -0
- data/test/dummy/config/initializers/filter_parameter_logging.rb +4 -0
- data/test/dummy/config/initializers/inflections.rb +16 -0
- data/test/dummy/config/initializers/mime_types.rb +4 -0
- data/test/dummy/config/initializers/workarea.rb +5 -0
- data/test/dummy/config/initializers/wrap_parameters.rb +9 -0
- data/test/dummy/config/locales/en.yml +33 -0
- data/test/dummy/config/puma.rb +56 -0
- data/test/dummy/config/routes.rb +5 -0
- data/test/dummy/config/secrets.yml +32 -0
- data/test/dummy/config/spring.rb +6 -0
- data/test/dummy/config.ru +5 -0
- data/test/dummy/db/seeds.rb +2 -0
- data/test/dummy/log/.keep +0 -0
- data/test/factories/forter.rb +132 -0
- data/test/integration/workarea/admin/forter_order_integration_test.rb +36 -0
- data/test/integration/workarea/forter_authorize_cim_response_code_integration_test.rb +69 -0
- data/test/integration/workarea/forter_braintree_response_code_integration_test.rb +69 -0
- data/test/integration/workarea/forter_checkoutdotcom_integration_test.rb +71 -0
- data/test/integration/workarea/forter_cybersource_response_code_integration_test.rb +69 -0
- data/test/integration/workarea/forter_moneris_response_code_integration_test.rb +69 -0
- data/test/integration/workarea/forter_payflow_pro_response_code_test.rb +69 -0
- data/test/integration/workarea/storefront/forter_integration_test.rb +138 -0
- data/test/lib/workarea/forter/gateway_test.rb +47 -0
- data/test/models/workarea/checkout/forter_collect_payment_test.rb +60 -0
- data/test/models/workarea/forter_payment_test.rb +58 -0
- data/test/models/workarea/payment/forter_credit_card_test.rb +19 -0
- data/test/models/workarea/payment/forter_saved_credit_card_test.rb +32 -0
- data/test/services/workarea/forter/order_test.rb +82 -0
- data/test/support/workarea/forter_api_config.rb +27 -0
- data/test/system/workarea/admin/forter_system_test.rb +31 -0
- data/test/system/workarea/storefront/forter_braintree_checkout_system_test.rb +79 -0
- data/test/system/workarea/storefront/forter_tracking_system_test.rb +20 -0
- data/test/system/workarea/storefront/guest_checkout_system_test.decorator +43 -0
- data/test/teaspoon_env.rb +6 -0
- data/test/test_helper.rb +11 -0
- data/test/vcr_cassettes/forter/get_decision.yml +66 -0
- data/test/vcr_cassettes/forter/integration/authorize_net_response_code.yml +410 -0
- data/test/vcr_cassettes/forter/integration/braintree_response_code.yml +231 -0
- data/test/vcr_cassettes/forter/integration/checkoutdotcom_response_code.yml +129 -0
- data/test/vcr_cassettes/forter/integration/cyber_response_code.yml +199 -0
- data/test/vcr_cassettes/forter/integration/moneris_response_code.yml +84 -0
- data/test/vcr_cassettes/forter/integration/payflow_pro_response_code.yml +60 -0
- data/test/vcr_cassettes/forter/system/braintree_approved.yml +293 -0
- data/test/vcr_cassettes/forter/system/braintree_declined.yml +485 -0
- data/test/vcr_cassettes/forter/system/braintree_not_reviewed.yml +293 -0
- data/test/vcr_cassettes/forter/update_status.yml +182 -0
- data/test/view_models/workarea/storefront/order_view_model_test.decorator +10 -0
- data/test/workers/forter/update_status_test.rb +22 -0
- data/workarea-forter.gemspec +18 -0
- metadata +195 -0
@@ -0,0 +1,293 @@
|
|
1
|
+
---
|
2
|
+
http_interactions:
|
3
|
+
- request:
|
4
|
+
method: post
|
5
|
+
uri: https://api.sandbox.braintreegateway.com/merchants/qwrbf4nrdzhy93zr/transactions
|
6
|
+
body:
|
7
|
+
encoding: UTF-8
|
8
|
+
string: |
|
9
|
+
<?xml version="1.0" encoding="UTF-8"?>
|
10
|
+
<transaction>
|
11
|
+
<amount>12.84</amount>
|
12
|
+
<order-id>914188F6B5</order-id>
|
13
|
+
<customer>
|
14
|
+
<id></id>
|
15
|
+
<email>notreviewed@forter.com</email>
|
16
|
+
<phone nil="true"/>
|
17
|
+
<first-name>Ben</first-name>
|
18
|
+
<last-name>Crouse</last-name>
|
19
|
+
</customer>
|
20
|
+
<options>
|
21
|
+
<store-in-vault type="boolean">true</store-in-vault>
|
22
|
+
<submit-for-settlement nil="true"/>
|
23
|
+
<hold-in-escrow nil="true"/>
|
24
|
+
</options>
|
25
|
+
<custom-fields nil="true"/>
|
26
|
+
<merchant-account-id>weblinc</merchant-account-id>
|
27
|
+
<credit-card>
|
28
|
+
<number>4111111111111111</number>
|
29
|
+
<cvv>999</cvv>
|
30
|
+
<expiration-month>01</expiration-month>
|
31
|
+
<expiration-year>2020</expiration-year>
|
32
|
+
<cardholder-name>Ben Crouse</cardholder-name>
|
33
|
+
</credit-card>
|
34
|
+
<billing>
|
35
|
+
<street-address>22 S. 3rd St.</street-address>
|
36
|
+
<extended-address></extended-address>
|
37
|
+
<company nil="true"/>
|
38
|
+
<locality>Philadelphia</locality>
|
39
|
+
<region>PA</region>
|
40
|
+
<postal-code>19106</postal-code>
|
41
|
+
<country-code-alpha2>US</country-code-alpha2>
|
42
|
+
</billing>
|
43
|
+
<type>sale</type>
|
44
|
+
</transaction>
|
45
|
+
headers:
|
46
|
+
Accept-Encoding:
|
47
|
+
- gzip
|
48
|
+
Accept:
|
49
|
+
- application/xml
|
50
|
+
User-Agent:
|
51
|
+
- Braintree Ruby Gem 2.93.0 (ActiveMerchant 1.89.0)
|
52
|
+
X-Apiversion:
|
53
|
+
- '5'
|
54
|
+
Content-Type:
|
55
|
+
- application/xml
|
56
|
+
Authorization:
|
57
|
+
- Basic dzN2NmQ5eXRnajRqNG56ODplYjFmODliZTlmMzYzZjYxZmZmM2Y5MDI0NDQ1NmViMg==
|
58
|
+
response:
|
59
|
+
status:
|
60
|
+
code: 201
|
61
|
+
message: Created
|
62
|
+
headers:
|
63
|
+
Date:
|
64
|
+
- Fri, 18 Jan 2019 14:09:42 GMT
|
65
|
+
Content-Type:
|
66
|
+
- application/xml; charset=utf-8
|
67
|
+
Transfer-Encoding:
|
68
|
+
- chunked
|
69
|
+
X-Frame-Options:
|
70
|
+
- SAMEORIGIN
|
71
|
+
X-Xss-Protection:
|
72
|
+
- 1; mode=block
|
73
|
+
X-Content-Type-Options:
|
74
|
+
- nosniff
|
75
|
+
X-Authentication:
|
76
|
+
- basic_auth
|
77
|
+
X-User:
|
78
|
+
- nrkvc7nn7kyfbtm6
|
79
|
+
Vary:
|
80
|
+
- Accept-Encoding
|
81
|
+
Content-Encoding:
|
82
|
+
- gzip
|
83
|
+
Etag:
|
84
|
+
- W/"65dc768547474527d67d6689d840c52b"
|
85
|
+
Cache-Control:
|
86
|
+
- max-age=0, private, must-revalidate
|
87
|
+
X-Runtime:
|
88
|
+
- '0.484273'
|
89
|
+
X-Request-Id:
|
90
|
+
- 01-1547820582.259-173.161.162.1-10029041
|
91
|
+
Content-Security-Policy:
|
92
|
+
- frame-ancestors 'self'
|
93
|
+
X-Broxyid:
|
94
|
+
- 01-1547820582.259-173.161.162.1-10029041
|
95
|
+
Strict-Transport-Security:
|
96
|
+
- max-age=31536000; includeSubDomains
|
97
|
+
body:
|
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iWue43KzoDzPuAXh4want0l9/S2P+Mf179mceTxdrMr1//PiX+Ekf/zjrzk5Kb9KOXKT0dWJ2X0HJLkFd+lVuumg3xqHl0VWnQ0VX/wIAAP//AwBObu9WnhUAAA==
|
101
|
+
http_version:
|
102
|
+
recorded_at: Fri, 18 Jan 2019 14:09:42 GMT
|
103
|
+
- request:
|
104
|
+
method: get
|
105
|
+
uri: https://api.sandbox.braintreegateway.com/merchants/qwrbf4nrdzhy93zr/customers/552868996
|
106
|
+
body:
|
107
|
+
encoding: US-ASCII
|
108
|
+
string: ''
|
109
|
+
headers:
|
110
|
+
Accept-Encoding:
|
111
|
+
- gzip
|
112
|
+
Accept:
|
113
|
+
- application/xml
|
114
|
+
User-Agent:
|
115
|
+
- Braintree Ruby Gem 2.93.0 (ActiveMerchant 1.89.0)
|
116
|
+
X-Apiversion:
|
117
|
+
- '5'
|
118
|
+
Content-Type:
|
119
|
+
- application/xml
|
120
|
+
Authorization:
|
121
|
+
- Basic dzN2NmQ5eXRnajRqNG56ODplYjFmODliZTlmMzYzZjYxZmZmM2Y5MDI0NDQ1NmViMg==
|
122
|
+
response:
|
123
|
+
status:
|
124
|
+
code: 200
|
125
|
+
message: OK
|
126
|
+
headers:
|
127
|
+
Date:
|
128
|
+
- Fri, 18 Jan 2019 14:09:43 GMT
|
129
|
+
Content-Type:
|
130
|
+
- application/xml; charset=utf-8
|
131
|
+
Transfer-Encoding:
|
132
|
+
- chunked
|
133
|
+
X-Frame-Options:
|
134
|
+
- SAMEORIGIN
|
135
|
+
X-Xss-Protection:
|
136
|
+
- 1; mode=block
|
137
|
+
X-Content-Type-Options:
|
138
|
+
- nosniff
|
139
|
+
X-Authentication:
|
140
|
+
- basic_auth
|
141
|
+
X-User:
|
142
|
+
- nrkvc7nn7kyfbtm6
|
143
|
+
Vary:
|
144
|
+
- Accept-Encoding
|
145
|
+
Content-Encoding:
|
146
|
+
- gzip
|
147
|
+
Etag:
|
148
|
+
- W/"a4681feaf07fecc80e322919f4823364"
|
149
|
+
Cache-Control:
|
150
|
+
- max-age=0, private, must-revalidate
|
151
|
+
X-Runtime:
|
152
|
+
- '0.105817'
|
153
|
+
X-Request-Id:
|
154
|
+
- 01-1547820583.134-173.161.162.1-10029120
|
155
|
+
Content-Security-Policy:
|
156
|
+
- frame-ancestors 'self'
|
157
|
+
X-Broxyid:
|
158
|
+
- 01-1547820583.134-173.161.162.1-10029120
|
159
|
+
Strict-Transport-Security:
|
160
|
+
- max-age=31536000; includeSubDomains
|
161
|
+
body:
|
162
|
+
encoding: ASCII-8BIT
|
163
|
+
string: !binary |-
|
164
|
+
H4sIACfeQVwAA6RUS3ObMBC+51d4uMuA7Th2BiudtpOcemqTzuSSEWgxGguJ6GGb/PpKYB6Ok0MnnNjvsSza1SZ3x5JP9qA0k2ITxNMomIDIJGViuwke/9yjVXCHr5LMaiNLUPhqMkkYxdfXs9VytV4vk9BFHnRkVhBhkItfDyrNF0LRt6Jez99UEo5Zr86Z0gYJUgL+DiIJR7GnOemiH0paDUk4IJ7PZFkRUU8E45vAKAtB2OBQEsaxkEbBnsEB6LdcKgNq6gxJ2LJeVxVSwIU7J8cL7ACpZuZSmykgBigiZmLqCjYBdaFhJQR4FsVrFMUoXv2JF7fR+nYxe07CwdD4bUX/zz8Y2u83DUE5A051XxJlBmVEUX1KSpQideDZc75FHJYygRexf5LQv3e4FyGfAz8xTVz1fTxWFJJTUH0bJ12z3nO9R5Z+EBjh+FHshDy4zo+wQWaFUTWSOWJaWyIyGOsvyd74taa0OU6Tjs6nfAxfSLnMiHEXCD/+Hil7tNNTSJkZ/qQNBzInlneFp1JyICLAfuS8tCEHsVWuW0jB1nL/A6Ok75nOAseKqaYeVEphChy5ll+AH6hrIMod3yw6kzfomRro+9pzwv00nNheveUyJdwfZPZwf53+fbL0Ieb0odg/3693tDQSfv5KwkHWGQsg3BRuuEbjMMI6GSvJFpBVHBfGVPo2DInWYPQ0VYS52QHYupM5kNpvhbAidQnCvJRgCklfuNzKcO9mflqJ7R2IPVNSeMFGE0FTeXQLr8/ff9ENoluYKCViN5R2hnbSZo8tcHvjTkHHuVKU5KO70QG9QEFF2KjbHTAIJLVZs2VHmh7rZNqmOlOs8p08XxVhrzFyBwLT/a44zpOwjTrOCvZqAQlbps2NcMfD3CZSOJovouvVDcnnWTwn8+UqTfN1Bjc3SxovF6m7R59a+9xfW4xNjj2IUiJNd59MZM+PHMqV0d7XD0+k2RXj9XkG6AYhlCpwo3aRYFgK+OofAAAA//8DAJMZeL9yBwAA
|
165
|
+
http_version:
|
166
|
+
recorded_at: Fri, 18 Jan 2019 14:09:43 GMT
|
167
|
+
- request:
|
168
|
+
method: get
|
169
|
+
uri: https://api.sandbox.braintreegateway.com/merchants/qwrbf4nrdzhy93zr/customers/552868996
|
170
|
+
body:
|
171
|
+
encoding: US-ASCII
|
172
|
+
string: ''
|
173
|
+
headers:
|
174
|
+
Accept-Encoding:
|
175
|
+
- gzip
|
176
|
+
Accept:
|
177
|
+
- application/xml
|
178
|
+
User-Agent:
|
179
|
+
- Braintree Ruby Gem 2.93.0 (ActiveMerchant 1.89.0)
|
180
|
+
X-Apiversion:
|
181
|
+
- '5'
|
182
|
+
Content-Type:
|
183
|
+
- application/xml
|
184
|
+
Authorization:
|
185
|
+
- Basic dzN2NmQ5eXRnajRqNG56ODplYjFmODliZTlmMzYzZjYxZmZmM2Y5MDI0NDQ1NmViMg==
|
186
|
+
response:
|
187
|
+
status:
|
188
|
+
code: 200
|
189
|
+
message: OK
|
190
|
+
headers:
|
191
|
+
Date:
|
192
|
+
- Fri, 18 Jan 2019 14:09:44 GMT
|
193
|
+
Content-Type:
|
194
|
+
- application/xml; charset=utf-8
|
195
|
+
Transfer-Encoding:
|
196
|
+
- chunked
|
197
|
+
X-Frame-Options:
|
198
|
+
- SAMEORIGIN
|
199
|
+
X-Xss-Protection:
|
200
|
+
- 1; mode=block
|
201
|
+
X-Content-Type-Options:
|
202
|
+
- nosniff
|
203
|
+
X-Authentication:
|
204
|
+
- basic_auth
|
205
|
+
X-User:
|
206
|
+
- nrkvc7nn7kyfbtm6
|
207
|
+
Vary:
|
208
|
+
- Accept-Encoding
|
209
|
+
Content-Encoding:
|
210
|
+
- gzip
|
211
|
+
Etag:
|
212
|
+
- W/"d10d44ace4f07666cd057d1e46b10219"
|
213
|
+
Cache-Control:
|
214
|
+
- max-age=0, private, must-revalidate
|
215
|
+
X-Runtime:
|
216
|
+
- '0.210571'
|
217
|
+
X-Request-Id:
|
218
|
+
- 02-1547820583.623-173.161.162.1-8271151
|
219
|
+
Content-Security-Policy:
|
220
|
+
- frame-ancestors 'self'
|
221
|
+
X-Broxyid:
|
222
|
+
- 02-1547820583.623-173.161.162.1-8271151
|
223
|
+
Strict-Transport-Security:
|
224
|
+
- max-age=31536000; includeSubDomains
|
225
|
+
body:
|
226
|
+
encoding: ASCII-8BIT
|
227
|
+
string: !binary |-
|
228
|
+
H4sIACjeQVwAA6RUS3ObMBC+51d4uMuA7Th2BiudtpOcemqTzuSSEWgxGguJ6GGb/PpKYB6Ok0MnnNjvsSza1SZ3x5JP9qA0k2ITxNMomIDIJGViuwke/9yjVXCHr5LMaiNLUPhqMkkYxdfXs9VytV4vk9BFHnRkVhBhkItfDyrNF0LRt6Jez99UEo5Zr86Z0gYJUgL+DiIJR7GnOemiH0paDUk4IJ7PZFkRUU8E45vAKAtB2OBQEsaxkEbBnsEB6LdcKgNq6gxJ2LJeVxVSwIU7J8cL7ACpZuZSmykgBigiZmLqCjYBdaFhJQR4FsVrFMUoXv2JF7fR+nYxe07CwdD4bUX/zz8Y2u83DUE5A051XxJlBmVEUX1KSpQideDZc75FHJYygRexf5LQv3e4FyGfAz8xTVz1fTxWFJJTUH0bJ12z3nO9R5Z+EBjh+FHshDy4zo+wQWaFUTWSOWJaWyIyGOsvyd74taa0OU6Tjs6nfAxfSLnMiHEXCD/+Hil7tNNTSJkZ/qQNBzInlneFp1JyICLAfuS8tCEHsVWuW0jB1nL/A6Ok75nOAseKqaYeVEphChy5ll+AH6hrIMod3yw6kzfomRro+9pzwv00nNheveUyJdwfZPZwf53+fbL0Ieb0odg/3693tDQSfv5KwkHWGQsg3BRuuEbjMMI6GSvJFpBVHBfGVPo2DInWYPQ0VYS52QHYupM5kNpvhbAidQnCvJRgCklfuNzKcO9mflqJ7R2IPVNSeMFGE0FTeXQLr8/ff9ENoluYKCViN5R2hnbSZo8tcHvjTkHHuVKU5KO70QG9QEFF2KjbHTAIJLVZs2VHmh7rZNqmOlOs8p08XxVhrzFyBwLT/a44zpOwjTrOCvZqAQlbps2NcMfD3CZSOJovouvVDcnnWTwn8+UqTfN1Bjc3SxovF6m7R59a+9xfW4xNjj2IUiJNd59MZM+PHMqV0d7XD0+k2RXj9XkG6AYhlCpwo3aRYFgK+OofAAAA//8DAJMZeL9yBwAA
|
229
|
+
http_version:
|
230
|
+
recorded_at: Fri, 18 Jan 2019 14:09:44 GMT
|
231
|
+
- request:
|
232
|
+
method: post
|
233
|
+
uri: https://api.forter-secure.com/v2/orders/914188F6B5
|
234
|
+
body:
|
235
|
+
encoding: UTF-8
|
236
|
+
string: '{"orderId":"914188F6B5","orderType":"WEB","timeSentToForter":1547820585000,"checkoutTime":0,"primaryRecipient":{"personalDetails":{"firstName":"Ben","lastName":"Crouse"},"address":{"address1":"22
|
237
|
+
S. 3rd St.","city":"Philadelphia","country":"US","address2":"","zip":"19106","region":"PA"},"phone":[{"phone":"2159251800"}]},"totalAmount":{"amountUSD":"12.84"},"connectionInformation":{"customerIP":"127.0.0.1","userAgent":"Mozilla/5.0
|
238
|
+
(Macintosh; Intel Mac OS X 10_14_2) AppleWebKit/537.36 (KHTML, like Gecko)
|
239
|
+
HeadlessChrome/71.0.3578.98 Safari/537.36","forterTokenCookie":null},"primaryDeliveryDetails":{"deliveryType":"PHYSICAL","deliveryMethod":"Ground","deliveryPrice":{"amountUSD":"7.00"},"carrier":null},"cartItems":[{"basicItemData":{"name":"Integration
|
240
|
+
Product","quantity":1,"type":"TANGIBLE","price":{"amountUSD":"5.00"},"productId":"INT_PRODUCT"}}],"payment":[{"tokenizedCard":{"token":"dvkhx3","lastFourDigits":"1111","expirationMonth":"01","expirationYear":"2020","cardBrand":"Visa","nameOnCard":"Ben
|
241
|
+
Crouse"},"billingDetails":{"personalDetails":{"firstName":"Ben","lastName":"Crouse"},"address":{"address1":"22
|
242
|
+
S. 3rd St.","address2":"","city":"Philadelphia","country":"US","zip":"19106","region":"PA"},"phone":[{"phone":"2159251800"}]}}],"accountOwner":{"firstName":"Ben","lastName":"Crouse","email":"notreviewed@forter.com"},"totalDiscount":null}'
|
243
|
+
headers:
|
244
|
+
Content-Type:
|
245
|
+
- application/json
|
246
|
+
X-Forter-Siteid:
|
247
|
+
- 4d12ac5d794c
|
248
|
+
Api-Version:
|
249
|
+
- '2.3'
|
250
|
+
User-Agent:
|
251
|
+
- Faraday v0.15.4
|
252
|
+
Authorization:
|
253
|
+
- Basic a
|
254
|
+
Accept-Encoding:
|
255
|
+
- gzip;q=1.0,deflate;q=0.6,identity;q=0.3
|
256
|
+
Accept:
|
257
|
+
- "*/*"
|
258
|
+
response:
|
259
|
+
status:
|
260
|
+
code: 200
|
261
|
+
message: OK
|
262
|
+
headers:
|
263
|
+
Date:
|
264
|
+
- Fri, 18 Jan 2019 14:09:45 GMT
|
265
|
+
Content-Type:
|
266
|
+
- application/json; charset=utf-8
|
267
|
+
Content-Length:
|
268
|
+
- '169'
|
269
|
+
Connection:
|
270
|
+
- keep-alive
|
271
|
+
Server:
|
272
|
+
- openresty
|
273
|
+
Strict-Transport-Security:
|
274
|
+
- max-age=86400; includeSubDomains
|
275
|
+
Surrogate-Control:
|
276
|
+
- no-store
|
277
|
+
Cache-Control:
|
278
|
+
- no-store, no-cache, must-revalidate, proxy-revalidate
|
279
|
+
Pragma:
|
280
|
+
- no-cache
|
281
|
+
Expires:
|
282
|
+
- '0'
|
283
|
+
Etag:
|
284
|
+
- W/"a9-434ZSbLxfHEHgpfb5jNMq4h3/P8"
|
285
|
+
Vary:
|
286
|
+
- Accept-Encoding
|
287
|
+
body:
|
288
|
+
encoding: UTF-8
|
289
|
+
string: '{"status":"success","transaction":"914188F6B5","action":"not reviewed","message":"
|
290
|
+
| Link in portal: https://portal.forter.com/dashboard/914188F6B5","reasonCode":"Test"}'
|
291
|
+
http_version:
|
292
|
+
recorded_at: Fri, 18 Jan 2019 14:09:45 GMT
|
293
|
+
recorded_with: VCR 2.9.3
|
@@ -0,0 +1,182 @@
|
|
1
|
+
---
|
2
|
+
http_interactions:
|
3
|
+
- request:
|
4
|
+
method: post
|
5
|
+
uri: https://api.forter-secure.com/v2/orders/statusfortertest12345
|
6
|
+
body:
|
7
|
+
encoding: UTF-8
|
8
|
+
string: '{"orderId":"statusfortertest12345","orderType":"WEB","timeSentToForter":1546030401000,"checkoutTime":1546030397,"primaryRecipient":{"personalDetails":{"firstName":"Ben","lastName":"Crouse"},"address":{"address1":"22
|
9
|
+
S. 3rd St.","city":"Philadelphia","country":"US","address2":"Second Floor","zip":"19106","region":"PA"},"phone":[{"phone":""}]},"totalAmount":{"amountUSD":"11.00"},"connectionInformation":{"customerIP":"127.0.0.1","userAgent":"Mozilla/5.0
|
10
|
+
(Windows NT 6.1; Win64; x64; rv:47.0) Gecko/20100101 Firefox/47.0 Mozilla/5.0
|
11
|
+
(Macintosh; Intel Mac OS X x.y; rv:42.0) Gecko/20100101 Firefox/42.0."},"primaryDeliveryDetails":{"deliveryType":"PHYSICAL","deliveryMethod":"Test
|
12
|
+
0","deliveryPrice":{"amountUSD":"1.00"},"carrier":null},"cartItems":[{"basicItemData":{"name":"Test
|
13
|
+
Product","quantity":2,"type":"TANGIBLE","price":{"amountUSD":"10.00"},"productId":"BCE0E155EF"}}],"payment":[{"billingDetails":{"personalDetails":{"firstName":"Ben","lastName":"Crouse"},"address":{"address1":"22
|
14
|
+
S. 3rd St.","address2":"Second Floor","city":"Philadelphia","country":"US","zip":"19106","region":"PA"},"phone":[{"phone":""}]},"tokenizedCard":{"token":"1","lastFourDigits":"1111","expirationMonth":"01","expirationYear":"2019","cardBrand":"Visa","nameOnCard":"Ben
|
15
|
+
Crouse"}}],"accountOwner":{"firstName":"Ben","lastName":"Crouse","email":"approve@forter.com"}}'
|
16
|
+
headers:
|
17
|
+
Content-Type:
|
18
|
+
- application/json
|
19
|
+
Api-Version:
|
20
|
+
- '2.2'
|
21
|
+
User-Agent:
|
22
|
+
- Faraday v0.15.4
|
23
|
+
Authorization:
|
24
|
+
- Basic a
|
25
|
+
Accept-Encoding:
|
26
|
+
- gzip;q=1.0,deflate;q=0.6,identity;q=0.3
|
27
|
+
Accept:
|
28
|
+
- "*/*"
|
29
|
+
response:
|
30
|
+
status:
|
31
|
+
code: 401
|
32
|
+
message: Unauthorized
|
33
|
+
headers:
|
34
|
+
Date:
|
35
|
+
- Fri, 28 Dec 2018 20:53:21 GMT
|
36
|
+
Content-Type:
|
37
|
+
- application/json; charset=utf-8
|
38
|
+
Content-Length:
|
39
|
+
- '58'
|
40
|
+
Connection:
|
41
|
+
- keep-alive
|
42
|
+
Server:
|
43
|
+
- openresty
|
44
|
+
Strict-Transport-Security:
|
45
|
+
- max-age=86400; includeSubDomains
|
46
|
+
Surrogate-Control:
|
47
|
+
- no-store
|
48
|
+
Cache-Control:
|
49
|
+
- no-store, no-cache, must-revalidate, proxy-revalidate
|
50
|
+
Pragma:
|
51
|
+
- no-cache
|
52
|
+
Expires:
|
53
|
+
- '0'
|
54
|
+
Etag:
|
55
|
+
- W/"3a-ZqDAtEqlVbaEf6c/ziI5qiLtZfk"
|
56
|
+
Vary:
|
57
|
+
- Accept-Encoding
|
58
|
+
body:
|
59
|
+
encoding: UTF-8
|
60
|
+
string: '{"status":"failed","message":"unauthorized, invalid site"}'
|
61
|
+
http_version:
|
62
|
+
recorded_at: Fri, 28 Dec 2018 20:53:21 GMT
|
63
|
+
- request:
|
64
|
+
method: post
|
65
|
+
uri: https://api.forter-secure.com/v2/orders/statusfortertest12345
|
66
|
+
body:
|
67
|
+
encoding: UTF-8
|
68
|
+
string: '{"orderId":"statusfortertest12345","orderType":"WEB","timeSentToForter":1546030401000,"checkoutTime":1546030397,"primaryRecipient":{"personalDetails":{"firstName":"Ben","lastName":"Crouse"},"address":{"address1":"22
|
69
|
+
S. 3rd St.","city":"Philadelphia","country":"US","address2":"Second Floor","zip":"19106","region":"PA"},"phone":[{"phone":""}]},"totalAmount":{"amountUSD":"11.00"},"connectionInformation":{"customerIP":"127.0.0.1","userAgent":"Mozilla/5.0
|
70
|
+
(Windows NT 6.1; Win64; x64; rv:47.0) Gecko/20100101 Firefox/47.0 Mozilla/5.0
|
71
|
+
(Macintosh; Intel Mac OS X x.y; rv:42.0) Gecko/20100101 Firefox/42.0."},"primaryDeliveryDetails":{"deliveryType":"PHYSICAL","deliveryMethod":"Test
|
72
|
+
0","deliveryPrice":{"amountUSD":"1.00"},"carrier":null},"cartItems":[{"basicItemData":{"name":"Test
|
73
|
+
Product","quantity":2,"type":"TANGIBLE","price":{"amountUSD":"10.00"},"productId":"BCE0E155EF"}}],"payment":[{"billingDetails":{"personalDetails":{"firstName":"Ben","lastName":"Crouse"},"address":{"address1":"22
|
74
|
+
S. 3rd St.","address2":"Second Floor","city":"Philadelphia","country":"US","zip":"19106","region":"PA"},"phone":[{"phone":""}]},"tokenizedCard":{"token":"1","lastFourDigits":"1111","expirationMonth":"01","expirationYear":"2019","cardBrand":"Visa","nameOnCard":"Ben
|
75
|
+
Crouse"}}],"accountOwner":{"firstName":"Ben","lastName":"Crouse","email":"approve@forter.com"}}'
|
76
|
+
headers:
|
77
|
+
Content-Type:
|
78
|
+
- application/json
|
79
|
+
X-Forter-Siteid:
|
80
|
+
- 4d12ac5d794c
|
81
|
+
Api-Version:
|
82
|
+
- '2.2'
|
83
|
+
User-Agent:
|
84
|
+
- Faraday v0.15.4
|
85
|
+
Authorization:
|
86
|
+
- Basic a
|
87
|
+
Accept-Encoding:
|
88
|
+
- gzip;q=1.0,deflate;q=0.6,identity;q=0.3
|
89
|
+
Accept:
|
90
|
+
- "*/*"
|
91
|
+
response:
|
92
|
+
status:
|
93
|
+
code: 200
|
94
|
+
message: OK
|
95
|
+
headers:
|
96
|
+
Date:
|
97
|
+
- Fri, 28 Dec 2018 20:53:21 GMT
|
98
|
+
Content-Type:
|
99
|
+
- application/json; charset=utf-8
|
100
|
+
Content-Length:
|
101
|
+
- '186'
|
102
|
+
Connection:
|
103
|
+
- keep-alive
|
104
|
+
Server:
|
105
|
+
- openresty
|
106
|
+
Strict-Transport-Security:
|
107
|
+
- max-age=86400; includeSubDomains
|
108
|
+
Surrogate-Control:
|
109
|
+
- no-store
|
110
|
+
Cache-Control:
|
111
|
+
- no-store, no-cache, must-revalidate, proxy-revalidate
|
112
|
+
Pragma:
|
113
|
+
- no-cache
|
114
|
+
Expires:
|
115
|
+
- '0'
|
116
|
+
Etag:
|
117
|
+
- W/"ba-Ef/isk7mEOWPRXN9i4trCjru7vk"
|
118
|
+
Vary:
|
119
|
+
- Accept-Encoding
|
120
|
+
body:
|
121
|
+
encoding: UTF-8
|
122
|
+
string: '{"status":"success","transaction":"statusfortertest12345","action":"approve","message":"
|
123
|
+
| Link in portal: https://portal.forter.com/dashboard/statusfortertest12345","reasonCode":"Test"}'
|
124
|
+
http_version:
|
125
|
+
recorded_at: Fri, 28 Dec 2018 20:53:21 GMT
|
126
|
+
- request:
|
127
|
+
method: put
|
128
|
+
uri: https://api.forter-secure.com/v2/status/statusfortertest12345
|
129
|
+
body:
|
130
|
+
encoding: UTF-8
|
131
|
+
string: '{"orderId":"statusfortertest12345","eventTime":1546030401000,"updatedStatus":"CANCELED_BY_MERCHANT"}'
|
132
|
+
headers:
|
133
|
+
Content-Type:
|
134
|
+
- application/json
|
135
|
+
X-Forter-Siteid:
|
136
|
+
- 4d12ac5d794c
|
137
|
+
Api-Version:
|
138
|
+
- '2.2'
|
139
|
+
User-Agent:
|
140
|
+
- Faraday v0.15.4
|
141
|
+
Authorization:
|
142
|
+
- Basic a
|
143
|
+
Accept-Encoding:
|
144
|
+
- gzip;q=1.0,deflate;q=0.6,identity;q=0.3
|
145
|
+
Accept:
|
146
|
+
- "*/*"
|
147
|
+
response:
|
148
|
+
status:
|
149
|
+
code: 200
|
150
|
+
message: OK
|
151
|
+
headers:
|
152
|
+
Date:
|
153
|
+
- Fri, 28 Dec 2018 20:53:21 GMT
|
154
|
+
Content-Type:
|
155
|
+
- application/json; charset=utf-8
|
156
|
+
Content-Length:
|
157
|
+
- '83'
|
158
|
+
Connection:
|
159
|
+
- keep-alive
|
160
|
+
Server:
|
161
|
+
- openresty
|
162
|
+
Strict-Transport-Security:
|
163
|
+
- max-age=86400; includeSubDomains
|
164
|
+
Surrogate-Control:
|
165
|
+
- no-store
|
166
|
+
Cache-Control:
|
167
|
+
- no-store, no-cache, must-revalidate, proxy-revalidate
|
168
|
+
Pragma:
|
169
|
+
- no-cache
|
170
|
+
Expires:
|
171
|
+
- '0'
|
172
|
+
Etag:
|
173
|
+
- W/"53-bIIPJPDkazv+tEVJKCKU0pv7x9A"
|
174
|
+
Vary:
|
175
|
+
- Accept-Encoding
|
176
|
+
body:
|
177
|
+
encoding: UTF-8
|
178
|
+
string: '{"status":"success","message":"Transaction #statusfortertest12345 status
|
179
|
+
recieved"}'
|
180
|
+
http_version:
|
181
|
+
recorded_at: Fri, 28 Dec 2018 20:53:21 GMT
|
182
|
+
recorded_with: VCR 2.9.3
|
@@ -0,0 +1,22 @@
|
|
1
|
+
require 'test_helper'
|
2
|
+
|
3
|
+
module Workarea
|
4
|
+
class Forter::UpdateStatusTest < TestCase
|
5
|
+
|
6
|
+
def test_decision_status_update
|
7
|
+
decision = Workarea::Forter::Decision.create(id: '1234')
|
8
|
+
|
9
|
+
details_hash = {
|
10
|
+
orderId: 1234,
|
11
|
+
eventTime: Time.new.to_i * 1000,
|
12
|
+
updatedStatus: "CANCELED_BY_MERCHANT"
|
13
|
+
}
|
14
|
+
|
15
|
+
Workarea::Forter::UpdateStatus.new.perform(decision.id, details_hash)
|
16
|
+
|
17
|
+
decision.reload
|
18
|
+
|
19
|
+
assert_equal("CANCELED_BY_MERCHANT", decision.external_order_status)
|
20
|
+
end
|
21
|
+
end
|
22
|
+
end
|
@@ -0,0 +1,18 @@
|
|
1
|
+
$:.push File.expand_path("../lib", __FILE__)
|
2
|
+
|
3
|
+
require "workarea/forter/version"
|
4
|
+
|
5
|
+
Gem::Specification.new do |s|
|
6
|
+
s.name = "workarea-forter"
|
7
|
+
s.version = Workarea::Forter::VERSION
|
8
|
+
s.authors = ["Jeff Yucis"]
|
9
|
+
s.email = ["jyucis@weblinc.com"]
|
10
|
+
s.homepage = "https://github.com/workarea-commerce/workarea-forter"
|
11
|
+
s.summary = "Forter Fraud Protection integration with Workarea"
|
12
|
+
s.description = "Forter Integration with Workarea for Fraud Protection "
|
13
|
+
s.files = `git ls-files`.split("\n")
|
14
|
+
s.license = 'Business Software License'
|
15
|
+
|
16
|
+
s.add_dependency 'workarea', '~> 3.x', '>= 3.4'
|
17
|
+
s.add_dependency 'faraday'
|
18
|
+
end
|