Code Monkey home page Code Monkey logo

enom-sdk-php's Introduction

Installation

Since this package isn't on packegiest you need to add this repo to your composer.json:

"require": {
    "coreproc/enom-sdk-php": "dev-master"
},
"repositories": [
    {
        "type": "git",
        "url":  "https://github.com/DaWolfey/enom-sdk-php.git"
    }
]

Usage

Laravel 5.x users

Add this line in the providers array in config/app.php:

'providers' => [
    // Other Service Providers

    Coreproc\Enom\Providers\EnomServiceProvider::class,
],

Add these lines in the facades array in config/app.php:

'facades' => [
    // Other Facades

    'Tld' => Coreproc\Enom\Facades\Tld::class
    'Domain' => Coreproc\Enom\Facades\Domain::class,
],

Then run this command to publish the config file:

php artisan vendor:publish --provider="Coreproc\Enom\Providers\EnomServiceProvider"

Set up your credentials on the published file config/enom.php:

<?php

return [
    'userId'   => env('ENOM_USER_ID', ''),
    'password' => env('ENOM_PASSWORD', '')
];

You now have access to the facades Tld and Domain which you can use like so:

$tlds = Tld::getList();
$domains = Domain::getList();

No need to manually set up the Enom client - it's already done. Please see methods of each class below.

Vanilla PHP

Set up the client

$enom = new Enom('user-id', 'password');

TLDs

$tld = new Tld($enom);

try {
    $tld->authorize(['com', 'net', 'io']);
} catch (Coreproc\Enom\EnomApiException $e) {
    var_dump($e->getErrors());
}

Methods

Authorize TLDs

authorize(array $tlds)

Remove TLDs

remove(array $tlds)

Get TLD list

getList()

Domains

$domain = new Domain($enom);

try {
    $domain->check('example', 'com');
} catch (Coreproc\Enom\EnomApiException $e) {
    var_dump($e->getErrors());
}

Methods

check($sld, $tld)

getNameSpinner($sld, $tld, $options = [])

getExtendedAttributes($tld)

purchase($sld, $tld, $extendedAttributes = [])

getStatus($sld, $tld, $orderId)

getList()

getInfo($sld, $tld)

setContactInformation($sld, $tld, $contactInfo = [])

getContactInformation($sld, $tld)

getWhoIsContactInformation($sld, $tld)

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.