workarea-checkoutdotcom 1.2.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (84) hide show
  1. checksums.yaml +7 -0
  2. data/.eslintrc +24 -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/.github/workflows/ci.yml +54 -0
  7. data/.gitignore +23 -0
  8. data/.rubocop.yml +3 -0
  9. data/.stylelintrc.json +8 -0
  10. data/CHANGELOG.md +59 -0
  11. data/Gemfile +6 -0
  12. data/README.md +74 -0
  13. data/Rakefile +60 -0
  14. data/app/lib/active_merchant/billing/gateways/checkout_v2.decorator +22 -0
  15. data/app/models/workarea/payment/authorize/credit_card.decorator +41 -0
  16. data/app/models/workarea/payment/purchase/credit_card.decorator +44 -0
  17. data/app/models/workarea/payment/store_credit_card.decorator +17 -0
  18. data/bin/rails +20 -0
  19. data/config/initializers/workarea.rb +1 -0
  20. data/lib/active_merchant/billing/bogus_checkout_v2_gateway.rb +42 -0
  21. data/lib/workarea/checkoutdotcom.rb +46 -0
  22. data/lib/workarea/checkoutdotcom/engine.rb +8 -0
  23. data/lib/workarea/checkoutdotcom/version.rb +5 -0
  24. data/script/admin_ci +9 -0
  25. data/script/ci +11 -0
  26. data/script/core_ci +9 -0
  27. data/script/plugins_ci +9 -0
  28. data/script/storefront_ci +9 -0
  29. data/test/dummy/Rakefile +6 -0
  30. data/test/dummy/bin/bundle +3 -0
  31. data/test/dummy/bin/rails +4 -0
  32. data/test/dummy/bin/rake +4 -0
  33. data/test/dummy/bin/setup +30 -0
  34. data/test/dummy/bin/update +26 -0
  35. data/test/dummy/bin/yarn +11 -0
  36. data/test/dummy/config.ru +5 -0
  37. data/test/dummy/config/application.rb +30 -0
  38. data/test/dummy/config/boot.rb +5 -0
  39. data/test/dummy/config/cable.yml +10 -0
  40. data/test/dummy/config/environment.rb +5 -0
  41. data/test/dummy/config/environments/development.rb +51 -0
  42. data/test/dummy/config/environments/production.rb +88 -0
  43. data/test/dummy/config/environments/test.rb +44 -0
  44. data/test/dummy/config/initializers/application_controller_renderer.rb +8 -0
  45. data/test/dummy/config/initializers/assets.rb +14 -0
  46. data/test/dummy/config/initializers/backtrace_silencers.rb +7 -0
  47. data/test/dummy/config/initializers/cookies_serializer.rb +5 -0
  48. data/test/dummy/config/initializers/filter_parameter_logging.rb +4 -0
  49. data/test/dummy/config/initializers/inflections.rb +16 -0
  50. data/test/dummy/config/initializers/mime_types.rb +4 -0
  51. data/test/dummy/config/initializers/workarea.rb +5 -0
  52. data/test/dummy/config/initializers/wrap_parameters.rb +9 -0
  53. data/test/dummy/config/locales/en.yml +33 -0
  54. data/test/dummy/config/puma.rb +56 -0
  55. data/test/dummy/config/routes.rb +5 -0
  56. data/test/dummy/config/secrets.yml +32 -0
  57. data/test/dummy/config/spring.rb +6 -0
  58. data/test/dummy/db/seeds.rb +2 -0
  59. data/test/dummy/log/.keep +0 -0
  60. data/test/models/workarea/payment/authorize/credit_card_test.decorator +38 -0
  61. data/test/models/workarea/payment/capture_test.decorator +27 -0
  62. data/test/models/workarea/payment/checkoutdotcom_integration_test.rb +178 -0
  63. data/test/models/workarea/payment/credit_card_integration_test.decorator +107 -0
  64. data/test/models/workarea/payment/purchase/credit_card_test.decorator +38 -0
  65. data/test/models/workarea/payment/refund_test.decorator +27 -0
  66. data/test/support/workarea/checkoutdotcom_gateway_vcr_config.rb +20 -0
  67. data/test/support/workarea/workarea_3_2_backports.rb +57 -0
  68. data/test/teaspoon_env.rb +6 -0
  69. data/test/test_helper.rb +10 -0
  70. data/test/vcr_cassettes/checkoutdotcom/auth_capture.yml +154 -0
  71. data/test/vcr_cassettes/checkoutdotcom/auth_capture_refund.yml +225 -0
  72. data/test/vcr_cassettes/checkoutdotcom/auth_void.yml +154 -0
  73. data/test/vcr_cassettes/checkoutdotcom/purchase_refund.yml +225 -0
  74. data/test/vcr_cassettes/checkoutdotcom/store_auth.yml +83 -0
  75. data/test/vcr_cassettes/checkoutdotcom/store_purchase.yml +154 -0
  76. data/test/vcr_cassettes/credit_card/auth_capture.yml +154 -0
  77. data/test/vcr_cassettes/credit_card/auth_capture_refund.yml +225 -0
  78. data/test/vcr_cassettes/credit_card/auth_void.yml +154 -0
  79. data/test/vcr_cassettes/credit_card/purchase_refund.yml +225 -0
  80. data/test/vcr_cassettes/credit_card/store_auth.yml +83 -0
  81. data/test/vcr_cassettes/credit_card/store_purchase.yml +154 -0
  82. data/test/workers/workarea/send_refund_email_test.decorator +27 -0
  83. data/workarea-checkoutdotcom.gemspec +19 -0
  84. metadata +144 -0
@@ -0,0 +1,154 @@
1
+ ---
2
+ http_interactions:
3
+ - request:
4
+ method: post
5
+ uri: https://api.sandbox.checkout.com/payments
6
+ body:
7
+ encoding: UTF-8
8
+ string: '{"capture":false,"amount":"500","reference":null,"currency":"USD","metadata":{"udf5":"ActiveMerchant"},"source":{"type":"card","name":"Ben
9
+ Crouse","number":"4242424242424242","cvv":100,"expiry_year":"2020","expiry_month":"01","billing_address":{"address_line1":"22
10
+ s. 3rd st.","city":"Philadelphia","state":"PA","country":"US","zip":"19106"}},"customer":{"email":null}}'
11
+ headers:
12
+ Content-Type:
13
+ - application/json;charset=UTF-8
14
+ Authorization:
15
+ - sk_test_f4c1d728-928c-4381-bc6b-03c0888fb877
16
+ Connection:
17
+ - close
18
+ Accept-Encoding:
19
+ - gzip;q=1.0,deflate;q=0.6,identity;q=0.3
20
+ Accept:
21
+ - "*/*"
22
+ User-Agent:
23
+ - Ruby
24
+ response:
25
+ status:
26
+ code: 201
27
+ message: Created
28
+ headers:
29
+ Connection:
30
+ - close
31
+ Content-Length:
32
+ - '1485'
33
+ Cache-Control:
34
+ - no-cache
35
+ Pragma:
36
+ - no-cache
37
+ Content-Type:
38
+ - application/json; charset=utf-8
39
+ Expires:
40
+ - "-1"
41
+ Location:
42
+ - https://api.sandbox.checkout.com/payments/pay_xxhlbitzb4zuboi5hra7qvfzc4
43
+ Product:
44
+ - Gateway
45
+ Cko-Version:
46
+ - 3.32.9
47
+ Cko-Request-Id:
48
+ - 67f0568d-0104-43b1-a2c0-9f6fd25d7789
49
+ Access-Control-Allow-Origin:
50
+ - "*"
51
+ Access-Control-Allow-Headers:
52
+ - Origin,X-Requested-With,Content-Type,Accept,X-AuthToken,Access-Control-Request-Method,Access-Control-Allow-Methods,Access-Control-Request-Headers,authorization,X_Auth_Credentials
53
+ Access-Control-Allow-Methods:
54
+ - OPTIONS,POST,GET,PUT,DELETE
55
+ Access-Control-Request-Method:
56
+ - OPTIONS,POST,GET,PUT,DELETE
57
+ Access-Control-Request-Headers:
58
+ - authorization
59
+ Accept-Ranges:
60
+ - bytes
61
+ Date:
62
+ - Tue, 19 Nov 2019 20:48:15 GMT
63
+ Via:
64
+ - 1.1 varnish
65
+ X-Served-By:
66
+ - cache-lga21946-LGA
67
+ X-Cache:
68
+ - MISS
69
+ X-Cache-Hits:
70
+ - '0'
71
+ X-Timer:
72
+ - S1574196495.699457,VS0,VE425
73
+ body:
74
+ encoding: UTF-8
75
+ string: '{"id":"pay_xxhlbitzb4zuboi5hra7qvfzc4","action_id":"act_xxhlbitzb4zuboi5hra7qvfzc4","amount":500,"currency":"USD","approved":true,"status":"Authorized","auth_code":"273451","eci":"05","scheme_id":"569047975377424","response_code":"10000","response_summary":"Approved","risk":{"flagged":false},"source":{"id":"src_tmywhzv2tg4epbpcjxq4hrpwnu","type":"card","billing_address":{"address_line1":"22
76
+ s. 3rd st.","city":"Philadelphia","state":"PA","zip":"19106","country":"US"},"expiry_month":1,"expiry_year":2020,"name":"Ben
77
+ Crouse","scheme":"Visa","last4":"4242","fingerprint":"A24ADA27CDDFF03B3607A0E4EA30E189F84B198ABDB346E39C3619982E7474AD","bin":"424242","card_type":"Credit","card_category":"Consumer","issuer":"JPMORGAN
78
+ CHASE BANK NA","issuer_country":"US","product_id":"A","product_type":"Visa
79
+ Traditional","avs_check":"S","cvv_check":"Y","payouts":true,"fast_funds":"d"},"customer":{"id":"cus_ekiiy35rwvuezimk4v6atcernq","name":"Ben
80
+ Crouse"},"processed_on":"2019-11-19T20:48:15Z","processing":{"acquirer_transaction_id":"3086866314","retrieval_reference_number":"129718838535"},"_links":{"self":{"href":"https://api.sandbox.checkout.com/payments/pay_xxhlbitzb4zuboi5hra7qvfzc4"},"actions":{"href":"https://api.sandbox.checkout.com/payments/pay_xxhlbitzb4zuboi5hra7qvfzc4/actions"},"capture":{"href":"https://api.sandbox.checkout.com/payments/pay_xxhlbitzb4zuboi5hra7qvfzc4/captures"},"void":{"href":"https://api.sandbox.checkout.com/payments/pay_xxhlbitzb4zuboi5hra7qvfzc4/voids"}}}'
81
+ http_version:
82
+ recorded_at: Tue, 19 Nov 2019 20:48:15 GMT
83
+ - request:
84
+ method: post
85
+ uri: https://api.sandbox.checkout.com/payments/pay_xxhlbitzb4zuboi5hra7qvfzc4/captures
86
+ body:
87
+ encoding: UTF-8
88
+ string: '{"amount":"500","reference":null,"currency":"USD","metadata":{"udf5":"ActiveMerchant"},"customer":{"email":null}}'
89
+ headers:
90
+ Content-Type:
91
+ - application/json;charset=UTF-8
92
+ Authorization:
93
+ - sk_test_f4c1d728-928c-4381-bc6b-03c0888fb877
94
+ Connection:
95
+ - close
96
+ Accept-Encoding:
97
+ - gzip;q=1.0,deflate;q=0.6,identity;q=0.3
98
+ Accept:
99
+ - "*/*"
100
+ User-Agent:
101
+ - Ruby
102
+ response:
103
+ status:
104
+ code: 202
105
+ message: Accepted
106
+ headers:
107
+ Connection:
108
+ - close
109
+ Content-Length:
110
+ - '151'
111
+ Cache-Control:
112
+ - no-cache
113
+ Pragma:
114
+ - no-cache
115
+ Content-Type:
116
+ - application/json; charset=utf-8
117
+ Expires:
118
+ - "-1"
119
+ Product:
120
+ - Gateway
121
+ Cko-Version:
122
+ - 3.32.9
123
+ Cko-Request-Id:
124
+ - 0cb3589d-97f5-4a02-ac27-27cc18ba52fc
125
+ Access-Control-Allow-Origin:
126
+ - "*"
127
+ Access-Control-Allow-Headers:
128
+ - Origin,X-Requested-With,Content-Type,Accept,X-AuthToken,Access-Control-Request-Method,Access-Control-Allow-Methods,Access-Control-Request-Headers,authorization,X_Auth_Credentials
129
+ Access-Control-Allow-Methods:
130
+ - OPTIONS,POST,GET,PUT,DELETE
131
+ Access-Control-Request-Method:
132
+ - OPTIONS,POST,GET,PUT,DELETE
133
+ Access-Control-Request-Headers:
134
+ - authorization
135
+ Accept-Ranges:
136
+ - bytes
137
+ Date:
138
+ - Tue, 19 Nov 2019 20:48:15 GMT
139
+ Via:
140
+ - 1.1 varnish
141
+ X-Served-By:
142
+ - cache-lga21939-LGA
143
+ X-Cache:
144
+ - MISS
145
+ X-Cache-Hits:
146
+ - '0'
147
+ X-Timer:
148
+ - S1574196495.281584,VS0,VE608
149
+ body:
150
+ encoding: UTF-8
151
+ string: '{"action_id":"act_dozja76gzkbu7ixz3ha75mlyk4","_links":{"payment":{"href":"https://api.sandbox.checkout.com/payments/pay_xxhlbitzb4zuboi5hra7qvfzc4"}}}'
152
+ http_version:
153
+ recorded_at: Tue, 19 Nov 2019 20:48:15 GMT
154
+ recorded_with: VCR 2.9.3
@@ -0,0 +1,27 @@
1
+ module Workarea
2
+ decorate SendRefundEmailTest, with: :checkoutdotcom do
3
+ def payment
4
+ @payment ||=
5
+ create_payment(id: order.id, profile: create_payment_profile).tap do |payment|
6
+ payment.set_address(
7
+ first_name: 'Ben',
8
+ last_name: 'Crouse',
9
+ street: '22 S. 3rd St.',
10
+ city: 'Philadelphia',
11
+ region: 'PA',
12
+ postal_code: '19106',
13
+ country: 'US',
14
+ phone_number: '2159251800'
15
+ )
16
+
17
+ payment.set_credit_card(
18
+ number: '1',
19
+ month: 1,
20
+ year: Time.current.year + 1,
21
+ cvv: '999',
22
+ amount: 5.to_m
23
+ )
24
+ end
25
+ end
26
+ end
27
+ end
@@ -0,0 +1,19 @@
1
+ $:.push File.expand_path("../lib", __FILE__)
2
+
3
+ # Maintain your gem's version:
4
+ require "workarea/checkoutdotcom/version"
5
+
6
+ # Describe your gem and declare its dependencies:
7
+ Gem::Specification.new do |s|
8
+ s.name = "workarea-checkoutdotcom"
9
+ s.version = Workarea::Checkoutdotcom::VERSION
10
+ s.authors = ["Jeff Yucis"]
11
+ s.email = ["jyucis@weblinc.com"]
12
+ s.homepage = "https://homebase.weblinc.com"
13
+ s.summary = "Checkout.com payment processor."
14
+ s.description = "Checkout.com payment integration."
15
+
16
+ s.files = `git ls-files`.split("\n")
17
+
18
+ s.add_dependency 'workarea', '~> 3.x', '>= 3.5.x'
19
+ end
metadata ADDED
@@ -0,0 +1,144 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: workarea-checkoutdotcom
3
+ version: !ruby/object:Gem::Version
4
+ version: 1.2.0
5
+ platform: ruby
6
+ authors:
7
+ - Jeff Yucis
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+ date: 2019-11-26 00:00:00.000000000 Z
12
+ dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: workarea
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - "~>"
18
+ - !ruby/object:Gem::Version
19
+ version: 3.x
20
+ - - ">="
21
+ - !ruby/object:Gem::Version
22
+ version: 3.5.x
23
+ type: :runtime
24
+ prerelease: false
25
+ version_requirements: !ruby/object:Gem::Requirement
26
+ requirements:
27
+ - - "~>"
28
+ - !ruby/object:Gem::Version
29
+ version: 3.x
30
+ - - ">="
31
+ - !ruby/object:Gem::Version
32
+ version: 3.5.x
33
+ description: Checkout.com payment integration.
34
+ email:
35
+ - jyucis@weblinc.com
36
+ executables: []
37
+ extensions: []
38
+ extra_rdoc_files: []
39
+ files:
40
+ - ".eslintrc"
41
+ - ".github/ISSUE_TEMPLATE/bug_report.md"
42
+ - ".github/ISSUE_TEMPLATE/documentation-request.md"
43
+ - ".github/ISSUE_TEMPLATE/feature_request.md"
44
+ - ".github/workflows/ci.yml"
45
+ - ".gitignore"
46
+ - ".rubocop.yml"
47
+ - ".stylelintrc.json"
48
+ - CHANGELOG.md
49
+ - Gemfile
50
+ - README.md
51
+ - Rakefile
52
+ - app/lib/active_merchant/billing/gateways/checkout_v2.decorator
53
+ - app/models/workarea/payment/authorize/credit_card.decorator
54
+ - app/models/workarea/payment/purchase/credit_card.decorator
55
+ - app/models/workarea/payment/store_credit_card.decorator
56
+ - bin/rails
57
+ - config/initializers/workarea.rb
58
+ - lib/active_merchant/billing/bogus_checkout_v2_gateway.rb
59
+ - lib/workarea/checkoutdotcom.rb
60
+ - lib/workarea/checkoutdotcom/engine.rb
61
+ - lib/workarea/checkoutdotcom/version.rb
62
+ - script/admin_ci
63
+ - script/ci
64
+ - script/core_ci
65
+ - script/plugins_ci
66
+ - script/storefront_ci
67
+ - test/dummy/Rakefile
68
+ - test/dummy/bin/bundle
69
+ - test/dummy/bin/rails
70
+ - test/dummy/bin/rake
71
+ - test/dummy/bin/setup
72
+ - test/dummy/bin/update
73
+ - test/dummy/bin/yarn
74
+ - test/dummy/config.ru
75
+ - test/dummy/config/application.rb
76
+ - test/dummy/config/boot.rb
77
+ - test/dummy/config/cable.yml
78
+ - test/dummy/config/environment.rb
79
+ - test/dummy/config/environments/development.rb
80
+ - test/dummy/config/environments/production.rb
81
+ - test/dummy/config/environments/test.rb
82
+ - test/dummy/config/initializers/application_controller_renderer.rb
83
+ - test/dummy/config/initializers/assets.rb
84
+ - test/dummy/config/initializers/backtrace_silencers.rb
85
+ - test/dummy/config/initializers/cookies_serializer.rb
86
+ - test/dummy/config/initializers/filter_parameter_logging.rb
87
+ - test/dummy/config/initializers/inflections.rb
88
+ - test/dummy/config/initializers/mime_types.rb
89
+ - test/dummy/config/initializers/workarea.rb
90
+ - test/dummy/config/initializers/wrap_parameters.rb
91
+ - test/dummy/config/locales/en.yml
92
+ - test/dummy/config/puma.rb
93
+ - test/dummy/config/routes.rb
94
+ - test/dummy/config/secrets.yml
95
+ - test/dummy/config/spring.rb
96
+ - test/dummy/db/seeds.rb
97
+ - test/dummy/log/.keep
98
+ - test/models/workarea/payment/authorize/credit_card_test.decorator
99
+ - test/models/workarea/payment/capture_test.decorator
100
+ - test/models/workarea/payment/checkoutdotcom_integration_test.rb
101
+ - test/models/workarea/payment/credit_card_integration_test.decorator
102
+ - test/models/workarea/payment/purchase/credit_card_test.decorator
103
+ - test/models/workarea/payment/refund_test.decorator
104
+ - test/support/workarea/checkoutdotcom_gateway_vcr_config.rb
105
+ - test/support/workarea/workarea_3_2_backports.rb
106
+ - test/teaspoon_env.rb
107
+ - test/test_helper.rb
108
+ - test/vcr_cassettes/checkoutdotcom/auth_capture.yml
109
+ - test/vcr_cassettes/checkoutdotcom/auth_capture_refund.yml
110
+ - test/vcr_cassettes/checkoutdotcom/auth_void.yml
111
+ - test/vcr_cassettes/checkoutdotcom/purchase_refund.yml
112
+ - test/vcr_cassettes/checkoutdotcom/store_auth.yml
113
+ - test/vcr_cassettes/checkoutdotcom/store_purchase.yml
114
+ - test/vcr_cassettes/credit_card/auth_capture.yml
115
+ - test/vcr_cassettes/credit_card/auth_capture_refund.yml
116
+ - test/vcr_cassettes/credit_card/auth_void.yml
117
+ - test/vcr_cassettes/credit_card/purchase_refund.yml
118
+ - test/vcr_cassettes/credit_card/store_auth.yml
119
+ - test/vcr_cassettes/credit_card/store_purchase.yml
120
+ - test/workers/workarea/send_refund_email_test.decorator
121
+ - workarea-checkoutdotcom.gemspec
122
+ homepage: https://homebase.weblinc.com
123
+ licenses: []
124
+ metadata: {}
125
+ post_install_message:
126
+ rdoc_options: []
127
+ require_paths:
128
+ - lib
129
+ required_ruby_version: !ruby/object:Gem::Requirement
130
+ requirements:
131
+ - - ">="
132
+ - !ruby/object:Gem::Version
133
+ version: '0'
134
+ required_rubygems_version: !ruby/object:Gem::Requirement
135
+ requirements:
136
+ - - ">="
137
+ - !ruby/object:Gem::Version
138
+ version: '0'
139
+ requirements: []
140
+ rubygems_version: 3.0.6
141
+ signing_key:
142
+ specification_version: 4
143
+ summary: Checkout.com payment processor.
144
+ test_files: []