Giter Club home page Giter Club logo

laravel-api-sdk's Introduction

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 !

laravel-api-sdk's People

Contributors

allanvb avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.