mlomnicki/ddd-ecommerce

View on GitHub
lib/sales/application/payment_application_service.rb

Summary

Maintainability
A
0 mins
Test Coverage
module Sales
  module Application
    class PaymentApplicationService
      def initialize(payment_gateway)
        @payment_gateway = payment_gateway
      end

      def request_payment(command)
        payment = Domain::PaymentInfo.new(command.order_id, command.customer_id, command.amount)
        @payment_gateway.process_payment(payment)
      end
    end
  end
end