Giter VIP home page Giter VIP logo

osrs-toolkit-php's People

Contributors

arekpietrzyk avatar ccampbell-tc avatar chrisc97 avatar dayjo avatar detain avatar josephlimb avatar jstocks-tc avatar krisatkinson avatar nikul-bc avatar opensrs-pso avatar ryazwinski avatar tracer99 avatar trilopin avatar yptainxi avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

osrs-toolkit-php's Issues

E.T.A. for Composer Support

I'm doing some initial research in preparation for using the OpenSRS API and I'm wondering when you will finish adding support for Composer? I see that you've started adding Composer support on the develop branch. Do you have an E.T.A. for either beta or production support?

Bulk Change (unlock) fails with Exception in validateChangeType

Hi,

I'm having a hard time getting out a bulk_change request with the toolkit. It seems that the toolkit doesn't see the op_type which i pass in the data array. It's either me or the validation is bogus.

Maybe someone can point me in the right direction - I looked through the validation code and didn't see an issue. Here is my client and the response I get:

my code: http://pastebin.com/hfv6DnEn
the response: http://pastebin.com/TQGavAtM

Any help is highly appreciated.

New Release?

Some fixes have been made since 4.0.1 that solve errors we see in using the toolkit. However, these fixes are currently only in master. I've also opened #50 to fix another.

Once this is merged, would it be possible to schedule a new release?

thanks!

Request - Address validation API call

Hello!

We're currently trying to create a better UX for our users when purchasing domains, one of the issues is the necessity for us to have a manual process for registering / refunding users when they enter incorrect address information and then try and register a domain.

As there doesn't seem to be a way to verify the address details BEFORE the registration request, this causes issues as we have taken the user's money, but don't know until after that their address was invalid, this means we have to manually refund them, or ask them for valid address details and manually register the domain.

It'd be great if there was a command to 'check' a call. With Nominet's EPP there's the "check" command which allows you to request "I would like to register this domain, with these details, will this work?", and if it fails, you can show the appropriate errors to the user for them to fix before they continue to purchase and actually register the domain.

Regards,

Joel

problems with composer (structure?)

New to composer but since I want to replace the standard API we use today for opensrs, I had to start using it ...
Installed composer with no problems
Created a folder called projects and executed:
composer require opensrs/osrs-toolkit-php in that folder
The structure created was a bit confusing (sorry, but I don't know how to indent in this editor) :
projects
_ vendor
_ _ autoload.php
_ _ composer
_ _ _ autoload files
_ _ opensrs
_ _ _ osrs_toolkit_php
_ _ _ _ composer.json
_ _ _ _ demo
_ _ _ _ _ dirs and files
_ _ _ _ opensrs
_ _ _ _ _ dirs and files

Is this really correct?

Added the openSRS_config.php with correct settings.

Tested to go to http://mydomain.tld/projects/vendor/opensrs/osrs-toolkit-php/demo/
OK

Clicking on Lookup domain and it shows the page
http://mydomain.tld/projects/vendor/opensrs/osrs-toolkit-php/demo/testcase/test-lookupDomain.php?format=json
OK

Entering a domain and clicking on the Check button:
Not OK. error_log in demo/testcase/ shows that it cant find the autoloader:

require(/home/mydomain/public_html/projects/vendor/opensrs/osrs-toolkit-php/opensrs/../vendor/autoload.php): failed to open stream: No such file or directory in /home/mydomain/public_html/projects/vendor/opensrs/osrs-toolkit-php/opensrs/openSRS_loader.php on line 3

To be sure it was not a problem on the Linux server, I set up a windows version as well, but got the same errors

Please advise

//kg00

I'm getting an error saying trustSWregister is unsupported

I'm trying to implement opensrs toolkit for my laravel project.
Here is the code:

// Put the data to the Formatted array
$callstring = '';
$callArray = array(
'func' => 'trustSWregister',
'personal' => array(
'first_name' => $item->options[$set]['first_name'],
'last_name' => $item->options[$set]['last_name'],
'org_name' => isset($item->options['organization']['org_name']) ? $item->options['organization']['org_name'] : '',
'address1' => $item->options[$set]['address1'],
'city' => $item->options[$set]['city'],
'state' => $item->options[$set]['state'],
'postal_code' => $item->options[$set]['postal_code'],
'country' => $item->options[$set]['country'],
'phone' => $item->options[$set]['phone'],
'email' => $item->options[$set]['email'],
),
'data' => array(
'approver_email' => isset($item->options['approver_email']) ? $item->options['approver_email'] : '',
'csr' => $item->options['csr'],
'domain' => isset($item->options['domain']) ? $item->options['domain'] : '',
'handle' => 'process',
'product_type' => $productType->slug,
'reg_type' => 'new',
'server_type' => isset($item->options['server_type']) ? $item->options['server_type'] : '',
'period' => $item->qty,
),
);

$callstring = json_encode($callArray);

// Open SRS Call -> Result
$osrsHandler = processOpenSRS('json', $callstring);

dd($osrsHandler->resultFormatted);

This project is outdated - better options

The OSRS toolkit used inside the WHMCS module has more API requests implemented (i.e. ICANN Trade commands) - looks like OpenSRS has abandoned this project. ๐Ÿ‘Ž

PHP Fatal error: Uncaught Error: Class "opensrs\OMA\Exception" not found

Replication code:

use opensrs\OMA\GetDomain;
$oma = GetDomain::call( array() );

When we try to execute it, it will resulting error

PHP Fatal error:  Uncaught Error: Class "opensrs\OMA\Exception" not found

The issue is mainly how the Exception being initialized there:

throw new Exception('oSRS Error - Domain required');

The issue is it tries to find Exception class in opensrs/OMA namespace, which is non exists.

I am not sure which Exception class to be intended use here, but

I don't think this is PHP version issue, but here's mine:

PHP 8.1.9 (cli) (built: Aug 15 2022 09:39:52) (NTS)
Copyright (c) The PHP Group
Zend Engine v4.1.9, Copyright (c) Zend Technologies
    with Zend OPcache v8.1.9, Copyright (c), by Zend Technologies

Provide specific contact details using provSWregister function

Hi,

We are needing to provide specific contact information for Owner, Admin, Billing and Tech.
I noticed an example with a personal array of information, but we'd prefer to use the contact_set as specified in the documentation.

My solution was to edit the /opensrs/backwardcompatibility/dataconversion/domains/provisioning/SWRegister.php newStructure array to include this.

'contact_set' => array( 'owner' => 'data->contact_set->owner', 'admin' => 'data->contact_set->admin', 'billing' => 'data->contact_set->billing', 'tech' => 'data->contact_set->tech', ),

Instead of

'contact_set' => array( 'owner' => 'data->personal', 'admin' => 'data->personal', 'billing' => 'data->personal', 'tech' => 'data->personal', ),

Is that the best way to do this? I'm sure others will be wanting this functionality. I recommend using the contact_set options if personal isn't set.

$returnFullResponse behavior in AllInOneDomain.php

$returnFullResponse should behave as it say, which is return full response
but looking at the codes here :

public function customResponseHandling($arrayResult, $returnFullResponse = true)
{
if ($returnFullResponse) {
if (isset($arrayResult['attributes']['premium']['items'])) {
$tempHold = $arrayResult['attributes']['premium']['items'];
} else {
$tempHold = null;
}
$arrayResult = array(
'lookup' => $arrayResult['attributes']['lookup']['items'],
'premium' => $tempHold,
'suggestion' => $arrayResult['attributes']['suggestion']['items'],
);
}
return $arrayResult;
when $returnFullResponse = true, it instead "limiting" the response, not returning full response.

Compare with other code, e.g.

public function customResponseHandling($arrayResult, $returnFullResponse = true)
{
if (!$returnFullResponse) {
if (isset($arrayResult['attributes'])) {
$resultRaw = array();
if (isset($arrayResult['attributes']['lookup']['items'])) {
$resultRaw['lookup'] = $arrayResult['attributes']['lookup']['items'];
}
if (isset($arrayResult['attributes']['suggestion']['items'])) {
$resultRaw['suggestion'] = $arrayResult['attributes']['suggestion']['items'];
}
$arrayResult = $resultRaw;
}
}
return $arrayResult;

Unable to register .US domains with V4.0

I've added the "NEXUS" attributes to the request array, but upon creation of the stdObject for the request, the node is never added to the request object - the response is a failure complaining about the missing NEXUS CATEGORY. Even the packages DEMO fails with the same error. Suppose other TLDs requiring special parameters may be affected by something similar.

This DOES work with V3.4.4 of the PHPTook Kit.

Error with provModify validation

Trying to modify a domain to change autorenew settings but can't seem to find the right syntax.

$callArray = array(
        'func' => 'provModify',
        'data' => [
                'domain'         => $_GET['domain'],
                'affect_domains' => 0,
                'data' => [
                        'auto_renew'     => 0,
                        'let_expire'     => 1,
                ]
        ],
);

try {
    $request = new Request();
    /** @var \opensrs\Base $osrsHandler */
    $osrsHandler = $request->process('array', $callArray);
    var_dump($osrsHandler->resultRaw);
} catch (\opensrs\Exception $e) {
    var_dump($e->getMessage());
}

Produces PHP Warning:

Warning: strlen() expects parameter 1 to be string, object given in /vweb/www.afsb.net/vendor/opensrs/osrs-toolkit-php/opensrs/Base.php on line 489

And API error:

oSRS Error - data is not defined.

Fix Demos

Confirm demos are all working once issues are cleaned up.

Composer error

I cloned the toolkit but when I run the composer I get these errors:

$ ./composer.phar require opensrs/osrs-toolkit-php
Using version ^4.0 for opensrs/osrs-toolkit-php
./composer.json has been updated
Loading composer repositories with package information
Updating dependencies (including require-dev)
Your requirements could not be resolved to an installable set of packages.

  Problem 1
    - Conclusion: remove opensrs/osrs-toolkit-php dev-master
    - Can only install one of: opensrs/osrs-toolkit-php[dev-master, 4.0.0].
    - Can only install one of: opensrs/osrs-toolkit-php[dev-master, 4.0.1].
    - Installation request for opensrs/osrs-toolkit-php dev-master -> satisfiable by opensrs/osrs-toolkit-php[dev-master].
    - Installation request for opensrs/osrs-toolkit-php ^4.0 -> satisfiable by opensrs/osrs-toolkit-php[4.0.0, 4.0.1].

Any hints on how to resolve this?
thank you
gianfranco

changeDomain bug

(1) if attribute is sent with empty array I get error

    $data = [
        'domain'        => "mydomain.io",
        'attributes'    => [],
    ];

    return ChangeDomain::call(array_filter_recursive($data));
}

Response:
Array ( [0] => {"success":false,"error_number":5,"error":"Request badly formatted (missing required field, or field is not the correct data type)", "audit":"line31_576c38efe"} )

master & develop branches question

At first, project appeared unmantained.
Later I saw develop branch had recent changes and it was "531 commits ahead of master".

Are there any plan to release?
Is correct to PR master branch?

Regards

SW_Register trust/certificate function missing

Hi,

It seems that the OSRS-toolkit don't have a function for certificate creation.
We can use the provSWRegister for domain registration, but is not valid for certificate creation.

Can you help?

Cheers,
Hugo Ferreira

Composer Autoload

I try to use compose to add this lib in my project but didn't work well.

Composer is configured to use autoload PRS-4 but any namespace is used.

Lookup Domain Validation Bug

The docs say that the lookup domain function should be passed "domain" => example.com but this always returns the error "oSRS Error - domain is not defined". Looked into the validation and searchString is expected instead. The comment above the $newStructure array suggests that domain is correct and not searchString backed up by the api docs.

Issue is in vendor\opensrs\osrs-toolkit-php\opensrs\backwardcompatibility\dataconversion\domains\lookup\LookupDomain.php on line 28

change from 'domain' => 'data->searchString', to 'domain' => 'data'->domain

Critical bug in SESSID init breaking the whole toolkit in PHP7.1

I get the following bug using PHP 7.1:

In Ops.php line 196:                                               
  A non well formed numeric value encountered  

If you go to line 196 you will see

$msg_id = $this->_SESSID + $this->_MSGCNT; /* addition removes the leading zero */
And $this->_SESSID is initialised as follows in line 36

$this->_SESSID = uniqid();

And uniqid() returns a string. Thus the bug.

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.