workarea-payware_connect 2.1.2

Sign up to get free protection for your applications and to get access to all the features.
Files changed (130) 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/.github/workflows/ci.yml +54 -0
  7. data/.gitignore +13 -0
  8. data/.rubocop.yml +2 -0
  9. data/CHANGELOG.md +63 -0
  10. data/CODE_OF_CONDUCT.md +3 -0
  11. data/CONTRIBUTING.md +3 -0
  12. data/Gemfile +9 -0
  13. data/LICENSE.md +3 -0
  14. data/README.md +53 -0
  15. data/Rakefile +54 -0
  16. data/app/models/workarea/payment/authorize/credit_card.decorator +37 -0
  17. data/app/models/workarea/payment/capture/credit_card.decorator +14 -0
  18. data/app/models/workarea/payment/payware_credit_card.decorator +24 -0
  19. data/app/models/workarea/payment/purchase/credit_card.decorator +37 -0
  20. data/app/models/workarea/payment/refund/credit_card.decorator +14 -0
  21. data/app/models/workarea/payment/store_credit_card.decorator +13 -0
  22. data/app/workers/workarea/save_user_order_details.decorator +33 -0
  23. data/bin/rails +18 -0
  24. data/config/initializers/00_defaults.rb +1 -0
  25. data/doc/PWCTestAccount_WorldPay ecom.pages +0 -0
  26. data/doc/validation/(Completed v2)PAYware Connect Validation Worksheet 2015 V2 .doc +0 -0
  27. data/doc/validation/(Completed v3)PAYware Connect Validation Worksheet 2015 V2 .doc +0 -0
  28. data/doc/validation/PAYware Connect Validation Letter Weblinc 09-11-2015.pdf +0 -0
  29. data/doc/validation/PAYware Connect Validation Letter Weblinc 10-21-2015.pdf +0 -0
  30. data/lib/active_merchant/billing/bogus_payware_connect_gateway.rb +130 -0
  31. data/lib/active_merchant/billing/payware_connect_gateway.rb +137 -0
  32. data/lib/active_merchant/billing/payware_connect_gateway/actions/authorize.rb +63 -0
  33. data/lib/active_merchant/billing/payware_connect_gateway/actions/capture.rb +26 -0
  34. data/lib/active_merchant/billing/payware_connect_gateway/actions/purchase.rb +59 -0
  35. data/lib/active_merchant/billing/payware_connect_gateway/actions/refund.rb +29 -0
  36. data/lib/active_merchant/billing/payware_connect_gateway/actions/void.rb +20 -0
  37. data/lib/active_merchant/billing/payware_connect_gateway/admin_actions/add_contract.rb +9 -0
  38. data/lib/active_merchant/billing/payware_connect_gateway/admin_actions/add_customer.rb +9 -0
  39. data/lib/active_merchant/billing/payware_connect_gateway/admin_actions/add_customer_and_contract.rb +10 -0
  40. data/lib/active_merchant/billing/payware_connect_gateway/admin_actions/update_contract.rb +9 -0
  41. data/lib/active_merchant/billing/payware_connect_gateway/admin_actions/update_customer.rb +9 -0
  42. data/lib/active_merchant/billing/payware_connect_gateway/admin_xml_builder.rb +105 -0
  43. data/lib/active_merchant/billing/payware_connect_gateway/xml_builder.rb +35 -0
  44. data/lib/active_merchant/billing/payware_response.rb +9 -0
  45. data/lib/validation.rb +25 -0
  46. data/lib/workarea/payware_connect.rb +43 -0
  47. data/lib/workarea/payware_connect/engine.rb +8 -0
  48. data/lib/workarea/payware_connect/version.rb +5 -0
  49. data/test/dummy/Rakefile +6 -0
  50. data/test/dummy/app/assets/config/manifest.js +4 -0
  51. data/test/dummy/app/assets/images/.keep +0 -0
  52. data/test/dummy/app/assets/javascripts/application.js +13 -0
  53. data/test/dummy/app/assets/stylesheets/application.css +15 -0
  54. data/test/dummy/app/controllers/application_controller.rb +3 -0
  55. data/test/dummy/app/controllers/concerns/.keep +0 -0
  56. data/test/dummy/app/helpers/application_helper.rb +2 -0
  57. data/test/dummy/app/jobs/application_job.rb +2 -0
  58. data/test/dummy/app/mailers/application_mailer.rb +4 -0
  59. data/test/dummy/app/models/concerns/.keep +0 -0
  60. data/test/dummy/app/views/layouts/application.html.erb +14 -0
  61. data/test/dummy/app/views/layouts/mailer.html.erb +13 -0
  62. data/test/dummy/app/views/layouts/mailer.text.erb +1 -0
  63. data/test/dummy/bin/bundle +3 -0
  64. data/test/dummy/bin/rails +4 -0
  65. data/test/dummy/bin/rake +4 -0
  66. data/test/dummy/bin/setup +34 -0
  67. data/test/dummy/bin/update +29 -0
  68. data/test/dummy/config.ru +5 -0
  69. data/test/dummy/config/application.rb +24 -0
  70. data/test/dummy/config/boot.rb +5 -0
  71. data/test/dummy/config/cable.yml +9 -0
  72. data/test/dummy/config/environment.rb +5 -0
  73. data/test/dummy/config/environments/development.rb +56 -0
  74. data/test/dummy/config/environments/production.rb +86 -0
  75. data/test/dummy/config/environments/test.rb +44 -0
  76. data/test/dummy/config/initializers/application_controller_renderer.rb +6 -0
  77. data/test/dummy/config/initializers/assets.rb +11 -0
  78. data/test/dummy/config/initializers/backtrace_silencers.rb +7 -0
  79. data/test/dummy/config/initializers/cookies_serializer.rb +5 -0
  80. data/test/dummy/config/initializers/filter_parameter_logging.rb +4 -0
  81. data/test/dummy/config/initializers/inflections.rb +16 -0
  82. data/test/dummy/config/initializers/mime_types.rb +4 -0
  83. data/test/dummy/config/initializers/new_framework_defaults.rb +23 -0
  84. data/test/dummy/config/initializers/workarea.rb +3 -0
  85. data/test/dummy/config/initializers/wrap_parameters.rb +14 -0
  86. data/test/dummy/config/locales/en.yml +23 -0
  87. data/test/dummy/config/puma.rb +47 -0
  88. data/test/dummy/config/routes.rb +5 -0
  89. data/test/dummy/config/secrets.yml +22 -0
  90. data/test/dummy/config/spring.rb +6 -0
  91. data/test/dummy/db/seeds.rb +3 -0
  92. data/test/dummy/lib/assets/.keep +0 -0
  93. data/test/dummy/log/.keep +0 -0
  94. data/test/dummy/public/404.html +67 -0
  95. data/test/dummy/public/422.html +67 -0
  96. data/test/dummy/public/500.html +66 -0
  97. data/test/dummy/public/apple-touch-icon-precomposed.png +0 -0
  98. data/test/dummy/public/apple-touch-icon.png +0 -0
  99. data/test/dummy/public/favicon.ico +0 -0
  100. data/test/integration/workarea/storefront/checkout_side_effects_integration_test.decorator +44 -0
  101. data/test/lib/active_merchant/billing/payware_connect_gateway_test.rb +280 -0
  102. data/test/models/workarea/payment/authorize/credit_card_test.decorator +47 -0
  103. data/test/models/workarea/payment/capture/credit_card_test.decorator +33 -0
  104. data/test/models/workarea/payment/credit_card_integration_test.decorator +25 -0
  105. data/test/models/workarea/payment/payware_credit_card_test.rb +44 -0
  106. data/test/models/workarea/payment/purchase/credit_card_test.decorator +54 -0
  107. data/test/models/workarea/payment/refund/credit_card_test.decorator +33 -0
  108. data/test/models/workarea/payment/store_credit_card_test.decorator +10 -0
  109. data/test/support/workarea/payware_connect_gateway_vcr_config.rb +24 -0
  110. data/test/system/workarea/admin/payment_transactions_system_test.decorator +37 -0
  111. data/test/test_helper.rb +12 -0
  112. data/test/vcr_cassettes/credit_card/auth_capture.yml +127 -0
  113. data/test/vcr_cassettes/credit_card/auth_void.yml +126 -0
  114. data/test/vcr_cassettes/credit_card/purchase_void.yml +126 -0
  115. data/test/vcr_cassettes/credit_card/store_auth.yml +67 -0
  116. data/test/vcr_cassettes/credit_card/store_purchase.yml +67 -0
  117. data/test/vcr_cassettes/payware/add_contract.yml +99 -0
  118. data/test/vcr_cassettes/payware/add_customer.yml +52 -0
  119. data/test/vcr_cassettes/payware/authorize_credit_card.yml +67 -0
  120. data/test/vcr_cassettes/payware/authorize_customer_and_contract.yml +161 -0
  121. data/test/vcr_cassettes/payware/authorize_for_0_credit_card.yml +67 -0
  122. data/test/vcr_cassettes/payware/authorize_for_0_troutd.yml +130 -0
  123. data/test/vcr_cassettes/payware/authorize_troutd.yml +130 -0
  124. data/test/vcr_cassettes/payware/capture.yml +127 -0
  125. data/test/vcr_cassettes/payware/refund.yml +223 -0
  126. data/test/vcr_cassettes/payware/refund_troutd.yml +128 -0
  127. data/test/vcr_cassettes/payware/void_authorization.yml +126 -0
  128. data/test/workers/workarea/save_user_order_details_test.decorator +56 -0
  129. data/workarea-payware_connect.gemspec +18 -0
  130. metadata +190 -0
@@ -0,0 +1,56 @@
1
+ module Workarea
2
+ decorate SaveUserOrderDetailsTest, with: :payware_connect do
3
+ def test_save_payment_details
4
+ user = create_user
5
+ order = Order.new(email: user.email, user_id: user.id)
6
+ profile = create_payment_profile(email: user.email)
7
+
8
+ payment = Payment.new(id: order.id)
9
+ payment.profile = profile
10
+
11
+ payment.set_credit_card(
12
+ number: '1',
13
+ month: 1,
14
+ year: Time.current.year + 1,
15
+ cvv: '999'
16
+ )
17
+
18
+ payment.set_address(
19
+ first_name: 'Ben',
20
+ last_name: 'Crouse',
21
+ street: '22 S. 3rd St.',
22
+ street_2: 'Second Floor',
23
+ city: 'Philadelphia',
24
+ region: 'PA',
25
+ postal_code: '19106',
26
+ country: 'US',
27
+ phone_number: '2159251800'
28
+ )
29
+
30
+ Payment::StoreCreditCard.new(payment.credit_card).save!
31
+ assert(payment.credit_card.persisted?)
32
+
33
+ @worker.save_payment_details(order, user)
34
+ user.reload
35
+
36
+ assert_equal(user.first_name, 'Ben')
37
+ assert_equal(user.last_name, 'Crouse')
38
+
39
+ assert_equal(user.addresses.length, 1)
40
+ assert_equal(user.addresses.first.first_name, 'Ben')
41
+ assert_equal(user.addresses.first.last_name, 'Crouse')
42
+ assert_equal(user.addresses.first.street, '22 S. 3rd St.')
43
+ assert_equal(user.addresses.first.street_2, 'Second Floor')
44
+ assert_equal(user.addresses.first.city, 'Philadelphia')
45
+ assert_equal(user.addresses.first.region, 'PA')
46
+ assert_equal(user.addresses.first.postal_code, '19106')
47
+ assert_equal(user.addresses.first.country, Country['US'])
48
+ assert_equal(user.addresses.first.phone_number, '2159251800')
49
+
50
+ profile = Payment::Profile.lookup(PaymentReference.new(user))
51
+ assert_equal(profile.credit_cards.length, 1)
52
+
53
+ assert_equal("1-1", profile.credit_cards.first.partial_number)
54
+ end
55
+ end
56
+ end
@@ -0,0 +1,18 @@
1
+ $:.push File.expand_path("../lib", __FILE__)
2
+
3
+ require "workarea/payware_connect/version"
4
+
5
+ Gem::Specification.new do |s|
6
+ s.name = "workarea-payware_connect"
7
+ s.version = Workarea::PaywareConnect::VERSION
8
+ s.authors = ["Mark Platt"]
9
+ s.email = ["mplatt@weblinc.com"]
10
+ s.homepage = "https://github.com/workarea-commerce/workarea-payware_connect"
11
+ s.summary = "ActiveMerchant Gateway and supporting classes for Payware Connect"
12
+ s.description = "Adds ability checkout and store credit cards using Payware Connect"
13
+ s.files = `git ls-files`.split("\n")
14
+
15
+ s.required_ruby_version = ">= 2.0.0"
16
+
17
+ s.add_dependency "workarea", "~> 3.x", ">= 3.4.0"
18
+ end
metadata ADDED
@@ -0,0 +1,190 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: workarea-payware_connect
3
+ version: !ruby/object:Gem::Version
4
+ version: 2.1.2
5
+ platform: ruby
6
+ authors:
7
+ - Mark Platt
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+ date: 2020-01-22 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.4.0
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.4.0
33
+ description: Adds ability checkout and store credit cards using Payware Connect
34
+ email:
35
+ - mplatt@weblinc.com
36
+ executables: []
37
+ extensions: []
38
+ extra_rdoc_files: []
39
+ files:
40
+ - ".editorconfig"
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
+ - CHANGELOG.md
48
+ - CODE_OF_CONDUCT.md
49
+ - CONTRIBUTING.md
50
+ - Gemfile
51
+ - LICENSE.md
52
+ - README.md
53
+ - Rakefile
54
+ - app/models/workarea/payment/authorize/credit_card.decorator
55
+ - app/models/workarea/payment/capture/credit_card.decorator
56
+ - app/models/workarea/payment/payware_credit_card.decorator
57
+ - app/models/workarea/payment/purchase/credit_card.decorator
58
+ - app/models/workarea/payment/refund/credit_card.decorator
59
+ - app/models/workarea/payment/store_credit_card.decorator
60
+ - app/workers/workarea/save_user_order_details.decorator
61
+ - bin/rails
62
+ - config/initializers/00_defaults.rb
63
+ - doc/PWCTestAccount_WorldPay ecom.pages
64
+ - doc/validation/(Completed v2)PAYware Connect Validation Worksheet 2015 V2 .doc
65
+ - doc/validation/(Completed v3)PAYware Connect Validation Worksheet 2015 V2 .doc
66
+ - doc/validation/PAYware Connect Validation Letter Weblinc 09-11-2015.pdf
67
+ - doc/validation/PAYware Connect Validation Letter Weblinc 10-21-2015.pdf
68
+ - lib/active_merchant/billing/bogus_payware_connect_gateway.rb
69
+ - lib/active_merchant/billing/payware_connect_gateway.rb
70
+ - lib/active_merchant/billing/payware_connect_gateway/actions/authorize.rb
71
+ - lib/active_merchant/billing/payware_connect_gateway/actions/capture.rb
72
+ - lib/active_merchant/billing/payware_connect_gateway/actions/purchase.rb
73
+ - lib/active_merchant/billing/payware_connect_gateway/actions/refund.rb
74
+ - lib/active_merchant/billing/payware_connect_gateway/actions/void.rb
75
+ - lib/active_merchant/billing/payware_connect_gateway/admin_actions/add_contract.rb
76
+ - lib/active_merchant/billing/payware_connect_gateway/admin_actions/add_customer.rb
77
+ - lib/active_merchant/billing/payware_connect_gateway/admin_actions/add_customer_and_contract.rb
78
+ - lib/active_merchant/billing/payware_connect_gateway/admin_actions/update_contract.rb
79
+ - lib/active_merchant/billing/payware_connect_gateway/admin_actions/update_customer.rb
80
+ - lib/active_merchant/billing/payware_connect_gateway/admin_xml_builder.rb
81
+ - lib/active_merchant/billing/payware_connect_gateway/xml_builder.rb
82
+ - lib/active_merchant/billing/payware_response.rb
83
+ - lib/validation.rb
84
+ - lib/workarea/payware_connect.rb
85
+ - lib/workarea/payware_connect/engine.rb
86
+ - lib/workarea/payware_connect/version.rb
87
+ - test/dummy/Rakefile
88
+ - test/dummy/app/assets/config/manifest.js
89
+ - test/dummy/app/assets/images/.keep
90
+ - test/dummy/app/assets/javascripts/application.js
91
+ - test/dummy/app/assets/stylesheets/application.css
92
+ - test/dummy/app/controllers/application_controller.rb
93
+ - test/dummy/app/controllers/concerns/.keep
94
+ - test/dummy/app/helpers/application_helper.rb
95
+ - test/dummy/app/jobs/application_job.rb
96
+ - test/dummy/app/mailers/application_mailer.rb
97
+ - test/dummy/app/models/concerns/.keep
98
+ - test/dummy/app/views/layouts/application.html.erb
99
+ - test/dummy/app/views/layouts/mailer.html.erb
100
+ - test/dummy/app/views/layouts/mailer.text.erb
101
+ - test/dummy/bin/bundle
102
+ - test/dummy/bin/rails
103
+ - test/dummy/bin/rake
104
+ - test/dummy/bin/setup
105
+ - test/dummy/bin/update
106
+ - test/dummy/config.ru
107
+ - test/dummy/config/application.rb
108
+ - test/dummy/config/boot.rb
109
+ - test/dummy/config/cable.yml
110
+ - test/dummy/config/environment.rb
111
+ - test/dummy/config/environments/development.rb
112
+ - test/dummy/config/environments/production.rb
113
+ - test/dummy/config/environments/test.rb
114
+ - test/dummy/config/initializers/application_controller_renderer.rb
115
+ - test/dummy/config/initializers/assets.rb
116
+ - test/dummy/config/initializers/backtrace_silencers.rb
117
+ - test/dummy/config/initializers/cookies_serializer.rb
118
+ - test/dummy/config/initializers/filter_parameter_logging.rb
119
+ - test/dummy/config/initializers/inflections.rb
120
+ - test/dummy/config/initializers/mime_types.rb
121
+ - test/dummy/config/initializers/new_framework_defaults.rb
122
+ - test/dummy/config/initializers/workarea.rb
123
+ - test/dummy/config/initializers/wrap_parameters.rb
124
+ - test/dummy/config/locales/en.yml
125
+ - test/dummy/config/puma.rb
126
+ - test/dummy/config/routes.rb
127
+ - test/dummy/config/secrets.yml
128
+ - test/dummy/config/spring.rb
129
+ - test/dummy/db/seeds.rb
130
+ - test/dummy/lib/assets/.keep
131
+ - test/dummy/log/.keep
132
+ - test/dummy/public/404.html
133
+ - test/dummy/public/422.html
134
+ - test/dummy/public/500.html
135
+ - test/dummy/public/apple-touch-icon-precomposed.png
136
+ - test/dummy/public/apple-touch-icon.png
137
+ - test/dummy/public/favicon.ico
138
+ - test/integration/workarea/storefront/checkout_side_effects_integration_test.decorator
139
+ - test/lib/active_merchant/billing/payware_connect_gateway_test.rb
140
+ - test/models/workarea/payment/authorize/credit_card_test.decorator
141
+ - test/models/workarea/payment/capture/credit_card_test.decorator
142
+ - test/models/workarea/payment/credit_card_integration_test.decorator
143
+ - test/models/workarea/payment/payware_credit_card_test.rb
144
+ - test/models/workarea/payment/purchase/credit_card_test.decorator
145
+ - test/models/workarea/payment/refund/credit_card_test.decorator
146
+ - test/models/workarea/payment/store_credit_card_test.decorator
147
+ - test/support/workarea/payware_connect_gateway_vcr_config.rb
148
+ - test/system/workarea/admin/payment_transactions_system_test.decorator
149
+ - test/test_helper.rb
150
+ - test/vcr_cassettes/credit_card/auth_capture.yml
151
+ - test/vcr_cassettes/credit_card/auth_void.yml
152
+ - test/vcr_cassettes/credit_card/purchase_void.yml
153
+ - test/vcr_cassettes/credit_card/store_auth.yml
154
+ - test/vcr_cassettes/credit_card/store_purchase.yml
155
+ - test/vcr_cassettes/payware/add_contract.yml
156
+ - test/vcr_cassettes/payware/add_customer.yml
157
+ - test/vcr_cassettes/payware/authorize_credit_card.yml
158
+ - test/vcr_cassettes/payware/authorize_customer_and_contract.yml
159
+ - test/vcr_cassettes/payware/authorize_for_0_credit_card.yml
160
+ - test/vcr_cassettes/payware/authorize_for_0_troutd.yml
161
+ - test/vcr_cassettes/payware/authorize_troutd.yml
162
+ - test/vcr_cassettes/payware/capture.yml
163
+ - test/vcr_cassettes/payware/refund.yml
164
+ - test/vcr_cassettes/payware/refund_troutd.yml
165
+ - test/vcr_cassettes/payware/void_authorization.yml
166
+ - test/workers/workarea/save_user_order_details_test.decorator
167
+ - workarea-payware_connect.gemspec
168
+ homepage: https://github.com/workarea-commerce/workarea-payware_connect
169
+ licenses: []
170
+ metadata: {}
171
+ post_install_message:
172
+ rdoc_options: []
173
+ require_paths:
174
+ - lib
175
+ required_ruby_version: !ruby/object:Gem::Requirement
176
+ requirements:
177
+ - - ">="
178
+ - !ruby/object:Gem::Version
179
+ version: 2.0.0
180
+ required_rubygems_version: !ruby/object:Gem::Requirement
181
+ requirements:
182
+ - - ">="
183
+ - !ruby/object:Gem::Version
184
+ version: '0'
185
+ requirements: []
186
+ rubygems_version: 3.0.3
187
+ signing_key:
188
+ specification_version: 4
189
+ summary: ActiveMerchant Gateway and supporting classes for Payware Connect
190
+ test_files: []