承接 merch-one/laravel-api-sdk 相关项目开发

从需求分析到上线部署,全程专人跟进,保证项目质量与交付效率

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

merch-one/laravel-api-sdk

最新稳定版本:1.0.0

Composer 安装命令:

composer require merch-one/laravel-api-sdk

包简介

Laravel extension for MerchOne API SDK

README 文档

README

MerchOne API SDK for Laravel

Packagist Version License Minimum PHP version GitHub last commit

This package provide a Laravel extension that allow developers to easily integrate with MerchOne API.

Installation

composer require merch-one/laravel-api-sdk
  • If you need config in your config root path, run php artisan vendor:publish to publish config.
php artisan vendor:publish --provider="MerchOne\LaravelApiSdk\Providers\MerchOneApiServiceProvider" --tag="config"

Overview

Introduction

This package extends merch-one/php-api-sdk.

For all package tools & possibilities, please check PHP SDK Documentation

To get the list of available endpoints, please check MerchOne API Documentation

Basic Usage

Package provides several ways to interact with.

  • You can use MerchOneApiClient facade.
use MerchOne\LaravelApiSdk\Facades\MerchOneApiClient;

class MyService
 { 
    public function doSomething(): void
     {
        $client = MerchOneApiClient::auth()->...;
    }
}
  • You can use Laravel's dependency injection.
use MerchOne\PhpApiSdk\Contracts\Http\HttpClient;

class MyService
 { 
    public function doSomething(HttpClient $client): void
     {
        $client = $client->auth()->...;
    }
}
  • You can ask Laravel's Service Container to resolve the MerchOne\PhpApiSdk\Contracts\Http\HttpClient interface.
use MerchOne\PhpApiSdk\Contracts\Http\HttpClient;

class MyService
 { 
    public function doSomething(): void
     {
        $client = app(HttpClient::class)->auth()->...;
    }
}

Once the client is instantiated, you can use all the methods described in the PHP SDK Documentation

Configuration

Once the merch-one-api config is published, you can configure the API version and Guzzle request options.

To see all available options, please check Guzzle Documentation

  • The User-Agent, Accept and Content-Type headers, as well as http_error properties CAN NOT be overwritten !

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: MIT
  • 更新时间: 2023-04-06