Class: SolidusNexio::PaymentConfirmationService

Inherits:
Struct
  • Object
show all
Defined in:
app/services/solidus_nexio/payment_confirmation_service.rb

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#paymentObject

Returns the value of attribute payment

Returns:

  • (Object)

    the current value of payment



4
5
6
# File 'app/services/solidus_nexio/payment_confirmation_service.rb', line 4

def payment
  @payment
end

Class Method Details

.call(payment) ⇒ Object



6
7
8
9
10
11
# File 'app/services/solidus_nexio/payment_confirmation_service.rb', line 6

def call(payment)
  return unless payment.nexio_apm? && payment.auth_confirmation_required

  new(payment).confirm_payment_auth!
  clear_auth_confirmation(payment)
end

Instance Method Details

#confirm_payment_auth!Object



20
21
22
23
24
# File 'app/services/solidus_nexio/payment_confirmation_service.rb', line 20

def confirm_payment_auth!
  return unless auth_confirmed

  invalidate_payment unless update_payment_state_from_nexio('Auth Confirmation') && auth_confirmed
end