【问题标题】:Unable to manifest shipment for dhl ecommerce through Easypost无法通过 Easypost 为 dhl 电子商务装单
【发布时间】:2020-02-28 23:48:03
【问题描述】:

使用easypost的dhl电子商务运营商。使用他们的官方php sdk。 无法创建清单,因为我无法购买没有费率的货件。

类型:EasyPost\Error 消息:未找到费率。

文件名:G:\xampp56\htdocs\shoppina\application\libraries\easypost-php-master\lib\EasyPost\Shipment.php 行号:287 回溯: 文件:G:\xampp56\htdocs\shoppina\application\controllers\Home.php 线路:5896 函数:lowest_rate

文件:G:\xampp56\htdocs\shoppina\index.php 线路:309 函数:require_once

function easy_dummy()
{
    $api_key = $this->crud_model->get_easypost_api_key("production");
    $carrier_account_id = $this->crud_model->get_easypost_dhl_ecommerce_carrier_account_id();
    /*$carrier_account = \EasyPost\CarrierAccount::retrieve($carrier_account_id);
    echo "<pre>";
    print_r($carrier_account);
    echo "</pre>";*/

    \EasyPost\EasyPost::setApiKey($api_key);

    /*$my_carrier_accounts = \EasyPost\CarrierAccount::all();
    echo "<pre>";
    print_r($my_carrier_accounts);
    echo "</pre>";die();*/

    $to_address = \EasyPost\Address::create(
        array(
            "name" => "Dr. Steve Brule",
            "street1" => "179 N Harbor Dr",
            "city" => "Redondo Beach",
            "state" => "CA",
            "zip" => "90277",
            "phone" => "310-808-5243"
        )
    );
    $from_address = \EasyPost\Address::create(
        array(
            "company" => "EasyPost",
            "street1" => "118 2nd Street",
            "street2" => "4th Floor",
            "city" => "San Francisco",
            "state" => "CA",
            "zip" => "94105",
            "phone" => "415-456-7890"
        )
    );
    $parcel = \EasyPost\Parcel::create(
        array(
            "predefined_package" => "LargeFlatRateBox",
            "weight" => 1.0
        )
    );
    $shipment = \EasyPost\Shipment::create(
        array(
            "to_address" => $to_address,
            "from_address" => $from_address,
            "parcel" => $parcel
        )
    );

    //$shipment->buy(array('rate' => 100));

    //$shipment->insure(array('amount' => 100));



    $rates = $shipment->get_rates();

    /*echo "<pre>";
    print_r($rates);
    echo "</pre>";
    echo "<br><hr><br>";*/

    /*$shipment->buy(array(
        'rate'      => $shipment->lowest_rate(),
        'insurance' => 249.99
    ));*/

   /* echo "<pre>";
    print_r($shipment);
    echo "</pre>";
    echo "<br><hr><br>";*/

    $my_carrier_accounts = \EasyPost\CarrierAccount::all();
    echo "<pre>";
    print_r($my_carrier_accounts);
    echo "</pre>";
    echo "<br><hr><br>";

    $shipment->buy(array("rate" => $shipment->lowest_rate('dhlecommerce')));




    if ($shipment) {
        $batch = \EasyPost\Batch::create(array(
            'shipments' => array($shipment->values)
        ));

        /*echo "<pre>";
        print_r($batch);
        echo "</pre>";
        echo "<br><hr><br>";*/

        $batch->label(array('file_format' => 'png'));
        $batch->create_scan_form();

    }


    // $shipment->postage_label->label_url;
}

【问题讨论】:

    标签: php easypost dhl


    【解决方案1】:

    发送电子邮件至 support@easypost.com。他们应该会在 1 个工作日内回复您。

    【讨论】:

    • 他们第一天就回复了我,并将我与运输专家联系起来。在最初的问题讨论之后,我没有得到实际的解决方案或任何回复。
    猜你喜欢
    • 2019-04-05
    • 2023-03-04
    • 1970-01-01
    • 2017-02-07
    • 2011-10-09
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多