naqel/sdk 问题修复 & 功能扩展

解决BUG、新增功能、兼容多环境部署,快速响应你的开发需求

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

naqel/sdk

Composer 安装命令:

composer require naqel/sdk

包简介

A PHP wrapper for Naqel's API

README 文档

README

Build Status Packagist Packagist

Documentation

The documentation for the Naqel API can be found here.

Supported PHP Versions

This library supports the following PHP implementations:

  • PHP 7.4
  • PHP 8.0

Installation

You can install naqel-php via a composer or by downloading the source.

Via Composer:

naqel-php is available on Packagist as the naqel/sdk package:

composer require naqel/sdk

Quickstart:

Set the configurations with your credential and information:

$naqel = new \Naqel\Naqel([
    'use_sandbox' => true,
    'client_id'   => '[YOUR_CLIENT_ID]',
    'password'    => '[YOUR_CLIENT_PASSWORD]',
    'version'     => '9.0',
]);

// Set your address
$clientAddress = (new \Naqel\Models\ClientAddress())
    ->setPhoneNumber('0555555555')
    ->setFirstAddress('King Abdulaziz Street')
    ->setCountryCode('KSA')
    ->setCityCode('RUH');

// Set your contact
$clientContact = (new \Naqel\Models\ClientContact())
    ->setName('Mohammad')
    ->setPhoneNumber('05xxxxxxxx');

// Attach both address and contact to Naqel instance
$naqel->setClientAddress($clientAddress);
$naqel->setClientContact($clientContact);

Set Consignee Info:

$consigneeInfo = (new \Naqel\Models\ConsigneeInfo())
    ->setConsigneeName('Abdullah')
    ->setPhoneNumber('05xxxxxxxx')
    ->setAddress('King Salman Street')
    ->setCountryCode('KSA')
    ->setCityCode('RUH');

Set Manifest Shipment:

$manifestShipment = (new \Naqel\Models\ManifestShipment())
    ->setConsigneeInfo($consigneeInfo)
    ->setBillingType(\Naqel\Constants\BillingType::ON_ACCOUNT)
    ->setLoadTypeID(\Naqel\Constants\LoadType::NON_DOCUMENT)
    ->setPiecesCount(1)
    ->setWeight(1.0);

Create a New Waybill w/ Manifest:

$waybill = \Naqel\Waybill::create($manifestShipment);

Or you can get a waybill instance by its number

$waybill = \Naqel\Waybill::create($waybill->number());

Get the waybill number:

$waybillNumber = $waybill->number();

Get the waybill sticker as a PDF content:

$sticker = $waybill->printSticker(
    \Naqel\Constants\StickerSize::FourMFourInches
);

Versioning

naqel-php uses a SemVer for versioning. For the versions available, see the tags on this repository.

Contributing

Please read CONTRIBUTING.md for details on our code of conduct, and the process for submitting pull requests to us.

License

This project is licensed under the MIT License - see the LICENSE file for details

统计信息

  • 总下载量: 209
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 2
  • 点击次数: 0
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 2
  • Watchers: 1
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2021-01-22

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固