定制 sadi01/yii2-post-ecommerce 二次开发

按需修改功能、优化性能、对接业务系统,提供一站式技术支持

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

sadi01/yii2-post-ecommerce

最新稳定版本:v2.0.1

Composer 安装命令:

composer require sadi01/yii2-post-ecommerce

包简介

Electronic Commerce Service of National Iranian Post Company For Yii2 Framework

README 文档

README

Electronic Commerce Service of National Iranian Post Company for Yii 2


This extension provides the Post E-Commerce Service integration for the Yii framework 2.0.

For license information check the LICENSE-file.

Installation

The preferred way to install this extension is through composer:

composer require --prefer-dist sadi01/yii2-post-ecommerce:"*"

Configuration

To use this extension, you have to configure the PostService class in your application configuration:

return [
    //....
    'components' => [
        'PostEcommerce' => [
            'class' => 'sadi01\postecommerce\components\PostService',
            'username' => 'your username',
            'password' => 'your password',
            'secretKey' => 'your secretKey',
        ],
    ]
];

To use this extension by Rest Api version, you have to configure the PostService class in your application configuration as below:

return [
    //....
    'components' => [
        'PostEcommerce' => [
            'class' => 'sadi01\postecommerce\components\PostServiceRest',
            'oauth_client' => 'Your oauth2 client ID',
            'oauth_user' => 123 // User ID
        ],
    ]
];

How To Use

Create shop:

use sadi01\postecommerce\components\PostService;
use sadi01\postecommerce\components\Shop;

$shop = new Shop([
'city_id' => 752,
'username' => 'test',
'name' => 'test',
'phone' => '0213410002',
'mobile' => '09379373737',
'email' => 'test@test.test',
'postal_code' => '7612458965',
'website_url' => 'https://test.test',
'manager_name' => 'test',
'manager_family' => 'test',
'manager_birth_date' => '1368/01/01',
'manager_national_id' => '2982561020',
'manager_national_id_serial' => '12G526713',
'start_date' => '1401/03/16',
'end_date' => '1402/03/16',
'need_to_collect' => 1,
]);

/** @var $postService PostService */
$postService = Yii::$app->PostEcommerce;
$postService->createShop($shop);

Create barcode:

use sadi01\postecommerce\components\PostService;
use sadi01\postecommerce\components\Shop;

$price = new Price([
    'shop_id' => 565656,
    'weight' => 1000,
    'service_type' => 1,
    'destination_city_id' => 1,
    'value' => 2000000,
    'payment_type' => 88,
    'non_standard_package' => 0,
    'sms_service' => 0,
]);
$packet = new Packet([
    'price' => $price,
    'order_id' => '1234',
    'customer_nid' => '1233456789',
    'customer_name' => 'test',
    'customer_family' => 'test',
    'customer_mobile' => '09379373737',
    'customer_email' => 'test@test.test',
    'customer_postal_code' => '7894561230',
    'customer_address' => 'test',
    'content' => 'test',
]);

/** @var $postService PostService */
$postService = Yii::$app->PostEcommerce;
$postService->createPacket($packet);

Tracking barcode:

use sadi01\postecommerce\components\PostService;

/** @var $postService PostService */
$postService = Yii::$app->PostEcommerce;
$postService->barcodeInfo("683690107800039750895121");

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: BSD-3-Clause
  • 更新时间: 2022-06-08