src/AmazonPaymentBundle/lib/amazon/OffAmazonPaymentsService/Samples/SimpleCheckoutExampleCLI.php
private function _getShippingTypeFromStdIn() 
    {
        print PHP_EOL . "Select a shipping option for the order:" . PHP_EOL;
        print "\t 1 - Overnight shipping" . PHP_EOL;
        print "\t 2 - 2-day shipping" . PHP_EOL;
        print "\t 3 - 5-day shipping" . PHP_EOL;
        print ">>";

        do {
            $shippingType = trim(fgets(STDIN));
        } while (!is_numeric($shippingType) and 
                ($shippingType < 1 or $shippingType > 3));

        return $shippingType - 1;
    }
private function _getShippingTypeFromStdIn() 
    {
        print PHP_EOL . "Select a shipping option for the order:" . PHP_EOL;
        print "\t 1 - Overnight shipping" . PHP_EOL;
        print "\t 2 - 2-day shipping" . PHP_EOL;
        print "\t 3 - 5-day shipping" . PHP_EOL;
        print ">>";

        do {
            $shippingType = trim(fgets(STDIN));
        } while (!is_numeric($shippingType) and 
                ($shippingType < 1 or $shippingType > 3));

        return $shippingType - 1;
    }
private function _getShippingTypeFromStdIn ( ) { print PHP_EOL . "Select a shipping option for the order:" . PHP_EOL ; print "\t 1 - Overnight shipping" . PHP_EOL ; print "\t 2 - 2-day shipping" . PHP_EOL ; print "\t 3 - 5-day shipping" . PHP_EOL ; print ">>" ; do { $ shippingType = trim ( fgets ( STDIN ) ) ; } while ( ! is_numeric ( $ shippingType ) and ( $ shippingType < 1 or $ shippingType > 3 ) ) ; return $ shippingType - 1 ; }
Capture the shipping type for this order, which determines
the shipping charge

@return number selected shipping type index
Capture the shipping type for this order which determines the shipping charge