abdulsalamishaq/sendbox 问题修复 & 功能扩展

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

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

abdulsalamishaq/sendbox

Composer 安装命令:

composer require abdulsalamishaq/sendbox

包简介

A simple Object Oriented PHP Client for Sendbox API

README 文档

README

A simple Object Oriented PHP Client for Sendbox SMS API.

Uses Sendbox API.

Requirements

  • PHP ^8.0
  • Guzzlehttp ^7.0

Installation

Via Composer.

PHP ^8.0:

composer require abdulsalamishaq/sendbox

Basic usage

<?php

// This file is generated by Composer
require_once __DIR__ . '/vendor/autoload.php';

use AbdulsalamIshaq\Sendbox\Client;

// Create a new Client instance
$client = new Client('{access_token}');

// Create a new Client instance and set options
$client = new Client('{access_token}', [
            'app_id' => '{app_id}', 
            'client_secret' => '{client_secret}',
            'refresh_token' => '{refresh_token}',
        ]);

$client->shipment->getShipments();

Shipment

Get Shipments

Uses Shipments.

<?php

// This file is generated by Composer
require_once __DIR__ . '/vendor/autoload.php';

use AbdulsalamIshaq\Sendbox\Client;

$client = new Client('{api_key}');

$client->shipment->getShipments();

Get Shipment

Uses Shipment.

<?php

// This file is generated by Composer
require_once __DIR__ . '/vendor/autoload.php';

use AbdulsalamIshaq\Sendbox\Client;

$client = new Client('{api_key}');

$client->shipment->getShipments('{shipment_id}');

Request Shipping quotes

Uses Request quotes.

<?php

// This file is generated by Composer
require_once __DIR__ . '/vendor/autoload.php';

use AbdulsalamIshaq\Sendbox\Client;

$client = new Client('{api_key}');
$quote = [
    "origin_name" => "Mrs. Hippo",
    "origin_phone" => "+2348170441446",
    "origin_street" => "Clayton St.",
    "origin_city" => "Ikorodu",
    "origin_country" => "NIGERIA",
    "origin_country_code" => "NG",
    "origin_state" => "Lagos",
    "origin_state_code" => "LOS",
    "destination_name" => "Brian",
    "destination_phone" => "+2348170441446",
    "destination_street" => "Drydock Ave Suite 610",
    "destination_city" => "Ikeja",
    "destination_country" => "NIGERIA",
    "destination_country_code" => "NG",
    "destination_state" => "Lagos",
    "destination_state_code" => "LOS",
    "weight" => "0.5",
    "items" => [
        [
            "name" => "Test Brian Iyoha",
            "quantity" => "1",
            "weight" => "1",
            "amount" => "100",
            "value" => "120000"
        ]
    ]
];

$client->shipment->quotes($quote);

Create New Shipment

Uses Create new shipment.

<?php

// This file is generated by Composer
require_once __DIR__ . '/vendor/autoload.php';

use AbdulsalamIshaq\Sendbox\Client;

$client = new Client('{api_key}');

$createShipment = [
    "origin_name" => "Mrs. Hippo",
    "origin_phone" => "+2348170441446",
    "origin_street" => "Clayton St.",
    "origin_city" => "Ikorodu",
    "origin_country" => "NIGERIA",
    "origin_country_code" => "NG",
    "origin_state" => "Lagos",
    "origin_state_code" => "LOS",
    "destination_name" => "Brian",
    "destination_phone" => "+2348170441446",
    "destination_street" => "Drydock Ave Suite 610",
    "destination_city" => "Ikeja",
    "destination_country" => "NIGERIA",
    "destination_country_code" => "NG",
    "destination_state" => "Lagos",
    "destination_state_code" => "LOS",
    "weight" => "0.5",
    "items" => [
        [
            "name" => "Test Brian Iyoha",
            "quantity" => "1",
            "weight" => "1",
            "amount" => "100",
            "value" => "120000"

        ]
    ],
    "selected_courier_id" => "rate_key_86a68758ead65de840b8f3e8e235a18f",
    "channel_code" => "api"
];

$client->shipment->create($createShipment);

Saved addresses

Uses Saved addreses.

<?php

// This file is generated by Composer
require_once __DIR__ . '/vendor/autoload.php';

use AbdulsalamIshaq\Sendbox\Client;

$client = new Client('{api_key}');

$client->shipment->addresses()

Payment

Payment Profile

Uses Profile.

<?php

// This file is generated by Composer
require_once __DIR__ . '/vendor/autoload.php';

use AbdulsalamIshaq\Sendbox\Client;

$client = new Client('{api_key}');
$client->payment->profile()

Note: This package does not include the complete api endpoints because some endpoints return 404

Testing

composer test

Changelog

Please see CHANGELOG for more information on what has changed recently.

Security Vulnerabilities

Please review our security policy on how to report security vulnerabilities.

Credits

License

The MIT License (MIT). Please see License File for more information.

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: MIT
  • 更新时间: 2022-05-15

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固