Perform the authorization for the shipment at the given index

@param int    $shipmentNumber order item index to authorize

@return OffAmazonPaymentsService_Model_AuthorizeResponse service response
421057
public function performAuthorizationForShipment($shipmentNumber)
    {
        $item = $this->_orderShipments[$shipmentNumber];
        
        $authorizeRequest = new OffAmazonPaymentsService_Model_AuthorizeRequest();
        $authorizeRequest->setAmazonOrderReferenceId($this->_amazonOrderReferenceId);
        $authorizeRequest->setSellerId($this->_sellerId);
        $authorizeRequest
            ->setAuthorizationReferenceId($this->_authorizationReferenceIdBase . $shipmentNumber);
        $authorizeRequest->setAuthorizationAmount(new OffAmazonPaymentsService_Model_Price());
        $authorizeRequest->getAuthorizationAmount()->setAmount($item->price);
        $authorizeRequest->getAuthorizationAmount()->setCurrencyCode($this->_service->getMerchantValues()->getCurrency());
        
        // Set the application timeout so that the polling request will
        // get a definitive response within this period of time
        $authorizeRequest->setTransactionTimeout(5);
        
        return $this->_service->authorize($authorizeRequest);
    }
1361871
public function getAuthRefNum($orderIndex = 0)
    {
        $orderStatuses = $this->getOrderStatuses();
        return array_key_exists('authRefNum', $orderStatuses[$orderIndex])
            ? $orderStatuses[$orderIndex]['authRefNum'] : null;
    }
1004745
protected function authorize(
        InboundRequestInterface $request,
        StoreInterface $store,
        AuthorizerInterface $authorizer
    ) {
        $result = $this->checkAuthorization($request, $store, $authorizer);

        if (true !== $result) {
            throw new AuthorizationException($result);
        }
    }
270402
private function createDoManifestClass_v1($shipmentNumbers) {
		trigger_error('[DHL-PHP-SDK]: Version 1 Methods are deprecated and will removed soon (Called method ' . __METHOD__ . ')!', E_USER_DEPRECATED);
		trigger_error('[DHL-PHP-SDK]: Called Version 1 Method: ' . __METHOD__ . ' is incomplete (does nothing)!', E_USER_WARNING);

		$data = new StdClass;

		return $data;
	}
722988
public function authorize()
    {
        $crude = CrudeInstance::get($this->crudeName);

        if ($crude == null)
            return false;

        return true;
    }
1089421
public function authorizeOrderAmount($authorizationAmount)
    {
        $authorizeRequest = new OffAmazonPaymentsService_Model_AuthorizeRequest();
        $authorizeRequest->setAmazonOrderReferenceId($this->_amazonOrderReferenceId);
        $authorizeRequest->setSellerId($this->_sellerId);
        $authorizeRequest->setAuthorizationReferenceId($this->_authorizationReferenceId);
        $authorizeRequest->setAuthorizationAmount(new OffAmazonPaymentsService_Model_Price());
        $authorizeRequest->getAuthorizationAmount()->setAmount($authorizationAmount);
        $authorizeRequest->getAuthorizationAmount()->setCurrencyCode($this->_service->getMerchantValues()->getCurrency());
        
        return $this->_service->authorize($authorizeRequest);
    }
162277
public function getTransactionInvoiceNumber($invoiceNumber)
    {
        if (empty($invoiceNumber)) {
            throw new InvalidArgumentException();
        }

        return $this->getRequest([
            self::API_TRANSACTION_INVOICE_NUMBER_QUERY,
            ['InvoiceNumber' => $invoiceNumber]
        ]);
    }
789431
public function shipmentAction(Request $request)
    {
        if (null !== $redirect = $this->validateStep('shipment')) {
            return $redirect;
        }

        $cart = $this->getCart();

        // Go to payment page if no shipment required
        if (!$cart->requiresShipment()) {
            return $this->redirect($this->generateUrl('ekyna_cart_payment'));
        }

        /* TODO
        $form = $this->createForm('ekyna_cart_shipment', $cart);

        $form->handleRequest($request);
        if ($form->isValid()) {
            $event = new OrderEvent($cart);
            $this->getDispatcher()->dispatch(OrderEvents::CONTENT_CHANGE, $event);
            if (!$event->isPropagationStopped()) {
                return $this->redirect($this->generateUrl('ekyna_cart_payment'));
            } else {
                $event->toFlashes($this->getFlashBag());
            }
            return $this->redirect($this->generateUrl('ekyna_cart_shipment'));
        }*/

        return $this->render('EkynaCartBundle:Cart:shipment.html.twig', [
//           'form' => $form->createView(),
//           'cart' => $cart,
//         	 'user' => $user,
        ]);
    }
954593
public function getFor(Order $order, $shipmentId, array $parameters = [])
    {
        return $this->getForId($order->id, $shipmentId, $parameters);
    }
1039521
public function authorizePayment(OrderTransfer $orderTransfer)
    {
        $paymentEntity = $this->getPaymentEntity($orderTransfer->getIdSalesOrder());
        $paymentMethodMapper = $this->getPaymentMethodMapper($paymentEntity);
        $requestContainer = $paymentMethodMapper->mapPaymentToAuthorization($paymentEntity, $orderTransfer);
        $requestContainer = $this->prepareOrderItems($orderTransfer, $requestContainer);
        $requestContainer = $this->prepareOrderShipment($orderTransfer, $requestContainer);
        $requestContainer = $this->prepareOrderDiscount($orderTransfer, $requestContainer);
        $responseContainer = $this->performAuthorizationRequest($paymentEntity, $requestContainer);

        $responseMapper = new AuthorizationResponseMapper();
        $responseTransfer = $responseMapper->getAuthorizationResponseTransfer($responseContainer);

        return $responseTransfer;
    }
1367019
public function aspectRatio($slideNumber)
    {
        if ($slideNumber == '')
            throw new Exception('Slide number not specified');

        //build URI
        $strURI = Product::$baseProductUri . '/slides/' . $this->getFileName() . '/slides/' . $slideNumber;

        //sign URI
        $signedURI = Utils::sign($strURI);

        $response = Utils::processCommand($signedURI, 'GET', '', '');

        $json = json_decode($response);
        
        if ($json->Code == 200)
            return $json->Slide->Width / $json->Slide->Height;
        else
            return false;
    }
699436
public function checkOrderExists($orderNumber, $throwExceptionOnDuplicate = false)
    {
        $sgOrder = $this->get($orderNumber);
        if ($throwExceptionOnDuplicate && $sgOrder->getId() !== null) {
            throw new \ShopgateLibraryException(
                \ShopgateLibraryException::PLUGIN_DUPLICATE_ORDER,
                $orderNumber,
                true
            );
        }

        return $sgOrder;
    }
622980
private function _performAuthAndCaptureForOrderShipment($shipmentNumber)
    {
        $response = $amazonAuthorizationId = $this->_performAuthorizationForShipment($shipmentNumber);
        $this->_waitUntilAuthorizationProcessingIsCompleted($amazonAuthorizationId);
        $this->_performCaptureForShipment($shipmentNumber, $amazonAuthorizationId);
    }
936948
public function getOrderNumber($orderIndex = 0)
    {
        $orderStatuses = $this->getOrderStatuses();
        return array_key_exists('orderNumber', $orderStatuses[$orderIndex])
            ? $orderStatuses[$orderIndex]['orderNumber'] : null;
    }
197289
public function mapPaymentToPreAuthorization(SpyPaymentPayone $paymentEntity): AuthorizationContainerInterface
    {
        $preAuthorizationContainer = new PreAuthorizationContainer();
        $preAuthorizationContainer = $this->mapPaymentToAbstractAuthorization($paymentEntity, $preAuthorizationContainer);
        $preAuthorizationContainer = $this->mapEmail($paymentEntity, $preAuthorizationContainer);
        $preAuthorizationContainer = $this->mapAmount($paymentEntity, $preAuthorizationContainer);
        $preAuthorizationContainer = $this->mapBusinessRelation($preAuthorizationContainer);

        return $preAuthorizationContainer;
    }
574492
public function processAuthorization(AuthorizationBuilder $builder)
    {
        $xml = new DOMDocument('1.0', 'utf-8');

        $transaction = $xml->createElement($this->mapRequestType($builder));
        $block1 = $xml->createElement('Block1');

        if ($builder->paymentMethod->paymentMethodType !== PaymentMethodType::GIFT
            && $builder->paymentMethod->paymentMethodType !== PaymentMethodType::ACH
            && ($builder->transactionType === TransactionType::AUTH
                || $builder->transactionType === TransactionType::SALE)
        ) {
            if ($builder->paymentMethod->paymentMethodType !== PaymentMethodType::RECURRING
                || $builder->paymentMethod->paymentType !== 'ACH'
            ) {
                $block1->appendChild(
                    $xml->createElement(
                        'AllowDup',
                        ($builder->allowDuplicates ? 'Y' : 'N')
                    )
                );
            }

            if ($builder->transactionModifier === TransactionModifier::NONE
                && $builder->paymentMethod->paymentMethodType !== PaymentMethodType::EBT
                && $builder->paymentMethod->paymentMethodType !== PaymentMethodType::RECURRING
            ) {
                $block1->appendChild(
                    $xml->createElement(
                        'AllowPartialAuth',
                        ($builder->allowPartialAuth ? 'Y' : 'N')
                    )
                );
            }
        }

        if ($builder->amount !== null) {
            $block1->appendChild($xml->createElement('Amt', $builder->amount));
        }

        if ($builder->gratuity !== null) {
            $block1->appendChild(
                $xml->createElement('GratuityAmtInfo', $builder->gratuity)
            );
        }

        if ($builder->convenienceAmount !== null) {
            $block1->appendChild($xml->createElement('ConvenienceAmtInfo', $builder->convenienceAmount));
        }

        if ($builder->shippingAmount !== null) {
            $block1->appendChild($xml->createElement('ShippingAmtInfo', $builder->shippingAmount));
        }

        if ($builder->cashBackAmount !== null) {
            $block1->appendChild(
                $xml->createElement(
                    $builder->paymentMethod->paymentMethodType === PaymentMethodType::DEBIT
                        ? 'CashbackAmtInfo'
                        : 'CashBackAmount',
                    $builder->cashBackAmount
                )
            );
        }

        if ($builder->offlineAuthCode !== null) {
            $block1->appendChild(
                $xml->createElement('OfflineAuthCode', $builder->offlineAuthCode)
            );
        }

        if ($builder->transactionType === TransactionType::ALIAS) {
            $block1->appendChild($xml->createElement('Action', AliasAction::validate($builder->aliasAction)));
            $block1->appendChild($xml->createElement('Alias', $builder->alias));
        }

        $isCheck = ($builder->paymentMethod->paymentMethodType === PaymentMethodType::ACH)
            || ($builder->paymentMethod instanceof RecurringPaymentMethod
                && $builder->paymentMethod->paymentType === 'ACH');
        $propertyName = $isCheck ? 'checkHolderName' : 'cardHolderName';
        if ($isCheck
            || $builder->billingAddress !== null
            || $builder->paymentMethod->{$propertyName} !== null
        ) {
            $address = $this->hydrateHolder($xml, $builder, $isCheck);

            if (!empty($address)) {
                $block1->appendChild($address);
            }
        }

        list($hasToken, $tokenValue) = $this->hasToken($builder->paymentMethod);

        $cardData = $xml->createElement(
            $builder->transactionType === TransactionType::REPLACE ? 'OldCardData' : 'CardData'
        );
        if ($builder->paymentMethod instanceof ICardData) {
            $cardData->appendChild(
                $this->hydrateManualEntry(
                    $xml,
                    $builder,
                    $hasToken,
                    $tokenValue
                )
            );
        } elseif ($builder->paymentMethod instanceof ITrackData) {
            $trackData = $this->hydrateTrackData(
                $xml,
                $builder,
                $hasToken,
                $tokenValue
            );

            if ($builder->paymentMethod->paymentMethodType === PaymentMethodType::DEBIT) {
                $block1->appendChild($trackData);
            } else {
                $cardData->appendChild($trackData);
            }
        } elseif ($builder->paymentMethod instanceof GiftCard) {
            if ($builder->currency !== null) {
                $block1->appendChild($xml->createElement('Currency', strtoupper($builder->currency)));
            }

            if ($builder->transactionType === TransactionType::REPLACE) {
                $newCard = $xml->createElement('NewCardData');
                $newCard->appendChild(
                    $xml->createElement(
                        $builder->replacementCard->valueType,
                        $builder->replacementCard->value
                    )
                );

                if ($builder->replacementCard->pin !== null) {
                    $newCard->appendChild(
                        $xml->createElement(
                            'PIN',
                            $builder->replacementCard->pin
                        )
                    );
                }
                $block1->appendChild($newCard);
            }

            if ($builder->paymentMethod->value !== null) {
                $cardData->appendChild(
                    $xml->createElement(
                        $builder->paymentMethod->valueType,
                        $builder->paymentMethod->value
                    )
                );
            }

            if ($builder->paymentMethod->pin !== null) {
                $cardData->appendChild(
                    $xml->createElement(
                        'PIN',
                        $builder->paymentMethod->pin
                    )
                );
            }
        } elseif ($builder->paymentMethod instanceof ECheck) {
            $block1->appendChild($xml->createElement('CheckAction', 'SALE'));

            if (empty($builder->paymentMethod->token)) {
                $accountInfo = $xml->createElement('AccountInfo');
                $accountInfo->appendChild($xml->createElement('RoutingNumber', $builder->paymentMethod->routingNumber));
                $accountInfo->appendChild($xml->createElement('AccountNumber', $builder->paymentMethod->accountNumber));
                $accountInfo->appendChild($xml->createElement('CheckNumber', $builder->paymentMethod->checkNumber));
                $accountInfo->appendChild($xml->createElement('MICRData', $builder->paymentMethod->micrNumber));
                $accountInfo->appendChild(
                    $xml->createElement(
                        'AccountType',
                        $this->hydrateAccountType($builder->paymentMethod->accountType)
                    )
                );
                $block1->appendChild($accountInfo);
            } else {
                $block1->appendChild($xml->createElement('TokenValue', $builder->paymentMethod->token));
            }

            $block1->appendChild(
                $xml->createElement(
                    'DataEntryMode',
                    strtoupper($this->hydrateEntryMethod($builder->paymentMethod->entryMode))
                )
            );
            $block1->appendChild(
                $xml->createElement(
                    'CheckType',
                    $this->hydrateCheckType($builder->paymentMethod->checkType)
                )
            );
            $block1->appendChild($xml->createElement('SECCode', $builder->paymentMethod->secCode));

            $verify = $xml->createElement('VerifyInfo');
            $verify->appendChild(
                $xml->createElement(
                    'CheckVerify',
                    ($builder->paymentMethod->checkVerify ? 'Y' : 'N')
                )
            );
            $verify->appendChild(
                $xml->createElement(
                    'ACHVerify',
                    ($builder->paymentMethod->achVerify ? 'Y' : 'N')
                )
            );
            $block1->appendChild($verify);
        }

        if ($builder->paymentMethod instanceof TransactionReference) {
            $block1->appendChild($xml->createElement('GatewayTxnId', $builder->paymentMethod->transactionId));
            $block1->appendChild($xml->createElement('ClientTxnId', $builder->paymentMethod->clientTransactionId));
        }

        if ($builder->paymentMethod instanceof RecurringPaymentMethod) {
            $method = $builder->paymentMethod;

            if ($method->paymentType === 'ACH') {
                $block1->appendChild($xml->createElement('CheckAction', 'SALE'));
            }

            $block1->appendChild($xml->createElement('PaymentMethodKey', $method->key));

            if ($method->paymentMethod !== null && $method->paymentMethod instanceof CreditCardData) {
                $data = $xml->createElement('PaymentMethodKeyData');

                if ($method->paymentMethod->expMonth !== null) {
                    $data->appendChild($xml->createElement('ExpMonth', $method->paymentMethod->expMonth));
                }

                if ($method->paymentMethod->expYear !== null) {
                    $data->appendChild($xml->createElement('ExpYear', $method->paymentMethod->expYear));
                }

                if ($method->paymentMethod->cvn !== null) {
                    $data->appendChild($xml->createElement('CVV2', $method->paymentMethod->cvn));
                }

                $block1->appendChild($data);
            }

            $data = $xml->createElement('RecurringData');
            if ($builder->scheduleId !== null) {
                $data->appendChild($xml->createElement('ScheduleID', $builder->scheduleId));
            }
            $data->appendChild($xml->createElement('OneTime', $builder->oneTimePayment ? 'Y' : 'N'));
            $block1->appendChild($data);
        }

        if ($builder->paymentMethod instanceof IPinProtected
            && $builder->transactionType !== TransactionType::REVERSAL
        ) {
            $block1->appendChild($xml->createElement('PinBlock', $builder->paymentMethod->pinBlock));
        }

        if ($builder->paymentMethod instanceof IEncryptable
            && isset($builder->paymentMethod->encryptionData)
            && null !== $builder->paymentMethod->encryptionData
        ) {
            $enc = $this->hydrateEncryptionData($xml, $builder);

            if ($builder->paymentMethod->paymentMethodType === PaymentMethodType::DEBIT) {
                $block1->appendChild($enc);
            } else {
                $cardData->appendChild($enc);
            }
        }

        if ($builder->paymentMethod instanceof ITokenizable) {
            $cardData->appendChild(
                $xml->createElement(
                    'TokenRequest',
                    $builder->requestMultiUseToken ? 'Y' : 'N'
                )
            );
        }

        if ($cardData->childNodes->length > 0 && $builder->aliasAction !== AliasAction::CREATE) {
            $block1->appendChild($cardData);
        }

        if ($builder->paymentMethod instanceof IBalanceable && $builder->balanceInquiryType !== null) {
            $block1->appendChild($xml->createElement('BalanceInquiryType', $builder->balanceInquiryType));
        }

        if ($builder->level2Request === true) {
            $block1->appendChild($xml->createElement('CPCReq', 'Y'));
        }

        if ($builder->customerId !== null
            || $builder->description !== null
            || $builder->invoiceNumber !== null
        ) {
            $block1->appendChild($this->hydrateAdditionalTxnFields($xml, $builder));
        }

        if ($builder->ecommerceInfo !== null) {
            $block1->appendChild($xml->createElement('Ecommerce', $builder->ecommerceInfo->channel));

            if (!empty($builder->invoiceNumber) || !empty($builder->ecommerceInfo->shipMonth)) {
                $direct = $xml->createElement('DirectMktData');
                if (!empty($builder->invoiceNumber)) {
                    $direct->appendChild($xml->createElement('DirectMktInvoiceNbr', $builder->invoiceNumber));
                }
                if (!empty($builder->ecommerceInfo->shipDay)) {
                    $direct->appendChild($xml->createElement('DirectMktShipDay', $builder->ecommerceInfo->shipDay));
                }
                if (!empty($builder->ecommerceInfo->shipMonth)) {
                    $direct->appendChild($xml->createElement('DirectMktShipMonth', $builder->ecommerceInfo->shipMonth));
                }
            }
            if (!empty($builder->paymentMethod->threeDSecure)) {
                $secure = $xml->createElement('SecureECommerce');
                if (!empty($builder->paymentMethod->threeDSecure->paymentDataSource)) {
                    $direct->appendChild(
                    $xml->createElement(
                        'PaymentDataSource',
                        $builder->paymentMethod->threeDSecure->paymentDataSource
                    )
                );
                }
                if (!empty($builder->paymentMethod->threeDSecure->paymentDataType)) {
                    $direct->appendChild(
                    $xml->createElement(
                        'TypeOfPaymentData',
                        $builder->paymentMethod->threeDSecure->paymentDataType
                    )
                );
                }
                if (!empty($builder->paymentMethod->threeDSecure->cavv)) {
                    $direct->appendChild($xml->createElement('PaymentData', $builder->paymentMethod->threeDSecure->cavv));
                }
                if (!empty($builder->paymentMethod->threeDSecure->eci)) {
                    $direct->appendChild($xml->createElement('ECommerceIndicator', $builder->paymentMethod->threeDSecure->eci));
                }
                if (!empty($builder->paymentMethod->threeDSecure->xid)) {
                    $direct->appendChild($xml->createElement('XID', $builder->paymentMethod->threeDSecure->xid));
                }
            }
        }

        if ($builder->dynamicDescriptor !== null) {
            $block1->appendChild(
                $xml->createElement('TxnDescriptor', $builder->dynamicDescriptor)
            );
        }

        $transaction->appendChild($block1);

        $response = $this->doTransaction($this->buildEnvelope($xml, $transaction));
        return $this->mapResponse($response, $builder, $this->buildEnvelope($xml, $transaction));
    }
1090103
private function getExportDocClass_v1($shipmentNumbers) {
		trigger_error('[DHL-PHP-SDK]: Version 1 Methods are deprecated and will removed soon (Called method ' . __METHOD__ . ')!', E_USER_DEPRECATED);
		trigger_error('[DHL-PHP-SDK]: Called Version 1 Method: ' . __METHOD__ . ' is incomplete (does nothing)!', E_USER_WARNING);

		$data = new StdClass;

		return $data;
	}