workarea-checkoutdotcom 1.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
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,107 @@
1
+ if Workarea::VERSION::MAJOR == 3 && Workarea::VERSION::MINOR >= 2
2
+
3
+ module Workarea
4
+ decorate Payment::CreditCardIntegrationTest, with: :checkoutdotcom do
5
+ decorated do
6
+ include CheckoutdotcomGatewayVCRConfig
7
+ end
8
+
9
+ def test_purchase_void
10
+ skip 'Voiding a purchase operation is no supported'
11
+ end
12
+
13
+ def test_auth_capture_refund
14
+ VCR.use_cassette 'credit_card/auth_capture_refund' do
15
+ transaction = tender.build_transaction(action: 'authorize')
16
+ Payment::Authorize::CreditCard.new(tender, transaction).complete!
17
+ assert(transaction.success?, 'expected transaction to be successful')
18
+ transaction.save!
19
+
20
+ assert(tender.token.present?)
21
+
22
+ capture = Payment::Capture.new(payment: payment)
23
+ capture.allocate_amounts!(total: 5.to_m)
24
+ assert(capture.valid?)
25
+ capture.complete!
26
+
27
+ capture_transaction = payment.transactions.detect(&:captures)
28
+ assert(capture_transaction.valid?)
29
+
30
+ refund = Payment::Refund.new(payment: payment)
31
+ refund.allocate_amounts!(total: 5.to_m)
32
+
33
+ assert(refund.valid?)
34
+ refund.complete!
35
+
36
+ refund_transaction = payment.credit_card.transactions.refunds.first
37
+ assert(refund_transaction.valid?)
38
+ end
39
+ end
40
+
41
+ def test_purchase_refund
42
+ VCR.use_cassette 'credit_card/purchase_refund' do
43
+ transaction = tender.build_transaction(action: 'purchase')
44
+ Payment::Purchase::CreditCard.new(tender, transaction).complete!
45
+ assert(transaction.success?)
46
+ transaction.save!
47
+
48
+ assert(tender.token.present?)
49
+
50
+ refund = Payment::Refund.new(payment: payment)
51
+ refund.allocate_amounts!(total: 5.to_m)
52
+
53
+ assert(refund.valid?)
54
+ refund.complete!
55
+
56
+ refund_transaction = payment.credit_card.transactions.refunds.first
57
+ assert(refund_transaction.valid?)
58
+ end
59
+ end
60
+
61
+ private
62
+
63
+ def payment
64
+ @payment ||=
65
+ begin
66
+ order = create_order
67
+ profile = create_payment_profile
68
+ create_payment(
69
+ id: order.id,
70
+ profile_id: profile.id,
71
+ address: {
72
+ first_name: 'Ben',
73
+ last_name: 'Crouse',
74
+ street: '22 s. 3rd st.',
75
+ city: 'Philadelphia',
76
+ region: 'PA',
77
+ postal_code: '19106',
78
+ country: Country['US']
79
+ }
80
+ )
81
+ end
82
+ end
83
+
84
+ def tender
85
+ @tender ||=
86
+ begin
87
+ payment.set_address(first_name: 'Ben', last_name: 'Crouse')
88
+
89
+ payment.build_credit_card(
90
+ number: 4242424242424242,
91
+ month: 1,
92
+ year: Time.current.year + 1,
93
+ cvv: 100,
94
+ amount: 5.to_m
95
+ )
96
+
97
+ payment.credit_card
98
+ end
99
+ end
100
+
101
+ def order
102
+ @order = create_order(payment.id)
103
+ end
104
+ end
105
+ end
106
+
107
+ end
@@ -0,0 +1,38 @@
1
+ module Workarea
2
+ decorate Payment::Purchase::CreditCardTest, with: :checkoutdotcom do
3
+ def test_complete_does_nothing_if_gateway_storage_fails
4
+ skip "Storage happens post transaction"
5
+ end
6
+
7
+ def payment
8
+ @payment ||= create_payment(profile: create_payment_profile)
9
+ end
10
+
11
+ def tender
12
+ @tender ||=
13
+ begin
14
+ payment.set_address(first_name: 'Ben', last_name: 'Crouse')
15
+ create_order(id: payment.id, email: 'bclams@workarea.com')
16
+
17
+ payment.set_address(
18
+ first_name: 'Ben',
19
+ last_name: 'Crouse',
20
+ street: '22 s 3rd st',
21
+ city: 'Philadelphia',
22
+ region: 'PA',
23
+ country: Country['US'],
24
+ postal_code: '19106'
25
+ )
26
+
27
+ payment.build_credit_card(
28
+ number: 1,
29
+ month: 1,
30
+ year: Time.current.year + 1,
31
+ cvv: 999
32
+ )
33
+
34
+ payment.credit_card
35
+ end
36
+ end
37
+ end
38
+ end
@@ -0,0 +1,27 @@
1
+ module Workarea
2
+ decorate Payment::RefundTest, with: :checkoutdotcom do
3
+ def setup_payment
4
+ payment.set_address(
5
+ first_name: 'Ben',
6
+ last_name: 'Crouse',
7
+ street: '22 S. 3rd St.',
8
+ city: 'Philadelphia',
9
+ region: 'PA',
10
+ postal_code: '19106',
11
+ country: 'US',
12
+ phone_number: '2159251800'
13
+ )
14
+
15
+ payment.set_store_credit
16
+ payment.set_credit_card(
17
+ number: '1',
18
+ month: 1,
19
+ year: Time.current.year + 1,
20
+ cvv: '999',
21
+ amount: 5.to_m
22
+ )
23
+
24
+ create_order(id: payment.id, email: 'bclams@weblinc.com')
25
+ end
26
+ end
27
+ end
@@ -0,0 +1,20 @@
1
+ module Workarea
2
+ module CheckoutdotcomGatewayVCRConfig
3
+ def self.included(test)
4
+ super
5
+ test.setup :setup_gateway
6
+ test.teardown :reset_gateway
7
+ end
8
+
9
+ def setup_gateway
10
+ @_old_gateway = Workarea.config.gateways.credit_card
11
+ Workarea.config.gateways.credit_card = ActiveMerchant::Billing::CheckoutV2Gateway.new(
12
+ secret_key: 'sk_test_f4c1d728-928c-4381-bc6b-03c0888fb877'
13
+ )
14
+ end
15
+
16
+ def reset_gateway
17
+ Workarea.config.gateways.credit_card = @_old_gateway
18
+ end
19
+ end
20
+ end
@@ -0,0 +1,57 @@
1
+ # This file contains changes coming in Workarea 3.2 which are used in the payment
2
+ # integration tests
3
+
4
+ module Workarea
5
+ if Workarea::VERSION::MAJOR == 3 && Workarea::VERSION::MINOR < 2
6
+ decorate Payment::Refund, with: :workarea_backports do
7
+ # Set amounts for tenders automatically (as opposed to custom amounts)
8
+ # This will reset the current amount!
9
+ def allocate_amounts!(total:)
10
+ self.amounts = {}
11
+ allocated_amount = 0.to_m
12
+
13
+ payment.tenders.reverse.each do |tender|
14
+ amount_for_this_tender = total - allocated_amount
15
+
16
+ if amount_for_this_tender > tender.refundable_amount
17
+ amount_for_this_tender = tender.refundable_amount
18
+ end
19
+
20
+ allocated_amount += amount_for_this_tender
21
+ amounts[tender.id] = amount_for_this_tender
22
+ end
23
+ end
24
+ end
25
+
26
+ decorate Payment::Capture, with: :workarea_backports do
27
+ # Set amounts for tenders automatically (as opposed to custom amounts)
28
+ # This will reset the current amounts!
29
+ def allocate_amounts!(total:)
30
+ self.amounts = {}
31
+ allocated_amount = 0.to_m
32
+
33
+ payment.tenders.each do |tender|
34
+ amount_for_this_tender = total - allocated_amount
35
+
36
+ if amount_for_this_tender > tender.capturable_amount
37
+ amount_for_this_tender = tender.capturable_amount
38
+ end
39
+
40
+ allocated_amount += amount_for_this_tender
41
+ amounts[tender.id] = amount_for_this_tender
42
+ end
43
+ end
44
+ end
45
+
46
+ decorate Payment::Capture, Payment::Refund, with: :workarea_processing_backports do
47
+ # Deal with inconsistent Mongoid serializing of Money within a Hash field
48
+ def parse_amount(amount)
49
+ if Money === amount || String === amount || Integer === amount || Float === amount
50
+ amount.to_m
51
+ else
52
+ Money.demongoize(amount)
53
+ end
54
+ end
55
+ end
56
+ end
57
+ end
@@ -0,0 +1,6 @@
1
+ require 'workarea/testing/teaspoon'
2
+
3
+ Teaspoon.configure do |config|
4
+ config.root = Workarea::Checkoutdotcom::Engine.root
5
+ Workarea::Teaspoon.apply(config)
6
+ end
@@ -0,0 +1,10 @@
1
+ # Configure Rails Environment
2
+ ENV['RAILS_ENV'] = 'test'
3
+
4
+ require File.expand_path("../../test/dummy/config/environment.rb", __FILE__)
5
+ require 'rails/test_help'
6
+ require 'workarea/test_help'
7
+
8
+ # Filter out Minitest backtrace while allowing backtrace from other libraries
9
+ # to be shown.
10
+ Minitest.backtrace_filter = Minitest::BacktraceFilter.new
@@ -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":"86C68AD158","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":"user@workarea.com"}}'
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
+ - '1538'
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_ngd7bxo3ofxupk67tzqz4jfrji
43
+ Product:
44
+ - Gateway
45
+ Cko-Version:
46
+ - 3.32.9
47
+ Cko-Request-Id:
48
+ - 14e40949-a8d5-48ee-b5f3-5f49c5e0b137
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:08:00 GMT
63
+ Via:
64
+ - 1.1 varnish
65
+ X-Served-By:
66
+ - cache-lga21930-LGA
67
+ X-Cache:
68
+ - MISS
69
+ X-Cache-Hits:
70
+ - '0'
71
+ X-Timer:
72
+ - S1574194080.679938,VS0,VE412
73
+ body:
74
+ encoding: UTF-8
75
+ string: '{"id":"pay_ngd7bxo3ofxupk67tzqz4jfrji","action_id":"act_ngd7bxo3ofxupk67tzqz4jfrji","amount":500,"currency":"USD","approved":true,"status":"Authorized","auth_code":"741933","eci":"05","scheme_id":"090091145295585","response_code":"10000","response_summary":"Approved","risk":{"flagged":false},"source":{"id":"src_toxd2yvjsdlelieckfowkotabq","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_xwtxqa3y66euhnkwgpcwe7ijce","email":"user@workarea.com","name":"Ben
80
+ Crouse"},"processed_on":"2019-11-19T20:08:00Z","reference":"86C68AD158","processing":{"acquirer_transaction_id":"6628523198","retrieval_reference_number":"878497707083"},"_links":{"self":{"href":"https://api.sandbox.checkout.com/payments/pay_ngd7bxo3ofxupk67tzqz4jfrji"},"actions":{"href":"https://api.sandbox.checkout.com/payments/pay_ngd7bxo3ofxupk67tzqz4jfrji/actions"},"capture":{"href":"https://api.sandbox.checkout.com/payments/pay_ngd7bxo3ofxupk67tzqz4jfrji/captures"},"void":{"href":"https://api.sandbox.checkout.com/payments/pay_ngd7bxo3ofxupk67tzqz4jfrji/voids"}}}'
81
+ http_version:
82
+ recorded_at: Tue, 19 Nov 2019 20:08:00 GMT
83
+ - request:
84
+ method: post
85
+ uri: https://api.sandbox.checkout.com/payments/pay_ngd7bxo3ofxupk67tzqz4jfrji/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
+ - '176'
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
+ - 0b627c12-16de-4340-9311-07039f962fdd
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:08:00 GMT
139
+ Via:
140
+ - 1.1 varnish
141
+ X-Served-By:
142
+ - cache-lga21924-LGA
143
+ X-Cache:
144
+ - MISS
145
+ X-Cache-Hits:
146
+ - '0'
147
+ X-Timer:
148
+ - S1574194080.362314,VS0,VE159
149
+ body:
150
+ encoding: UTF-8
151
+ string: '{"action_id":"act_tk3yswek5sdevcif7tzd3qdcne","reference":"86C68AD158","_links":{"payment":{"href":"https://api.sandbox.checkout.com/payments/pay_ngd7bxo3ofxupk67tzqz4jfrji"}}}'
152
+ http_version:
153
+ recorded_at: Tue, 19 Nov 2019 20:08:00 GMT
154
+ recorded_with: VCR 2.9.3
@@ -0,0 +1,225 @@
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":"00E7A6C7A4","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":"user@workarea.com"}}'
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
+ - '1538'
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_u26oibpqa4hefirszv7opfy2ty
43
+ Product:
44
+ - Gateway
45
+ Cko-Version:
46
+ - 3.32.9
47
+ Cko-Request-Id:
48
+ - e04849b7-8f81-4413-9920-389cb8a238e5
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:07:50 GMT
63
+ Via:
64
+ - 1.1 varnish
65
+ X-Served-By:
66
+ - cache-lga21922-LGA
67
+ X-Cache:
68
+ - MISS
69
+ X-Cache-Hits:
70
+ - '0'
71
+ X-Timer:
72
+ - S1574194070.041390,VS0,VE450
73
+ body:
74
+ encoding: UTF-8
75
+ string: '{"id":"pay_u26oibpqa4hefirszv7opfy2ty","action_id":"act_u26oibpqa4hefirszv7opfy2ty","amount":500,"currency":"USD","approved":true,"status":"Authorized","auth_code":"365568","eci":"05","scheme_id":"570895001372849","response_code":"10000","response_summary":"Approved","risk":{"flagged":false},"source":{"id":"src_toxd2yvjsdlelieckfowkotabq","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_xwtxqa3y66euhnkwgpcwe7ijce","email":"user@workarea.com","name":"Ben
80
+ Crouse"},"processed_on":"2019-11-19T20:07:50Z","reference":"00E7A6C7A4","processing":{"acquirer_transaction_id":"6585623337","retrieval_reference_number":"031253509280"},"_links":{"self":{"href":"https://api.sandbox.checkout.com/payments/pay_u26oibpqa4hefirszv7opfy2ty"},"actions":{"href":"https://api.sandbox.checkout.com/payments/pay_u26oibpqa4hefirszv7opfy2ty/actions"},"capture":{"href":"https://api.sandbox.checkout.com/payments/pay_u26oibpqa4hefirszv7opfy2ty/captures"},"void":{"href":"https://api.sandbox.checkout.com/payments/pay_u26oibpqa4hefirszv7opfy2ty/voids"}}}'
81
+ http_version:
82
+ recorded_at: Tue, 19 Nov 2019 20:07:50 GMT
83
+ - request:
84
+ method: post
85
+ uri: https://api.sandbox.checkout.com/payments/pay_u26oibpqa4hefirszv7opfy2ty/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
+ - '176'
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
+ - f75d2c75-d9eb-4f00-851b-e4cd6c3466f1
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:07:51 GMT
139
+ Via:
140
+ - 1.1 varnish
141
+ X-Served-By:
142
+ - cache-lga21937-LGA
143
+ X-Cache:
144
+ - MISS
145
+ X-Cache-Hits:
146
+ - '0'
147
+ X-Timer:
148
+ - S1574194071.727972,VS0,VE408
149
+ body:
150
+ encoding: UTF-8
151
+ string: '{"action_id":"act_w7nek47va4sundka2qguoh4c5q","reference":"00E7A6C7A4","_links":{"payment":{"href":"https://api.sandbox.checkout.com/payments/pay_u26oibpqa4hefirszv7opfy2ty"}}}'
152
+ http_version:
153
+ recorded_at: Tue, 19 Nov 2019 20:07:51 GMT
154
+ - request:
155
+ method: post
156
+ uri: https://api.sandbox.checkout.com/payments/pay_u26oibpqa4hefirszv7opfy2ty/refunds
157
+ body:
158
+ encoding: UTF-8
159
+ string: '{"amount":"500","reference":null,"currency":"USD","metadata":{"udf5":"ActiveMerchant"},"customer":{"email":null}}'
160
+ headers:
161
+ Content-Type:
162
+ - application/json;charset=UTF-8
163
+ Authorization:
164
+ - sk_test_f4c1d728-928c-4381-bc6b-03c0888fb877
165
+ Connection:
166
+ - close
167
+ Accept-Encoding:
168
+ - gzip;q=1.0,deflate;q=0.6,identity;q=0.3
169
+ Accept:
170
+ - "*/*"
171
+ User-Agent:
172
+ - Ruby
173
+ response:
174
+ status:
175
+ code: 202
176
+ message: Accepted
177
+ headers:
178
+ Connection:
179
+ - close
180
+ Content-Length:
181
+ - '176'
182
+ Cache-Control:
183
+ - no-cache
184
+ Pragma:
185
+ - no-cache
186
+ Content-Type:
187
+ - application/json; charset=utf-8
188
+ Expires:
189
+ - "-1"
190
+ Product:
191
+ - Gateway
192
+ Cko-Version:
193
+ - 3.32.9
194
+ Cko-Request-Id:
195
+ - 30610915-6d1e-4cfe-a070-1ae0d22a34fd
196
+ Access-Control-Allow-Origin:
197
+ - "*"
198
+ Access-Control-Allow-Headers:
199
+ - 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
200
+ Access-Control-Allow-Methods:
201
+ - OPTIONS,POST,GET,PUT,DELETE
202
+ Access-Control-Request-Method:
203
+ - OPTIONS,POST,GET,PUT,DELETE
204
+ Access-Control-Request-Headers:
205
+ - authorization
206
+ Accept-Ranges:
207
+ - bytes
208
+ Date:
209
+ - Tue, 19 Nov 2019 20:07:51 GMT
210
+ Via:
211
+ - 1.1 varnish
212
+ X-Served-By:
213
+ - cache-lga21948-LGA
214
+ X-Cache:
215
+ - MISS
216
+ X-Cache-Hits:
217
+ - '0'
218
+ X-Timer:
219
+ - S1574194072.541302,VS0,VE438
220
+ body:
221
+ encoding: UTF-8
222
+ string: '{"action_id":"act_7m6r34ltosmepicxr4qkoxbypq","reference":"00E7A6C7A4","_links":{"payment":{"href":"https://api.sandbox.checkout.com/payments/pay_u26oibpqa4hefirszv7opfy2ty"}}}'
223
+ http_version:
224
+ recorded_at: Tue, 19 Nov 2019 20:07:52 GMT
225
+ recorded_with: VCR 2.9.3