简体   繁体   English

如何使用 php 获取联邦快递运费

[英]how to get Rate of FedEx Shipping using php

i want to get rate from get Rate of FedEx Shipping using php, but how ?我想使用 php 从获取 FedEx Shipping 的费率中获取费率,但是如何?

i get some code from http://www.varnagiris.net/2006/06/01/php-fedex-shipping-rates-calculator/我从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.首先,您需要获得有效的 FedEx API 密钥。

  1. Log into the FedEx developer center: http://www.fedex.com/us/developer/web-services/index.html登录 FedEx 开发者中心: 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 定位器的批准,只需转到第 5 步。转到生产并填写按“获取生产密钥”按钮时出现的所有信息。

FedEx will send you an email with your key, meter number, and password. FedEx 将向您发送一封电子邮件,其中包含您的密钥、仪表编号和密码。

You can use some ready examples for getting rates.您可以使用一些现成的示例来获取费率。 It will be easier for you.这对你来说会更容易。

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

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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