mirror of
https://github.com/openfoodfoundation/openfoodnetwork
synced 2026-02-27 01:43:22 +00:00
add resend-authorization-email button to admin screen
This commit is contained in:
@@ -16,6 +16,7 @@
|
||||
}
|
||||
|
||||
.icon-email:before { @extend .icon-envelope:before }
|
||||
.icon-resend_authorization_email:before { @extend .icon-envelope:before }
|
||||
.icon-resume:before { @extend .icon-refresh:before }
|
||||
|
||||
.icon-cancel:before,
|
||||
|
||||
@@ -79,11 +79,17 @@ module Spree
|
||||
end
|
||||
|
||||
def actions
|
||||
%w{capture void credit}
|
||||
%w{capture void credit resend_authorization_email}
|
||||
end
|
||||
|
||||
def can_resend_authorization_email?(payment)
|
||||
payment.pending? && payment.cvv_response_message.present?
|
||||
end
|
||||
|
||||
# Indicates whether its possible to capture the payment
|
||||
def can_capture?(payment)
|
||||
return false if payment.cvv_response_message.present?
|
||||
|
||||
payment.pending? || payment.checkout?
|
||||
end
|
||||
|
||||
|
||||
@@ -121,6 +121,12 @@ module Spree
|
||||
actions
|
||||
end
|
||||
|
||||
def resend_authorization_email!
|
||||
return unless cvv_response_message.present?
|
||||
|
||||
PaymentMailer.authorize_payment(self).deliver
|
||||
end
|
||||
|
||||
def payment_source
|
||||
res = source.is_a?(Payment) ? source.source : source
|
||||
res || payment_method
|
||||
|
||||
Reference in New Issue
Block a user