@@ -314,7 +314,7 @@ public function setCodSettings($cu, $r = null, $c = null, $ct = null, $s = null,
314314 return false ;
315315 }
316316 if (isset ($ r )) {
317- if (filter_var ($ s , FILTER_VALIDATE_BOOLEAN )) {
317+ if (filter_var ($ r , FILTER_VALIDATE_BOOLEAN )) {
318318 $ r = 'true ' ;
319319 } else {
320320 $ r = 'false ' ;
@@ -364,9 +364,13 @@ public function resetCodSettings(){
364364 * The parameters are passed through <i>strtotime</i>, so values such as "-1 hour" are fine.
365365 * @param string $s <p>A time string for the earliest time.</p>
366366 * @param string $e <p>A time string for the latest time.</p>
367+ * @return boolean <b>FALSE</b> if improper input
367368 * @see genTime
368369 */
369370 public function setDeliveryWindow ($ s , $ e ){
371+ if (empty ($ s ) || empty ($ e )) {
372+ return false ;
373+ }
370374 $ times = $ this ->genTime ($ s );
371375 $ this ->options ['DeliveryWindow.StartDateTime ' ] = $ times ;
372376 $ timee = $ this ->genTime ($ e );
@@ -480,7 +484,7 @@ protected function resetItems(){
480484 */
481485 public function createOrder (){
482486 if (!array_key_exists ('SellerFulfillmentOrderId ' ,$ this ->options )){
483- $ this ->log ("Seller Fulfillment OrderID must be set in order to create an order " ,'Warning ' );
487+ $ this ->log ("Seller Fulfillment Order ID must be set in order to create an order " ,'Warning ' );
484488 return false ;
485489 }
486490 if (!array_key_exists ('DisplayableOrderId ' ,$ this ->options )){
@@ -531,39 +535,13 @@ public function createOrder(){
531535 * Updates a Fulfillment Order with Amazon.
532536 *
533537 * Submits an <i>UpdateFulfillmentOrder</i> request to Amazon. In order to do this,
534- * a number of parameters are required. Amazon will send back an HTTP response,
535- * so there is no data to retrieve afterwards. The following parameters are required:
536- * fulfillment order ID, displayed order ID, displayed timestamp, comment,
537- * shipping speed, address, and items.
538+ * a fulfillment order ID is required. Amazon will send back an HTTP response,
539+ * so there is no data to retrieve afterwards.
538540 * @return boolean <b>TRUE</b> if the order creation was successful, <b>FALSE</b> if something goes wrong
539541 */
540542 public function updateOrder (){
541543 if (!array_key_exists ('SellerFulfillmentOrderId ' ,$ this ->options )){
542- $ this ->log ("Seller Fulfillment OrderID must be set in order to create an order " ,'Warning ' );
543- return false ;
544- }
545- if (!array_key_exists ('DisplayableOrderId ' ,$ this ->options )){
546- $ this ->log ("Displayable Order ID must be set in order to create an order " ,'Warning ' );
547- return false ;
548- }
549- if (!array_key_exists ('DisplayableOrderDateTime ' ,$ this ->options )){
550- $ this ->log ("Date must be set in order to create an order " ,'Warning ' );
551- return false ;
552- }
553- if (!array_key_exists ('DisplayableOrderComment ' ,$ this ->options )){
554- $ this ->log ("Comment must be set in order to create an order " ,'Warning ' );
555- return false ;
556- }
557- if (!array_key_exists ('ShippingSpeedCategory ' ,$ this ->options )){
558- $ this ->log ("Shipping Speed must be set in order to create an order " ,'Warning ' );
559- return false ;
560- }
561- if (!array_key_exists ('DestinationAddress.Name ' ,$ this ->options )){
562- $ this ->log ("Address must be set in order to create an order " ,'Warning ' );
563- return false ;
564- }
565- if (!array_key_exists ('Items.member.1.SellerSKU ' ,$ this ->options )){
566- $ this ->log ("Items must be set in order to create an order " ,'Warning ' );
544+ $ this ->log ("Seller Fulfillment Order ID must be set in order to update an order " ,'Warning ' );
567545 return false ;
568546 }
569547
@@ -581,7 +559,7 @@ public function updateOrder(){
581559 if (!$ this ->checkResponse ($ response )){
582560 return false ;
583561 } else {
584- $ this ->log ("Successfully created Fulfillment Order " .$ this ->options ['SellerFulfillmentOrderId ' ]. " / " . $ this -> options [ ' DisplayableOrderId ' ]);
562+ $ this ->log ("Successfully updated Fulfillment Order " .$ this ->options ['SellerFulfillmentOrderId ' ]);
585563 return true ;
586564 }
587565 }
0 commit comments