简体   繁体   中英

how to get Rate of FedEx Shipping using php

i want to get rate from get Rate of FedEx Shipping using php, but how ?

i get some code from http://www.varnagiris.net/2006/06/01/php-fedex-shipping-rates-calculator/

and code is

    $fedex = new Fedex;
    $fedex->setServer("https://gatewaybeta.fedex.com/GatewayDC");
    $fedex->setAccountNumber(123123123);
    $fedex->setMeterNumber(12312312);
    $fedex->setCarrierCode("FDXE");
    $fedex->setDropoffType("REGULARPICKUP");
    $fedex->setService($service, $serviceName);
    $fedex->setPackaging("YOURPACKAGING");
    $fedex->setWeightUnits("LBS");
    $fedex->setWeight(17);
    $fedex->setOriginStateOrProvinceCode("OH");
    $fedex->setOriginPostalCode(44333);
    $fedex->setOriginCountryCode("US");
    $fedex->setDestStateOrProvinceCode("CA");
    $fedex->setDestPostalCode(90210);
    $fedex->setDestCountryCode("US");
    $fedex->setPayorType("SENDER");

    $price = $fedex->getPrice();

but i don't know how to use it ? can you help me please.

您需要先获得一个有效的帐户,仪表号。

Firstly you need to get a valid FedEx API key.

  1. Log into the FedEx developer center: http://www.fedex.com/us/developer/web-services/index.html
  2. Download and read the documentation
  3. Develop and Test
  4. Certification.
  5. Move to production.

In order to receive approval for rate services, tracking and FedEx locator just go to step 5. Move to production and fill all the information that appears when you press the "Get Production Key" button.

FedEx will send you an email with your key, meter number, and password.

You can use some ready examples for getting rates. It will be easier for you.

  1. https://github.com/rubaiet/fedex or
  2. https://github.com/JeremyDunn/php-fedex-api-wrapper

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM