Perform the authorization for the shipment at the given index

@param int $shipmentNumber order item index to authorize

@return string amazonAuthorizationId for the single auth call
10362
private function _performAuthorizationForShipment($shipmentNumber)
    {
        $response = $this->callStepAndCheckForException('performAuthorizationForShipment', array($shipmentNumber));
        printAuthorizeResponse($response);
        return $response->getAuthorizeResult()->getAuthorizationDetails()->getAmazonAuthorizationId();
    }
723699
private function getExportDocClass_v2($shipmentNumbers) {
		$data = new StdClass;

		$data->Version = $this->getVersionClass();

		if(is_array($shipmentNumbers)) {
			$this->checkRequestCount($shipmentNumbers, 'getExportDoc');

			foreach($shipmentNumbers as $key => &$number)
				$data->shipmentNumber[$key] = $number;
		} else
			$data->shipmentNumber = $shipmentNumbers;

		if($this->getLabelResponseType() !== null)
			$data->exportDocResponseType = $this->getLabelResponseType();

		return $data;
	}
588993
public function deleteShipmentOrder($shipmentNumbers) {
		switch($this->getMayor()) {
			case 1:
				$data = $this->createDeleteClass_v1($shipmentNumbers);
				break;
			case 2:
			default:
				$data = $this->createDeleteClass_v2($shipmentNumbers);
		}

		try {
			$response = $this->sendDeleteRequest($data);
		} catch(Exception $e) {
			$this->addError($e->getMessage());

			return false;
		}

		if(is_soap_fault($response)) {
			$this->addError($response->faultstring);

			return false;
		} else
			return new Response($this->getVersion(), $response);
	}
646624
protected function _updateAuthorizedOrders()
    {
        $aProcessed = $this->_processOrderStates(
            "SELECT OXID, OXORDERNR FROM oxorder
            WHERE BESTITAMAZONORDERREFERENCEID != ''
              AND BESTITAMAZONAUTHORIZATIONID != ''
              AND OXTRANSSTATUS = 'AMZ-Authorize-Pending'",
            'getAuthorizationDetails'
        );

        foreach ($aProcessed as $sOrderNumber => $oData) {
            if (isset($oData->GetAuthorizationDetailsResult->AuthorizationDetails->AuthorizationStatus->State)) {
                $sState = $oData->GetAuthorizationDetailsResult
                    ->AuthorizationDetails
                    ->AuthorizationStatus->State;
                $this->_addToMessages("Authorized Order #{$sOrderNumber} - Status updated to: {$sState}<br/>");
            }
        }
    }
209797
private function _authorizeOrderAmount($authorizationAmount)
    {
        $response = $this->callStepAndCheckForException(
            'authorizeOrderAmount', 
            array($authorizationAmount)
        );
        printAuthorizeResponse($response);
        return $response->getAuthorizeResult()->getAuthorizationDetails()->getAmazonAuthorizationId();
    }
739891
public function getAuthorizationDetails($amazonAuthorizationId)
    {
        $getAuthorizationDetailsRequest = new OffAmazonPaymentsService_Model_GetAuthorizationDetailsRequest();
        $getAuthorizationDetailsRequest->setSellerId($this->_sellerId);
        $getAuthorizationDetailsRequest->setAmazonAuthorizationId($amazonAuthorizationId);
    
        return $this->_service->getAuthorizationDetails($getAuthorizationDetailsRequest);
    }
880919
public function shipment($orderId, array $items, $trackCode, $trackCarrier, $trackMethod, $trackUrl)
    {
        /** @var OrderHandler $handler */
        $handler = $this->requestHandler();
        return $handler->shipment($orderId, $items, $trackCode, $trackCarrier, $trackMethod, $trackUrl);
    }
753135
private function _performCaptureForShipment(
        $shipmentNumber,
        $amazonAuthorizationId
    ) {
        $captureResponse = $this->callStepAndCheckForException(
            'performCaptureForShipment',
            array(
                $shipmentNumber,
                $amazonAuthorizationId,
                $this->currencyCode
            )
        );
        
        echo $this->printResponseToWebpage(
            "printCaptureResponse", array($captureResponse)
        );
        
        $captureId = $captureResponse->getCaptureResult()
            ->getCaptureDetails()->getAmazonCaptureId();
  
        // Check for the presence of the ipn notification
        $this->waitForNotificationToBeProcessedBeforeContinuing(
            $captureId,
            "CaptureNotification"
        );
  
        $getCaptureDetailsresponse = $this->callStepAndCheckForException(
            'getCaptureDetails',
            array($captureId)
        );
  
        validateThatCaptureIsCompleted($getCaptureDetailsresponse->getGetCaptureDetailsResult());
  
        echo $this->printResponseToWebpage(
            "printGetCaptureDetailsResponse", array($getCaptureDetailsresponse)
        );
    }
159121
public function processAuthorization(AuthorizationBuilder $builder)
    {
        //for google payment amount and currency is required
        if (!empty($builder->transactionModifier) &&
            $builder->transactionModifier === TransactionModifier::ENCRYPTED_MOBILE &&
            $builder->paymentMethod->mobileType === EncyptedMobileType::GOOGLE_PAY &&
            (empty($builder->amount) || empty($builder->currency))
        ) {
            throw new BuilderException("Amount and Currency cannot be null for google payment");
        }

        $xml = new DOMDocument();
        $timestamp = isset($builder->timestamp) ? $builder->timestamp : GenerationUtils::generateTimestamp();
        $orderId = isset($builder->orderId) ? $builder->orderId : GenerationUtils::generateOrderId();
        $transactionType = $this->mapAuthRequestType($builder);

        // Build Request
        $request = $xml->createElement("request");
        $request->setAttribute("timestamp", $timestamp);
        $request->setAttribute("type", $transactionType);

        $request->appendChild($xml->createElement("merchantid", $this->merchantId));
        
        if ($this->accountId !== null) {
            $request->appendChild($xml->createElement("account", $this->accountId));
        }
        if ($this->channel !== null) {
            $request->appendChild($xml->createElement("channel", $this->channel));
        }
        
        if (isset($builder->amount)) {
            $amount = $xml->createElement("amount", preg_replace('/[^0-9]/', '', sprintf('%01.2f', $builder->amount)));
            $amount->setAttribute("currency", $builder->currency);
            $request->appendChild($amount);
        }
        
        // This needs to be figured out based on txn type and set to 0, 1 or MULTI
        if ($builder->transactionType === TransactionType::SALE || $builder->transactionType == TransactionType::AUTH) {
            $autoSettle = $builder->transactionType === TransactionType::SALE ? "1" : "0";
            $element = $xml->createElement("autosettle");
            $element->setAttribute("flag", $autoSettle);
            $request->appendChild($element);
        }
        
        $request->appendChild($xml->createElement("orderid", $orderId));

        // For Fraud Decision Manager
        if (!empty($builder->customerData)) {
            $customerValue = $builder->customerData;
            $customer = $xml->createElement("customer");
            $customer->appendChild($xml->createElement("customerid", $customerValue->id));
            $customer->appendChild($xml->createElement("firstname", $customerValue->firstName));
            $customer->appendChild($xml->createElement("lastname", $customerValue->lastName));
            $customer->appendChild($xml->createElement("dateofbirth", $customerValue->dateOfBirth));
            $customer->appendChild($xml->createElement("customerpassword", $customerValue->customerPassword));
            $customer->appendChild($xml->createElement("email", $customerValue->email));
            $customer->appendChild($xml->createElement("domainname", $customerValue->domainName));
            $customer->appendChild($xml->createElement("devicefingerprint", $customerValue->deviceFingerPrint));
            $customer->appendChild($xml->createElement("phonenumber", $customerValue->homePhone));
            $request->appendChild($customer);
        }

        if (!empty($builder->productData)) {
            $prod = [];
            $productValues = $builder->productData;
            $products = $xml->createElement("products");

            foreach ($productValues as $prod) {
                $product = $xml->createElement("product");
                $product->appendChild($xml->createElement('product_id', $prod['product_id']));
                $product->appendChild($xml->createElement('productname', $prod['productname']));
                $product->appendChild($xml->createElement('quantity', $prod['quantity']));
                $product->appendChild($xml->createElement('unitprice', $prod['unitprice']));
                $product->appendChild($xml->createElement('gift', $prod['gift']));
                $product->appendChild($xml->createElement('type', $prod['type']));
                $product->appendChild($xml->createElement('risk', $prod['risk']));
                $product->appendChild($products);
                $request->appendChild($product);
            }
        }

        if ($builder->decisionManager !== null) {
            $dmValues = $builder->decisionManager;
            $fraud = $xml->createElement("fraud");
            $dm = $fraud->appendChild($xml->createElement('dm'));
            $dm->appendChild($xml->createElement('billtohostname', $dmValues->billToHostName));
            $dm->appendChild($xml->createElement(
                'billtohttpbrowsercookiesaccepted',
                ($dmValues->billToHttpBrowserCookiesAccepted) != true ? 'false' : 'true'
            ));
            $dm->appendChild($xml->createElement('billtohttpbrowseremail', $dmValues->billToHttpBrowserEmail));
            $dm->appendChild($xml->createElement('billtohttpbrowsertype', $dmValues->billToHttpBrowserType));
            $dm->appendChild($xml->createElement('billtoipnetworkaddress', $dmValues->billToIpNetworkAddress));
            $dm->appendChild($xml->createElement(
                'businessrulesscorethreshold',
                $dmValues->businessRulessCoreThresHold
            ));
            $dm->appendChild($xml->createElement('billtopersonalid', $dmValues->billToPersonalId));
            $dm->appendChild($xml->createElement('invoiceheadertendertype', $dmValues->invoiceHeaderTenderType));
            $dm->appendChild($xml->createElement(
                'invoiceheaderisgift',
                ($dmValues->invoiceHeaderIsGift) != true ? 'false' : 'true'
            ));
            $dm->appendChild($xml->createElement('decisionmanagerprofile', $dmValues->decisionManagerProfile));
            $dm->appendChild($xml->createElement(
                'invoiceheaderreturnsaccepted',
                ($dmValues->invoiceHeaderReturnsAccepted) != true ? 'false' : 'true'
            ));
            $dm->appendChild($xml->createElement('itemhosthedge', $dmValues->itemHostHedge));
            $dm->appendChild($xml->createElement('itemnonsensicalhedge', $dmValues->itemNonsensicalHedge));
            $dm->appendChild($xml->createElement('itemobscenitieshedge', $dmValues->itemObscenitiesHedge));
            $dm->appendChild($xml->createElement('itemphonehedge', $dmValues->itemPhoneHedge));
            $dm->appendChild($xml->createElement('itemtimehedge', $dmValues->itemTimeHedge));
            $dm->appendChild($xml->createElement('itemvelocityhedge', $dmValues->itemVelocityHedge));
            $request->appendChild($dm);
        }

        if (!empty($builder->customData)) {
            $cust = [];
            $customValues = $builder->customData;
            $custom = $xml->createElement("custom");

            foreach ($customValues as $cust) {
                $custom->appendChild($xml->createElement('field01', $cust['field01']));
                $custom->appendChild($xml->createElement('field02', $cust['field02']));
                $custom->appendChild($xml->createElement('field03', $cust['field03']));
                $custom->appendChild($xml->createElement('field04', $cust['field04']));
                $request->appendChild($custom);
            }
        }

        // For DCC rate lookup
        if ($builder->transactionType === TransactionType::DCC_RATE_LOOKUP) {
            $dccinfo = $xml->createElement("dccinfo");
            $dccinfo->appendChild($xml->createElement("ccp", $builder->dccProcessor));
            $dccinfo->appendChild($xml->createElement("type", $builder->dccType));
            $dccinfo->appendChild($xml->createElement("ratetype", $builder->dccRateType));
            $request->appendChild($dccinfo);
        }

        // For DCC charge/auth
        if (!empty($builder->dccRateData)) {
            $dccinfo = $xml->createElement("dccinfo");

            $amount = $xml->createElement("amount", preg_replace('/[^0-9]/', '', $builder->dccRateData->amount));
            $amount->setAttribute("currency", $builder->dccRateData->currency);

            $dccinfo->appendChild($amount);
            $dccinfo->appendChild($xml->createElement("ccp", $builder->dccRateData->dccProcessor));
            $dccinfo->appendChild($xml->createElement("type", $builder->dccRateData->dccType));
            $dccinfo->appendChild($xml->createElement("rate", $builder->dccRateData->dccRate));
            $dccinfo->appendChild($xml->createElement("ratetype", $builder->dccRateData->dccRateType));
            $request->appendChild($dccinfo);
        }

        // Hydrate the payment data fields
        if ($builder->paymentMethod instanceof CreditCardData) {
            $card = $builder->paymentMethod;
            
            if ($builder->transactionModifier === TransactionModifier::ENCRYPTED_MOBILE) {
                $request->appendChild($xml->createElement("token", $card->token));
                $request->appendChild($xml->createElement("mobile", $card->mobileType));
            } else {
                $cardElement = $xml->createElement("card");
                $cardElement->appendChild($xml->createElement("number", $card->number));
                $cardElement->appendChild($xml->createElement("expdate", $card->getShortExpiry()));
                $cardElement->appendChild($xml->createElement("chname", $card->cardHolderName));
                $cardElement->appendChild($xml->createElement("type", strtoupper($card->getCardType())));

                if ($card->cvn !== null) {
                    //if cvn number is not empty indicator should be PRESENT
                    $cvnPresenceIndicator = (!empty($card->cvn)) ?
                                                CvnPresenceIndicator::PRESENT:
                                                $card->cvnPresenceIndicator;
                    
                    $cvnElement = $xml->createElement("cvn");
                    $cvnElement->appendChild($xml->createElement("number", $card->cvn));
                    $cvnElement->appendChild($xml->createElement("presind", $cvnPresenceIndicator));
                    $cardElement->appendChild($cvnElement);
                }
                $request->appendChild($cardElement);
            }
            // issueno
            $hash = '';
            if ($builder->transactionType === TransactionType::VERIFY) {
                $hash = GenerationUtils::generateHash(
                    $this->sharedSecret,
                    implode('.', [
                            $timestamp,
                            $this->merchantId,
                            $orderId,
                            $card->number
                                ])
                );
            } else {
                $requestValues = $this->getShal1RequestValues($timestamp, $orderId, $builder, $card);
                
                $hash = GenerationUtils::generateHash(
                    $this->sharedSecret,
                    implode('.', $requestValues)
                );
            }
           
            $request->appendChild($xml->createElement("sha1hash", $hash));
        }
        if ($builder->paymentMethod instanceof RecurringPaymentMethod) {
            $recurring = $builder->paymentMethod;
            $request->appendChild($xml->createElement("payerref", $recurring->customerKey));
            $request->appendChild($xml->createElement(
                "paymentmethod",
                isset($recurring->key) ? $recurring->key : $recurring->id
            ));

            if ($builder->cvn !== null && $builder->cvn !== '') {
                $paymentData = $xml->createElement("paymentdata");
                $cvn = $xml->createElement("cvn");
                $cvn->appendChild($xml->createElement("number", $builder->cvn));
                $paymentData->appendChild($cvn);
                $request->appendChild($paymentData);
            }
            
            $hash = '';
            if ($builder->transactionType === TransactionType::VERIFY) {
                if (!empty($builder->transactionModifier) &&
                    $builder->transactionModifier === TransactionModifier::SECURE3D) {
                    $hash = GenerationUtils::generateHash(
                        $this->sharedSecret,
                        implode('.', [
                                    $timestamp,
                                    $this->merchantId,
                                    $orderId,
                                    preg_replace('/[^0-9]/', '', sprintf('%01.2f', $builder->amount)),
                                    $builder->currency,
                                    $recurring->customerKey,
                                ])
                    );
                } else {
                    $hash = GenerationUtils::generateHash(
                        $this->sharedSecret,
                        implode('.', [
                                    $timestamp,
                                    $this->merchantId,
                                    $orderId,
                                    $recurring->customerKey,
                                ])
                    );
                }
            } else {
                $hash = GenerationUtils::generateHash(
                    $this->sharedSecret,
                    implode('.', [
                        $timestamp,
                        $this->merchantId,
                        $orderId,
                        preg_replace('/[^0-9]/', '', sprintf('%01.2f', $builder->amount)),
                        $builder->currency,
                        $recurring->customerKey,
                    ])
                );
            }
            $request->appendChild($xml->createElement("sha1hash", $hash));
        } else {
            // TODO: Token Processing
            //$request->appendChild($xml->createElement("sha1hash", GenerateHash(order, token));
        }

        // refund hash
        if ($builder->transactionType === TransactionType::REFUND) {
            $request->appendChild($xml->createElement(
                "refundhash",
                GenerationUtils::generateHash($this->refundPassword) ?: ''
            ));
        }

        
        
        if ($builder->paymentMethod instanceof AlternativePaymentMethod) {
            $this->buildAlternativePaymentMethod($builder, $request, $xml);
        }

        // comment ...TODO: needs to be multiple
        if ($builder->description != null) {
            $comments = $xml->createElement("comments");
            $comment = $xml->createElement("comment", $builder->description);
            $comment->setAttribute("id", "1");
            $comments->appendChild($comment);
            
            $request->appendChild($comments);
        }
        
        if ($builder->paymentMethod instanceof AlternativePaymentMethod) {
            $hash = GenerationUtils::generateHash(
                $this->sharedSecret,
                implode('.', [
                        $timestamp,
                        $this->merchantId,
                        $orderId,
                        preg_replace('/[^0-9]/', '', sprintf('%01.2f', $builder->amount)),
                        $builder->currency,
                        $builder->paymentMethod->alternativePaymentMethodType,
                    ])
            );
            $request->appendChild($xml->createElement("sha1hash", $hash));
        }
        
        if ($builder->recurringType !== null || $builder->recurringSequence !== null) {
            $recurring = $xml->createElement("recurring");
            $recurring->setAttribute("type", strtolower($builder->recurringType));
            $recurring->setAttribute("sequence", strtolower($builder->recurringSequence));
            $request->appendChild($recurring);
        }

        //fraud filter
        $this->buildFraudFilter($builder, $xml, $request);
        
        // TODO: mpi
        if (!empty($builder->paymentMethod->threeDSecure)) {
            $mpi = $xml->createElement("mpi");
            $mpi->appendChild($xml->createElement("cavv", $builder->paymentMethod->threeDSecure->cavv));
            $mpi->appendChild($xml->createElement("xid", $builder->paymentMethod->threeDSecure->xid));
            $mpi->appendChild($xml->createElement("eci", $builder->paymentMethod->threeDSecure->eci));
            $request->appendChild($mpi);
        }
        
        $acceptedResponseCodes = $this->mapAcceptedCodes($transactionType);

        $response = $this->doTransaction($xml->saveXML($request));
        return $this->mapResponse($response, $acceptedResponseCodes);
    }
339280
public function normalizeItemNumber($itemNumber)
    {
        $itemNumber = (int) $itemNumber;

        if ($itemNumber < 1) {
            $itemNumber = 1;
        }

        if ($itemNumber > $this->getItemCountPerPage()) {
            $itemNumber = $this->getItemCountPerPage();
        }

        return $itemNumber;
    }
954593
public function getFor(Order $order, $shipmentId, array $parameters = [])
    {
        return $this->getForId($order->id, $shipmentId, $parameters);
    }
76371
private function _convertAuthorizeOnBillingAgreement($request) {
    
    	$parameters = array();
    	$parameters['Action'] = 'AuthorizeOnBillingAgreement';
    	if ($request->isSetSellerId()) {
    		$parameters['SellerId'] =  $request->getSellerId();
    	}
    	if ($request->isSetAmazonBillingAgreementId()) {
    		$parameters['AmazonBillingAgreementId'] =  $request->getAmazonBillingAgreementId();
    	}
    	if ($request->isSetAuthorizationReferenceId()) {
    		$parameters['AuthorizationReferenceId'] =  $request->getAuthorizationReferenceId();
    	}
    	if ($request->isSetAuthorizationAmount()) {
    		$authorizationAmountauthorizeOnBillingAgreementRequest = $request->getAuthorizationAmount();
    		if ($authorizationAmountauthorizeOnBillingAgreementRequest->isSetAmount()) {
    			$parameters['AuthorizationAmount' . '.' . 'Amount'] =  $authorizationAmountauthorizeOnBillingAgreementRequest->getAmount();
    		}
    		if ($authorizationAmountauthorizeOnBillingAgreementRequest->isSetCurrencyCode()) {
    			$parameters['AuthorizationAmount' . '.' . 'CurrencyCode'] =  $authorizationAmountauthorizeOnBillingAgreementRequest->getCurrencyCode();
    		}
    	}
    	if ($request->isSetSellerAuthorizationNote()) {
    		$parameters['SellerAuthorizationNote'] =  $request->getSellerAuthorizationNote();
    	}
    	if ($request->isSetTransactionTimeout()) {
    		$parameters['TransactionTimeout'] =  $request->getTransactionTimeout();
    	}
    	if ($request->isSetCaptureNow()) {
    		$parameters['CaptureNow'] =  $request->getCaptureNow() ? "true" : "false";
    	}
    	if ($request->isSetSoftDescriptor()) {
    		$parameters['SoftDescriptor'] =  $request->getSoftDescriptor();
    	}
    	if ($request->isSetSellerNote()) {
    		$parameters['SellerNote'] =  $request->getSellerNote();
    	}
    	if ($request->isSetPlatformId()) {
    		$parameters['PlatformId'] =  $request->getPlatformId();
    	}
    	if ($request->isSetSellerOrderAttributes()) {
    		$sellerOrderAttributesauthorizeOnBillingAgreementRequest = $request->getSellerOrderAttributes();
    		if ($sellerOrderAttributesauthorizeOnBillingAgreementRequest->isSetSellerOrderId()) {
    			$parameters['SellerOrderAttributes' . '.' . 'SellerOrderId'] =  $sellerOrderAttributesauthorizeOnBillingAgreementRequest->getSellerOrderId();
    		}
    		if ($sellerOrderAttributesauthorizeOnBillingAgreementRequest->isSetStoreName()) {
    			$parameters['SellerOrderAttributes' . '.' . 'StoreName'] =  $sellerOrderAttributesauthorizeOnBillingAgreementRequest->getStoreName();
    		}
    		if ($sellerOrderAttributesauthorizeOnBillingAgreementRequest->isSetOrderItemCategories()) {
    			$orderItemCategoriessellerOrderAttributes = $sellerOrderAttributesauthorizeOnBillingAgreementRequest->getOrderItemCategories();
    			foreach  ($orderItemCategoriessellerOrderAttributes->getOrderItemCategory() as $orderItemCategoryorderItemCategoriesIndex => $orderItemCategoryorderItemCategories) {
    				$parameters['SellerOrderAttributes' . '.' . 'OrderItemCategories' . '.' . 'OrderItemCategory' . '.'  . ($orderItemCategoryorderItemCategoriesIndex + 1)] =  $orderItemCategoryorderItemCategories;
    			}
    		}
    		if ($sellerOrderAttributesauthorizeOnBillingAgreementRequest->isSetCustomInformation()) {
    			$parameters['SellerOrderAttributes' . '.' . 'CustomInformation'] =  $sellerOrderAttributesauthorizeOnBillingAgreementRequest->getCustomInformation();
    		}
    	}
    	if ($request->isSetInheritShippingAddress()) {
    		$parameters['InheritShippingAddress'] =  $request->getInheritShippingAddress() ? "true" : "false";
    	}
    
    	return $parameters;
    }
257791
public function doManifest($shipmentNumbers) {
		switch($this->getMayor()) {
			case 1:
				$data = $this->createDoManifestClass_v1($shipmentNumbers);
				break;
			case 2:
			default:
				$data = $this->createDoManifestClass_v2($shipmentNumbers);
		}

		try {
			$response = $this->sendDoManifestRequest($data);
		} catch(Exception $e) {
			$this->addError($e->getMessage());

			return false;
		}

		if(is_soap_fault($response)) {
			$this->addError($response->faultstring);

			return false;
		} else
			return new Response($this->getVersion(), $response);
	}
1238523
public function getShipment($shipmentId, array $parameters = [])
    {
        return $this->client->shipments->getFor($this, $shipmentId, $parameters);
    }
861065
public function performCaptureForShipment($shipmentNumber, $amazonAuthorizationId)
    {
        $item = $this->_orderShipments[$shipmentNumber];
        
        $captureRequest = new OffAmazonPaymentsService_Model_CaptureRequest();
        $captureRequest->setSellerId($this->_sellerId);
        $captureRequest->setAmazonAuthorizationId($amazonAuthorizationId);
        $captureRequest
            ->setCaptureReferenceId($this->_captureReferenceIdBase . $shipmentNumber);
        $captureRequest->setCaptureAmount(new OffAmazonPaymentsService_Model_Price());
        $captureRequest->getCaptureAmount()->setAmount($item->price);
        $captureRequest->getCaptureAmount()->setCurrencyCode($this->_service->getMerchantValues()->getCurrency());
        
        return $this->_service->capture($captureRequest);
    }
1014688
public function captureOrderAmount($captureAmount, $amazonAuthorizationId)
    {
        $captureRequest = new OffAmazonPaymentsService_Model_CaptureRequest();
        $captureRequest->setSellerId($this->_sellerId);
        $captureRequest->setAmazonAuthorizationId($amazonAuthorizationId);
        $captureRequest->setCaptureReferenceId($this->_captureReferenceId);
        $captureRequest->setCaptureAmount(new OffAmazonPaymentsService_Model_Price());
        $captureRequest->getCaptureAmount()->setAmount($captureAmount);
        $captureRequest->getCaptureAmount()->setCurrencyCode($this->_service->getMerchantValues()->getCurrency());
         
        return $this->_service->capture($captureRequest);
    }
476442
public function updateShipmentOrder($shipmentNumber) {
		if(is_array($shipmentNumber) || $this->countShipmentOrders() > 1) {
			$this->addError(__FUNCTION__ . ': Updating Shipments is a Single-Operation only!');

			return false;
		}

		switch($this->getMayor()) {
			case 1:
				$data = null;
				break;
			case 2:
			default:
				if($this->countShipmentOrders() < 1)
					$data = $this->createShipmentClass_v2_legacy($shipmentNumber);
				else
					$data = $this->createShipmentClass_v2($shipmentNumber);
		}

		$response = null;

		// Create Shipment
		try {
			$response = $this->sendUpdateRequest($data);
		} catch(Exception $e) {
			$this->addError($e->getMessage());

			return false;
		}

		if(is_soap_fault($response)) {
			$this->addError($response->faultstring);

			return false;
		} else
			return new Response($this->getVersion(), $response);
	}