add authorize link to transactions page

This commit is contained in:
Andy Brett
2021-02-03 13:32:27 -08:00
parent 1b2416652f
commit 6efad74c5c
4 changed files with 5 additions and 2 deletions

View File

@@ -16,7 +16,7 @@ module Api
end
def payments
object.payments.joins(:payment_method).completed
object.payments.joins(:payment_method).valid
end
def shop_id

View File

@@ -1,6 +1,6 @@
module Api
class PaymentSerializer < ActiveModel::Serializer
attributes :amount, :updated_at, :payment_method, :state
attributes :amount, :updated_at, :payment_method, :state, :cvv_response_message
def payment_method
object.payment_method.try(:name)

View File

@@ -16,6 +16,8 @@
%td.order3.show-for-large-up
%i{"ng-class" => "{'ofn-i_012-warning': payment.state == 'invalid' || payment.state == 'void' || payment.state == 'failed'}"}
%span{"ng-bind" => "::'spree.payment_states.' + payment.state | t | capitalize"}
%span{"ng-if" => "payment.cvv_response_message.length > 0" }
%a{"ng-href" => "{{payment.cvv_response_message}}", "ng-bind" => "::'spree.payment_states.authorise' | t | capitalize" }
%td.order4.show-for-large-up
%td.order5.text-right{"ng-class" => "{'credit' : payment.amount > 0, 'debit' : payment.amount < 0, 'paid' : payment.amount == 0}","ng-bind" => "::payment.amount | localizeCurrency"}
%td.order6.show-for-large-up

View File

@@ -3620,6 +3620,7 @@ See the %{link} to find out more about %{sitename}'s features and to start using
processing: processing
void: void
invalid: invalid
authorise: authorise
order_mailer:
cancel_email:
customer_greeting: "Dear %{name},"