diff --git a/Openpay/Data/Openpay.php b/Openpay/Data/Openpay.php index 8287d27..525305d 100644 --- a/Openpay/Data/Openpay.php +++ b/Openpay/Data/Openpay.php @@ -1,74 +1,109 @@ array(), - 'Customer' => array(), - 'Card' => array(), - 'Charge' => array(), - 'Pse' => array(), - 'Payout' => array(), - 'Fee' => array(), - 'Plan' => array(), - 'Webhook' => array(), - 'Token' => array()); - - public static function getInstance($r, $p = null) + protected $derivedResources = [ + 'Bine' => [], + 'Customer' => [], + 'Card' => [], + 'Charge' => [], + 'Pse' => [], + 'Payout' => [], + 'Fee' => [], + 'Plan' => [], + 'Webhook' => [], + 'Token' => []]; + + #[Override] + protected static function getInstance($r, $p = null) { - if(version_compare(phpversion(), '8.3.0', '<')){ - $resourceName = get_class(); - } else { - $resourceName = self::class; - } + $resourceName = self::class; + return parent::getInstance($resourceName); } - public function getMerchantInfo() + /** + * Public entry used by {@see Openpay::getInstance()} (credentials already configured). + */ + public static function createRoot(): self + { + return self::getInstance(null); + } + + #[Override] + protected function getMerchantInfo() { return parent::getMerchantInfo(); } - protected function getResourceUrlName($p = true) + #[Override] + protected function getResourceUrlName($p = true): string { return ''; } @@ -41,5 +52,4 @@ public function getFullURL() { return $this->getUrl(); } - } diff --git a/composer.json b/composer.json index 320a234..6d621bb 100644 --- a/composer.json +++ b/composer.json @@ -1,6 +1,7 @@ { "name": "openpay/sdk", - "description": "This is a client implementing the payment services for Openpay at openpay.mx", + "description": "This is a client implementing the payment services for Openpay at openpay.mx (Nowo fork: reset/configure for request-safe credentials)", + "version": "3.1.1", "type": "library", "minimum-stability": "dev", "license": "Apache-2.0", @@ -14,18 +15,20 @@ "name": "Federico Balderas", "homepage": "https://openpay.mx/", "email": "plugins@openpay.mx" + }, + { + "name": "Nowo", + "homepage": "https://nowo.tech/" } ], "require": { - "php": ">=5.2.1", + "php": ">=8.1", "ext-curl": "*", "ext-hash": "*" }, - "require-dev": { - "phpunit/phpunit": "4.8.*" - }, "support": { - "issues": "https://github.com/open-pay/openpay-php/issues" + "issues": "https://github.com/nowo-tech/openpay-php/issues", + "source": "https://github.com/nowo-tech/openpay-php" }, "autoload": { "psr-4": {