From aab3e78c1f4bc635df0c7cec64a99fcc34c21133 Mon Sep 17 00:00:00 2001 From: Sharifur Rahman Date: Sat, 3 Sep 2022 16:42:47 +0600 Subject: [PATCH 1/9] laravel 9 support added --- README.md | 10 +--------- composer.json | 6 +++--- 2 files changed, 4 insertions(+), 12 deletions(-) diff --git a/README.md b/README.md index 1ebbd8f..ab8f67b 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,5 @@ # Laravel Payfast +>> fork this to make it Laravel 9 and php 8 supported A dead simple Laravel payment processing class for payments through payfast.co.za. This package only supports ITN transactions. Laravel Payfast is strictly use at own risk. @@ -10,15 +11,6 @@ Add Laravel Payfast to your composer.json composer require billowapp/payfast ``` -Add the PayfastServiceProvider to your providers array in config/app.php - -```php -'providers' => [ - // - - 'Billow\PayfastServiceProvider' -]; -``` ### Config publish default configuration file. diff --git a/composer.json b/composer.json index eb58fa6..cfe98ba 100644 --- a/composer.json +++ b/composer.json @@ -6,12 +6,12 @@ "email": "warren@billow.co.za" } ], - "description": "Laravel 5.4+|6+|7+|8+ package for processing ITN payments through payfast.co.za", + "description": "Laravel 5.4+|6+|7+|8+|9+ package for processing ITN payments through payfast.co.za", "keywords": ["package", "laravel", "payfast"], "license": "MIT", "require": { - "illuminate/support": "^5.4|^6.0|^7.0|^8.0", - "illuminate/http": "^5.4|^6.0|^7.0|^8.0", + "illuminate/support": "^5.4|^6.0|^7.0|^8.0|^9.0", + "illuminate/http": "^5.4|^6.0|^7.0|^8.0|^9.0", "billowapp/show-me-the-money": "^0.1.2|^0.2|^0.4" }, "autoload": { From b373a4fd13354b355423ddbe05777f830b6250c5 Mon Sep 17 00:00:00 2001 From: Sharifur Rahman Date: Sat, 3 Sep 2022 17:25:14 +0600 Subject: [PATCH 2/9] laravel 9 support added --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index ab8f67b..2b07c25 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,5 @@ # Laravel Payfast ->> fork this to make it Laravel 9 and php 8 supported +> fork this to make it Laravel 9 and php 8 supported A dead simple Laravel payment processing class for payments through payfast.co.za. This package only supports ITN transactions. Laravel Payfast is strictly use at own risk. From b32c0137652e98507d49954d958ab7a47e70dad8 Mon Sep 17 00:00:00 2001 From: Sharifur Rahman Date: Sat, 3 Sep 2022 17:38:57 +0600 Subject: [PATCH 3/9] package details changed --- README.md | 9 +++++---- composer.json | 15 ++++++++------- 2 files changed, 13 insertions(+), 11 deletions(-) diff --git a/README.md b/README.md index 2b07c25..887a59b 100644 --- a/README.md +++ b/README.md @@ -1,14 +1,16 @@ # Laravel Payfast -> fork this to make it Laravel 9 and php 8 supported - A dead simple Laravel payment processing class for payments through payfast.co.za. This package only supports ITN transactions. Laravel Payfast is strictly use at own risk. +## important notice +this is a focked version of ``billowapp/payfast`` package, this package is not update for long with so i have create a fork and give support to laravel 9 and publish it in packagist so that i can use it in my private packages. +all credit to main author "Warren Hansen". + ## Installation Add Laravel Payfast to your composer.json ```bash -composer require billowapp/payfast +composer require sharifur/payfast ``` ### Config @@ -19,7 +21,6 @@ publish default configuration file. IMPORTANT: You will need to edit App\Http\Middleware\VerifyCsrfToken by adding the route, which handles the ITN response to the $excepted array. Validation is done via the ITN response. - ```php /* diff --git a/composer.json b/composer.json index cfe98ba..6eaceb5 100644 --- a/composer.json +++ b/composer.json @@ -1,18 +1,19 @@ { - "name": "billowapp/payfast", + "name": "billowapp/payfast-forked", "authors": [ { - "name": "Warren Hansen", - "email": "warren@billow.co.za" + "name": "Sharifur Rahman", + "email": "dvrobin4@gmail.com" } ], - "description": "Laravel 5.4+|6+|7+|8+|9+ package for processing ITN payments through payfast.co.za", + "description": "Laravel 9+ package for processing ITN payments through payfast.co.za", "keywords": ["package", "laravel", "payfast"], "license": "MIT", "require": { - "illuminate/support": "^5.4|^6.0|^7.0|^8.0|^9.0", - "illuminate/http": "^5.4|^6.0|^7.0|^8.0|^9.0", - "billowapp/show-me-the-money": "^0.1.2|^0.2|^0.4" + "php": ">=8.0", + "illuminate/support": "^9.0", + "illuminate/http": "^9.0", + "billowapp/show-me-the-money": "^0.4" }, "autoload": { "psr-4": { From 46027571297b70e878e0b79cd4183e8467045d25 Mon Sep 17 00:00:00 2001 From: Sharifur Rahman Date: Sat, 3 Sep 2022 17:40:41 +0600 Subject: [PATCH 4/9] change package name --- composer.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/composer.json b/composer.json index 6eaceb5..d44b7b4 100644 --- a/composer.json +++ b/composer.json @@ -1,5 +1,5 @@ { - "name": "billowapp/payfast-forked", + "name": "sharifur/payfast", "authors": [ { "name": "Sharifur Rahman", From e6725c35a4053ece2afdcdf4cce78b53b6aad945 Mon Sep 17 00:00:00 2001 From: Sharifur Rahman Date: Sun, 11 Feb 2024 10:08:22 +0600 Subject: [PATCH 5/9] Update composer.json --- composer.json | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/composer.json b/composer.json index d44b7b4..3b30377 100644 --- a/composer.json +++ b/composer.json @@ -6,13 +6,13 @@ "email": "dvrobin4@gmail.com" } ], - "description": "Laravel 9+ package for processing ITN payments through payfast.co.za", + "description": "Laravel 10+ package for processing ITN payments through payfast.co.za", "keywords": ["package", "laravel", "payfast"], "license": "MIT", "require": { - "php": ">=8.0", - "illuminate/support": "^9.0", - "illuminate/http": "^9.0", + "php": ">=8.1", + "illuminate/support": "^10.0", + "illuminate/http": "^10.0", "billowapp/show-me-the-money": "^0.4" }, "autoload": { From af694eade1e8b9e85f97828eed22a54fb7db798e Mon Sep 17 00:00:00 2001 From: Sharifur Rahman Date: Sun, 11 Feb 2024 10:26:45 +0600 Subject: [PATCH 6/9] added money class within the package --- src/Money.php | 68 +++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 68 insertions(+) create mode 100644 src/Money.php diff --git a/src/Money.php b/src/Money.php new file mode 100644 index 0000000..d0951ff --- /dev/null +++ b/src/Money.php @@ -0,0 +1,68 @@ +amount = $amount; + } + + /* + * Create new Money Object from a string value + * @param $amount + * return static + */ + public function fromString($amount = 0) + { + return new static(intval( + round($this->sub_unit * round((float) $amount, $this->default_fraction_digits, PHP_ROUND_HALF_UP), 0, PHP_ROUND_HALF_UP) + )); + } + + public function amount() + { + return intval($this->amount); + } + + public function convertedAmount($amount = null) + { + if ($amount) $this->amount = $amount; + + return round($this->amount / $this->sub_unit, $this->default_fraction_digits); + } + + public function asCurrency($amount = null, $currencySymbol = 'ZAR') + { + if ($amount) $this->amount = $amount; + return $this->getFormatter()->formatCurrency($amount, $currencySymbol); + } + + public function newMoney(int $amount) + { + return new static($amount); + } + + public function setCurrencyFormat($format): Money + { + $this->currency_format = $format; + return $this; + } + + public function getFormatter(): NumberFormatter + { + return (new NumberFormatter( + Config::get('app.locale'), + $this->currency_format + )); + } +} \ No newline at end of file From 29b8daff1adf36b78cbf7e269888f9d5ecdeb250 Mon Sep 17 00:00:00 2001 From: Sharifur Rahman Date: Sun, 11 Feb 2024 10:28:54 +0600 Subject: [PATCH 7/9] Update composer.json --- composer.json | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/composer.json b/composer.json index 3b30377..370b3ee 100644 --- a/composer.json +++ b/composer.json @@ -12,8 +12,7 @@ "require": { "php": ">=8.1", "illuminate/support": "^10.0", - "illuminate/http": "^10.0", - "billowapp/show-me-the-money": "^0.4" + "illuminate/http": "^10.0" }, "autoload": { "psr-4": { From 4bcc500f71bab20e29caae366d1d6887acaa84bc Mon Sep 17 00:00:00 2001 From: Abdullah al Noman Date: Wed, 18 Sep 2024 17:00:37 +0600 Subject: [PATCH 8/9] Namespace issue resolved --- src/Money.php | 2 +- src/Payfast.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Money.php b/src/Money.php index d0951ff..067bcd6 100644 --- a/src/Money.php +++ b/src/Money.php @@ -1,6 +1,6 @@ Date: Wed, 23 Apr 2025 17:02:33 +0600 Subject: [PATCH 9/9] feat: added support for laravel 11 --- .gitignore | 3 ++- composer.json | 6 +++--- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/.gitignore b/.gitignore index 6539eb3..ad2d8cf 100644 --- a/.gitignore +++ b/.gitignore @@ -2,4 +2,5 @@ composer.lock .DS_Store .idea -index.php \ No newline at end of file +index.php +vendor \ No newline at end of file diff --git a/composer.json b/composer.json index cfe98ba..bb53600 100644 --- a/composer.json +++ b/composer.json @@ -10,8 +10,8 @@ "keywords": ["package", "laravel", "payfast"], "license": "MIT", "require": { - "illuminate/support": "^5.4|^6.0|^7.0|^8.0|^9.0", - "illuminate/http": "^5.4|^6.0|^7.0|^8.0|^9.0", + "illuminate/support": "^10.0|^11.0|^12.0", + "illuminate/http": "^10.0|^11.0|^12.0", "billowapp/show-me-the-money": "^0.1.2|^0.2|^0.4" }, "autoload": { @@ -20,7 +20,7 @@ } }, "require-dev": { - "symfony/var-dumper": "^3.0" + "symfony/var-dumper": "^5.4|^6.0|^7.0" }, "extra": { "laravel": {