/** * Create a payment service. This will either return an AuthorizeService or PurchaseService, depending on * the gateway config. * @param \Payment $payment * @return AuthorizeService|PurchaseService * @throws InvalidConfigurationException */ protected function createPaymentService(\Payment $payment) { return $this->getService($payment, GatewayInfo::shouldUseAuthorize($payment->Gateway) ? ServiceFactory::INTENT_AUTHORIZE : ServiceFactory::INTENT_PURCHASE); }