opensrs / osrs-toolkit-php Goto Github PK
View Code? Open in Web Editor NEWOpenSRS API Toolkit - PHP
License: MIT License
OpenSRS API Toolkit - PHP
License: MIT License
Hi there,
On line 67 of opensrs/openSRS_fastlookup.php you will find the following:
echo $callCheck . "<br/>";
https://github.com/OpenSRS/osrs-toolkit-php/blob/master/opensrs/openSRS_fastlookup.php#L67
This appears to be debug code that has accidentally been left in for production.
This line should be removed.
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?
I have successfully implement this toolkit on my local with php 5.6 version. Its works fine. But when I move it to server where php 7 is installed then it gives me this error. Have any idea about that?
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.
Fatal error: Uncaught Error: Class 'Request' not found
-- This project seems abandoned.
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!
Please add the modify_trade_lock_setting function.
This function disable the 60-days lock for the next one trade command.
https://domains.opensrs.guide/docs/modify_trade_lock_setting
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
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 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);
It is missing a method maped in php tookit for this action on documentation:
get_registrant_verification_status
pdf pag. 322
Above PHP notice always logged on most if not all opensrs requests
[29-Jul-2022 01:12:43 UTC] PHP Notice: A non well formed numeric value encountered in /vendor/opensrs/osrs-toolkit-php/opensrs/Ops.php on line 177
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. ๐
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:
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
use opensrs\Exception;
around here:throw new \Exception()
: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
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.
In opensrs\opensrs\FastLookup.php on line 131 there is a call to $this->getDomain(), which is not defined. It is defined in opensrs/Base.php
$returnFullResponse
should behave as it say, which is return full response
but looking at the codes here :
osrs-toolkit-php/opensrs/domains/lookup/AllInOneDomain.php
Lines 40 to 56 in b74c297
$returnFullResponse
= true, it instead "limiting" the response, not returning full response.
Compare with other code, e.g.
osrs-toolkit-php/opensrs/domains/lookup/NameSuggest.php
Lines 40 to 58 in b74c297
Referenced to from demo/index.php
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.
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.
Confirm demos are all working once issues are cleaned up.
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
(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"} )
I was getting an error when trying to access the "lookupGetDomainsByExpiry" route and I found that the issue is that there is a missing "i" on both the route and the class name on RequestFactory.
Here is that line:
https://github.com/OpenSRS/osrs-toolkit-php/blob/master/opensrs/RequestFactory.php#L13
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
osrs-toolkit-php/opensrs/Ops.php
Line 196 in 15d2d8c
With this line of code php throws an error, surely this should use the . to combine the variables together.
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
osrs-toolkit-php/opensrs/FastLookup.php
Line 131 in 15d2d8c
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.
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
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.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.