Jump to content

Ship/Populate Package with USPS?


barkster

Recommended Posts

I've been searching around trying to find a way to send customer information to process an order to USPS to ship and I cannot find anything.  I've looked over their web tools and mainly see stuff for getting rates etc.  I found a few classes on calculating postage but nothing on processing an order for shipment.  Is this possible or anyone know of a class that I can use to do this?  Thanks

Link to comment
Share on other sites

  • 2 weeks later...

I found this for those who are interested, I've hacked it up a bit but you get the idea

 

<script src="https://sss-web.usps.com/cns/jscript/labelInformation.js"></script>

<form target="_blank" method="post" action="https://sss-web.usps.com/cns/labelInformation.do" name="labelInformationForm" id="labelInformationForm">
  <p>
    <input type="hidden" name="org.apache.struts.taglib.html.TOKEN" value="">
    </div>
    <input type="hidden" name="shortName" value="">
    <input type="hidden" name="returnShortName" value="">
    <input type="hidden" name="submitControl" value="">
    <input type="hidden" name="previousPage" value="landingView">
    <input type="hidden" name="previousPageParameters" value="deliveryCountry=1">
    <input type="hidden" name="nextPage" value="noPage">
    <input type="hidden" name="submitType" value="">
    <input type="hidden" name="packageId" value="">
    <input type="hidden" name="batch" value="false">
    <input type="hidden" name="labelId" value="">
    <input type="hidden" name="returnFullName" value="<?php echo $USPS_RETURN_FULLNAME; ?>" id="returnFullName">
    <input type="hidden" name="returnCompanyName" value="<?php echo $USPS_RETURN_COMPANY_NAME; ?>" id="returnFullName">
    <input type="hidden" name="returnAddressOne" value="<?php echo $USPS_RETURN_ADDRESSONE; ?>" id="returnAddressOne">
    <input type="hidden" name="returnAddressTwo" value="<?php echo $USPS_RETURN_ADDRESSTWO; ?>" id="returnAddressTwo">
    <input type="hidden" name="returnCity" value="<?php echo $USPS_RETURN_CITY; ?>" id="returnCity">
    <input type="hidden" name="returnState" value="<?php echo $USPS_RETURN_STATE; ?>" id="returnState">
    <input type="hidden" name="returnZipcode" value="<?php echo $USPS_RETURN_ZIPCODE; ?>" id="returnZipcode">
    <input type="hidden" name="returnPhoneNumber" value="<?php echo $USPS_RETURN_PHONENUMBER; ?>" id="returnPhoneNumber">
    <input type="hidden" name="deliveryCountry" value="<?php echo $USPS_DELIVERY_COUNTRY; ?>" id="deliveryCountry">
    <input type="hidden" name="deliveryFullName" value="<?php echo $USPS_DELIVERY_FULLENAME; ?>" id="deliveryFullName">
    <input type="hidden" name="deliveryCompanyName" value="<?php echo $USPS_DELIVERY_COMPANY; ?>" id="deliveryCompanyName">
    <input type="hidden" name="deliveryAddressOne" value="<?php echo $USPS_DELIVERY_ADDRESSONE; ?>" id="deliveryAddressOne">
    <input type="hidden" name="deliveryAddressTwo" value="<?php echo $USPS_DELIVERY_ADDRESSTWO; ?>" id="deliveryAddressTwo">
    <input type="hidden" name="deliveryCity" value="<?php echo $USPS_DELIVERY_CITY; ?>" id="deliveryCity">
    <input type="hidden" name="deliveryEmail" value="<?php echo $USPS_DELIVERY_EMAIL; ?>" id="deliveryEmail">
    <input type="hidden" name="emailNotification" value="<?php echo $USPS_DELIVERY_NOTIFY; ?>" id="emailNotification">
    <input type="hidden" name="deliveryPhoneNumber" value="<?php echo $USPS_DELIVERY_PHONE; ?>" id="deliveryPhoneNumber">
    <input type="hidden" name="deliveryRefNbr" value="<?php echo $USPS_DELIVERY_REFNUM; ?>" id="deliveryRefNbr">
    <input type="hidden" name="shippingWeightInPounds" value="<?php echo $USPS_WEIGHT_POUNDS; ?>" id="shippingWeightInPounds">
    <input type="hidden" name="shippingWeightInOunces" value="<?php echo $USPS_WEIGHT_OUNCES; ?>" id="shippingWeightInOunces">
    <input type="hidden" name="girthExceedMax" value="N" id="girthExceedMax">
    <?php if ($USPS_SHIP_FROM_ZIP == 'same') { ?>
    <input type="hidden" name="shipFromZipCode" value="same" id="shipFromZipCode">
    <?php } elseif ($USPS_SHIP_FROM_ZIP != 'same') { ?>
    <input type="hidden" name="shipFromZipCode" value="new" id="shipFromZipCode">
    <input type="hidden" name="otherZipCode" value="<?php echo $USPS_SHIP_FROM_ZIP; ?>" id="otherZipCode">
    <?php } ?>
    <?php if ($USPS_SHIP_COUNTRY == 1) { ?>
    <input type="hidden" name="deliveryState" value="<?php echo $USPS_DELIVERY_STATE; ?>" id="deliveryState">
    <input type="hidden" name="deliveryZipcode" value="<?php echo $USPS_DELIVERY_ZIP; ?>" id="deliveryZipcode">
    <?php } else { ?>
    <input type="hidden" name="deliveryAddressThree" value="" id="deliveryAddressThree">
    <input type="hidden" name="deliveryPostalCode" value="<?php echo $order_check->fields['delivery_postcode']; ?>" id="deliveryPostalCode">
    <?php if (USPS_DELIVERY_DEFAULT_CONTENTS_VALUE == "subtotal") { ?>
    <input type="hidden" name="intlContentsValue" value="<?php echo $order_total_check->fields['value']; ?>" id="intlContentsValue">
    <?php } else if (USPS_DELIVERY_DEFAULT_CONTENTS_VALUE == "total") { ?> 
    <input type="hidden" name="intlContentsValue" value="<?php echo $order_total_check2->fields['value']; ?>" id="intlContentsValue">
    <?php } else { ?>
    <input type="hidden" name="intlContentsValue" value="<?php echo USPS_DELIVERY_DEFAULT_CONTENTS_VALUE; ?>" id="intlContentsValue">
    <?php } ?>
    <input type="hidden" name="province" value="<?php echo $order_check->fields['delivery_state']; ?>" id="province">
    <input type="hidden" name="returnToSender" value="<?php echo USPS_DELIVERY_DEFAULT_NONDELIVERY; ?>" id="returnToSender">
    <input type="hidden" name="privacyActStmt" value="<?php echo USPS_DELIVERY_DEFAULT_ACKNOWLEDGE; ?>" id="privacyActStmt">
    <?php } ?>
    <?php if ($USPS_INSURANCE_VALUE == "subtotal") { ?>
    <input type="hidden" name="contentsValue" value="<?php echo $USPS_INSURANCE_VALUE; ?>" id="contentsValue">
    <?php } else if ($USPS_INSURANCE_VALUE == "total") { ?> 
    <input type="hidden" name="contentsValue" value="<?php echo $USPS_INSURANCE_VALUE; ?>" id="contentsValue">
    <?php } else { ?>
    <input type="hidden" name="contentsValue" value="<?php echo $USPS_INSURANCE_VALUE; ?>" id="contentsValue">
    <?php } ?>
</p>
  <p>
    <label>
    <input type="submit" name="button" id="button" value="Submit" />
    </label>
    <label></label>
  </p>
</form>

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.