app/models/spree/adyen/notification_processor.rb
# At this point the auth was received before the redirect, we create
# the payment here with the information we have available so that if
# the user is not redirected to back for some reason we still have a
# record of the payment.
At this point the auth was received before the redirect, we create
the payment here with the information we have available so that if
the user is not redirected to back for some reason we still have a
record of the payment.
At this point the auth was received before the redirect we create the payment here with the information we have available so that if the user is not redirected to back for some reason we still have a record of the payment .
def create_missing_payment
        order = notification.order
        source = Spree::Adyen::HppSource.new(
          auth_result: "unknown",
          order: order,
          payment_method: notification.payment_method,
          psp_reference: notification.psp_reference
        )
        payment = order.payments.create!(
          amount: notification.money.dollars,
          payment_method: Spree::Gateway::AdyenHPP.last,
          response_code: notification.psp_reference,
          source: source,
          order: order
        )
        order.contents.advance
        order.complete
        payment
      end
def create_missing_payment order = notification . order source = Spree :: Adyen :: HppSource . new ( auth_result : "unknown" , order : order , payment_method : notification . payment_method , psp_reference : notification . psp_reference ) payment = order . payments . create! ( amount : notification . money . dollars , payment_method : Spree :: Gateway :: AdyenHPP . last , response_code : notification . psp_reference , source : source , order : order ) order . contents . advance order . complete payment end
At this point the auth was received before the redirect, we create
the payment here with the information we have available so that if
the user is not redirected to back for some reason we still have a
record of the payment.
At this point the auth was received before the redirect we create the payment here with the information we have available so that if the user is not redirected to back for some reason we still have a record of the payment .
# We have no idea what payment method they used, this will be # updated when/if they get redirected