Luis Ramos
1fb162bb4c
Result of running rubocop -a, safe auto correct
2021-07-13 23:06:56 +01:00
Andy Brett
527f4e2cb3
move payment to requires_authorization if cvv_result is present
2021-06-17 14:23:59 -07:00
Andy Brett
31738ceb49
rename and consolidate authorization? methods
2021-06-17 14:23:59 -07:00
Andy Brett
674ca3026b
change states after failure/requiring auth
2021-06-17 14:23:58 -07:00
Andy Brett
73e5fd3f5b
use method to clarify intent on payment intents
2021-04-28 10:43:06 -07:00
Andy Brett
9906afa1a6
use capture! if payment is already authorized
2021-04-27 17:59:03 -07:00
Maikel Linke
1364b878fe
Add ApplicationRecord for customisations
...
Rails 5 introduced this new class to confine application-specific monkey
patches to our models only, and not leak into other libraries using
ActiveRecord::Base.
https://bigbinary.com/blog/application-record-in-rails-5
2021-04-15 15:59:03 +10:00
Andy Brett
9d33b36799
Merge pull request #7024 from Matt-Yorkley/dead-code-auto-capture
...
DCOTW: Spree::Config[:auto_capture]
2021-03-17 09:31:00 -07:00
Matt-Yorkley
365700615a
Remove dead code: Spree::Config.auto_capture
...
We set this value to `true` unconditionally in an initializer, and then check the value in various places via Spree::Config. It's never false, and it's not configurable, so we can just drop it and remove the related conditionals. 🔥
2021-03-05 16:03:07 +00:00
Matt-Yorkley
d17ff38a7e
Delete Order#tax_total
...
#display_tax_total is not used anywhere, #tax_total is used in once place but it's not needed.
2021-03-03 11:26:32 +00:00
Andy Brett
9104ca72a9
refactor to descriptive method authorization_action_required?
2021-02-10 09:36:35 -08:00
Andy Brett
6e735739a5
after customer auth + redirect, process payment and clear cvv_response_message
2021-02-03 09:50:37 -08:00
Andy Brett
e6e20309aa
Revert "don't try to process a payment if it's pending auth"
...
This reverts commit bba9e55006 .
2021-01-27 08:06:20 -08:00
Andy Brett
bba9e55006
don't try to process a payment if it's pending auth
2021-01-21 09:18:29 -08:00
Andy Brett
5c0408c68c
pass paymentIntent ID to capture
2021-01-21 08:48:38 -08:00
Andy Brett
8507dacc10
pass return_url option to gateway authorize
2021-01-21 08:48:33 -08:00
Andy Brett
50e87a023b
rename method to validate! since it can raise an error
2020-12-10 07:45:07 -08:00
Andy Brett
3a8203094a
refactor to remove boolean flag param
2020-12-08 07:52:42 -08:00
Andy Brett
a466886a32
fix rubocop warnings
2020-12-08 07:52:42 -08:00
Andy Brett
13ab25ac45
separate method for charging offline
2020-12-08 07:52:41 -08:00
Luis Ramos
6e8fe080cb
Fix easy rubocop issues
2020-09-05 18:39:56 +01:00
Luis Ramos
4931edc67c
Remove code related to promotions, we dont have promotions in OFN
2020-09-05 16:38:37 +01:00
Pau Perez
e6943ce554
Fix simple Rubocop issues
2020-07-23 20:24:31 +02:00
Pau Perez
4d9fbb68d6
Add missing attribute to skip source validation
2020-07-23 20:24:31 +02:00
Pau Perez
c0f72f89f2
Handle #refund! as we do with #credit!
2020-07-23 20:24:31 +02:00
Pau Perez
0f0a704147
Skip source validation when applying credit
...
The original payment may not be valid because its credit card may be
expired. Stripe gives this as a valid scenario returning a success and
we should do too.
When creating the credit payment we end up validating all sources in
a chain as follows.
```
Payment being persisted -> source payment -> original credit card.
```
The source payment was valid when created (It would not be persisted
otherwise) but its source card may now be expired, and that's legit.
There was also an issue with the `#invalidate_old_payments` callback. It
was causing the original payment to be validated again and thus the
credit payment failed to be persisted due to the original credit card
being expired. Switching this callback to use `#update_column` skips
validations and so we don't validate the source payment. We only care
about the state there, so it should be fine.
2020-07-23 20:24:31 +02:00
Pau Perez
59da07de66
Handle all errors when dealing with payment event
...
This basically catches ActiveRecord::RecordInvalid caused by an invalid
credit record, for instance, but also other situations we haven't
forseen.
2020-07-23 20:24:31 +02:00
Pau Perez
dd5e679f69
Address code review comments
...
Mostly styling issues.
2020-07-16 15:30:28 +02:00
Pau Perez
3a64cc426a
Reuse #calculate_refund_amount method
2020-07-15 14:01:58 +02:00
Pau Perez
a8af3a27b1
Fix all but Metrics Rubocop cops in processing.rb
2020-07-15 14:01:58 +02:00
Pau Perez
42658b5255
Refactor #process! nested ifs to guard clauses
...
Following Rubocop's indications.
2020-07-15 14:01:58 +02:00
Pau Perez
66dbd85eb4
Run rubocop autocorrect on payment/processing.rb
2020-07-15 14:01:58 +02:00
Pau Perez
48910aeb77
Move #refund! to the processing.rb
2020-07-10 10:41:44 +02:00
Pau Perez
06aa56164f
Bring in Payment model from Spree
2020-07-10 10:41:44 +02:00