sdk-php
sdk-php copied to clipboard
Cannot use "parent" when current class scope has no parent
I am using PHP v7.4.4 with authorizenet/authorizenet
v2.0.0 and got these errors, please fix the issues or how to get around these errors, thanks!
<b>Unknown</b>: Cannot use "parent" when current class scope has no parent in <b>/vagrant/zeus/vendor/authorizenet/authorizenet/lib/net/authorize/api/contract/v1/MerchantAuthenticationType.php</b> on line <b>291</b><b>Unknown</b>: Cannot use "parent" when current class scope has no parent in <b>/vagrant/zeus/vendor/authorizenet/authorizenet/lib/net/authorize/api/contract/v1/CreditCardSimpleType.php</b> on line <b>100</b><b>Unknown</b>: Cannot use "parent" when current class scope has no parent in <b>/vagrant/zeus/vendor/authorizenet/authorizenet/lib/net/authorize/api/contract/v1/PaymentType.php</b> on line <b>263</b><b>Unknown</b>: Cannot use "parent" when current class scope has no parent in <b>/vagrant/zeus/vendor/authorizenet/authorizenet/lib/net/authorize/api/contract/v1/NameAndAddressType.php</b> on line <b>262</b><b>Unknown</b>: Cannot use "parent" when current class scope has no parent in <b>/vagrant/zeus/vendor/authorizenet/authorizenet/lib/net/authorize/api/contract/v1/CustomerPaymentProfileBaseType.php</b> on line <b>100</b><b>Unknown</b>: Cannot use "parent" when current class scope has no parent in <b>/vagrant/zeus/vendor/authorizenet/authorizenet/lib/net/authorize/api/contract/v1/ANetApiRequestType.php</b> on line <b>129</b><b>Unknown</b>: Cannot use "parent" when current class scope has no parent in <b>/vagrant/zeus/vendor/authorizenet/authorizenet/lib/net/authorize/api/contract/v1/ANetApiResponseType.php</b> on line <b>127</b><b>Unknown</b>: Cannot use "parent" when current class scope has no parent in <b>/vagrant/zeus/vendor/authorizenet/authorizenet/lib/net/authorize/api/contract/v1/MessagesType.php</b> on line <b>134</b><b>Unknown</b>: Cannot use "parent" when current class scope has no parent in <b>/vagrant/zeus/vendor/authorizenet/authorizenet/lib/net/authorize/api/contract/v1/MessagesType/MessageAType.php</b> on line <b>97</b>
yea, same problem. Trying to move my application to a new server and coming across the same error.
@AllCdnBoy Please let me know when you have a fix for this issue, thanks!
I replaced my "authorizenet/authorizenet": "2.0", with "authorizenet/authorizenet": "dev-master#ef297d3e2d7c1092ddabd2c376eb485aac1aa66c" and it's working now.
@AllCdnBoy dev-master#ef297d3e2d7c1092ddabd2c376eb485aac1aa66c is working, thank you so much! Even though, it is working but dev-master#ef297d3e2d7c1092ddabd2c376eb485aac1aa66c
is private repo so I am looking for a real package version likes 2.1. Please let me know when that happens, thanks!
Don't hold your breath. This was a reported issue 9 months ago and there haven't been any updates to the repo in 2 years. I've been working with Authorize.net for a client for 6 years and they are very antiquated. I don't expect an update anytime soon.
@AllCdnBoy I see, thanks!
Same here. When I use it in a queue'd job, it throws me this error; but when I use it in run-time it works fine (with php 7.2)
I think its an old library and many php functions are deprecated, getting the same issue, im using php .7.2 laravel 6 "authorizenet/authorizenet": "^2.0",
Same problem here using php 7.4.
Same problem. Hoping this repo gets some more attention.
Same here.
php 7.4
"authorizenet/authorizenet": "^2.0",
Codeigniter 3.
Does authorize.net not care about transactions from php backends anymore?
Where is all their money coming from that they would abandon this repository?
I replaced my "authorizenet/authorizenet": "2.0", with "authorizenet/authorizenet": "dev-master#ef297d3e2d7c1092ddabd2c376eb485aac1aa66c" and it's working now.
Where did you replace this? In a file? what file. Sorry I am confused, having the same issue
@AllCdnBoy Where did you replace this "authorizenet/authorizenet": "2.0"? In a file? what file. Sorry I am confused, having the same issue...
This is in my composer file. I replaced the original authorize.net package with the dev package.
Am in shock with this am running with the same issue. Authorize.net is not longer maintenancing this repo? our brands are running daily several transactions which are paid to Auth.net and they are not supporting the php backend which is our API provider, should i change the company service or what??
This is a common theme amongst these processors. I'm running into the exact same problem with Moneris
@AllCdnBoy thank you palm! your hotifix works like a charm!
I replaced my "authorizenet/authorizenet": "2.0", with "authorizenet/authorizenet": "dev-master#ef297d3e2d7c1092ddabd2c376eb485aac1aa66c" and it's working now.
Which PR is this commit from?
Also, unrelated...imagine me coming all this way to find @AllCdnBoy who's from the same place I am!
What Branch do you use? Master?
What Branch do you use? Master?
I copied it exactly as above into my composer.json
and ran composer update
Sorry for being dense, but when I add the line in the require section, it complains:
[RuntimeException]
Root package 'authorizenet/authorizenet' cannot require itself in its composer.json
Did you accidentally name your root package after an external package?
if I remove the first line with the "name" then I get this:
Install of authorizenet/authorizenet failed
[RuntimeException]
Failed to clone [email protected]:AuthorizeNet/sdk-php.git, git was not found, check that it is installed and in your
PATH env.
'git' is not recognized as an internal or external command,
operable program or batch file.
Here is my composer file:
{
"type": "library",
"description": "Official PHP SDK for Authorize.Net",
"keywords": ["authorizenet", "authorize.net", "payment", "ecommerce"],
"license": "proprietary",
"homepage": "http://developer.authorize.net",
"require": {
"php": ">=5.6",
"ext-curl": "",
"ext-json": "",
"authorizenet/authorizenet": "dev-master#ef297d3e2d7c1092ddabd2c376eb485aac1aa66c"
},
"require-dev": {
"phpunit/phpunit": "~4.0",
"phpmd/phpmd": "~2.0"
},
"autoload": {
"classmap": ["lib"]
},
"autoload-dev": {
"classmap": ["tests"]
}
}
Thank you for your help!
You put that line in your projects composer.json
.
Sorry for being dense, but when I add the line in the require section, it complains: [RuntimeException] Root package 'authorizenet/authorizenet' cannot require itself in its composer.json Did you accidentally name your root package after an external package? if I remove the first line with the "name" then I get this: Install of authorizenet/authorizenet failed [RuntimeException] Failed to clone [email protected]:AuthorizeNet/sdk-php.git, git was not found, check that it is installed and in your PATH env. 'git' is not recognized as an internal or external command, operable program or batch file. Here is my composer file: { "type": "library", "description": "Official PHP SDK for Authorize.Net", "keywords": ["authorizenet", "authorize.net", "payment", "ecommerce"], "license": "proprietary", "homepage": "http://developer.authorize.net", "require": { "php": ">=5.6", "ext-curl": "", "ext-json": "", "authorizenet/authorizenet": "dev-master#ef297d3e2d7c1092ddabd2c376eb485aac1aa66c" }, "require-dev": { "phpunit/phpunit": "~4.0", "phpmd/phpmd": "~2.0" }, "autoload": { "classmap": ["lib"] }, "autoload-dev": { "classmap": ["tests"] } } Thank you for your help!
Hey there, try to upgrade php version to at least 7.2, then remove the "authorizenet/authorizenet" package from your composer.json, then remove all vendor folder and run "composer install", once you composer ran successfully try to add the package through CLI i mean "composer require authorizenet/authorizenet". Once the .net package is installed update the composer.json to "dev-master#ef297d3e2d7c1092ddabd2c376eb485aac1aa66c" and then hit composer update authorizenet/authorizenet
What, exactly, are you doing?
Can we see your composer.json
?
That's the wrong composer.json. You're supposed to be editing your project's composer.json NOT package's.
Which composer.json are you putting this in? Show us the path please.
Okay, so here's a question I think is worth asking.
If we're using an abandoned development branch to get around a full-on bug, what guarantees do we have that this development branch is using secure methods for payment processing? Clearly regression testing isn't being done on the master branch for core functionality, so is it even safe to use this package? Especially considering this is an SDK for handling sensitive credit card information?
Is there any good reason aside from maybe cost for me to use this package instead of Stripe? I mean, Stripe has a ton of verified integrations and they're modern. And their core PHP functionality isn't broken.
Edit: *I'm also asking these questions out of actual ignorance - I'm more than happy if I'm just being heckin' paranoid :)
So is this package basically dead? No PHP 7.4 support? Does anyone have any recommendations for another library for Authorize.net, or do I basically have to roll my own?
I've got this in my composer.json
and it works. This is the reference to the PR that adds this. Plan on forking so it won't go away.
"authorizenet/authorizenet": "dev-master#ef297d3e2d7c1092ddabd2c376eb485aac1aa66c",
@mbiang hey there, what it said @edalzell is correct on my end works as well, i was running with weird responses using master branch but i changed my composer.json on the require block by "authorizenet/authorizenet": "dev-master#ef297d3e2d7c1092ddabd2c376eb485aac1aa66c", then i ran the composer install command removing that all the folder vendor/authorizenet and that works pretty well, your application should be good doing those changes