{"id":51238541,"url":"https://github.com/jtad009/cakephp-paystack","last_synced_at":"2026-06-28T22:02:29.833Z","repository":{"id":57002468,"uuid":"169544045","full_name":"jtad009/cakephp-paystack","owner":"jtad009","description":"A Cakephp 3.x Plugin for making paystack payments","archived":false,"fork":false,"pushed_at":"2023-04-24T12:54:29.000Z","size":31,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-10-02T02:57:27.686Z","etag":null,"topics":["cakephp","cakephp-paystack-component","cakephp-paystack-plugin","cakephp-plugin","paystack","paystack-cakephp","paystack-library","paystack-php"],"latest_commit_sha":null,"homepage":null,"language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/jtad009.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2019-02-07T08:59:43.000Z","updated_at":"2021-02-17T03:29:22.000Z","dependencies_parsed_at":"2022-08-21T14:10:53.336Z","dependency_job_id":null,"html_url":"https://github.com/jtad009/cakephp-paystack","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/jtad009/cakephp-paystack","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jtad009%2Fcakephp-paystack","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jtad009%2Fcakephp-paystack/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jtad009%2Fcakephp-paystack/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jtad009%2Fcakephp-paystack/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/jtad009","download_url":"https://codeload.github.com/jtad009/cakephp-paystack/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jtad009%2Fcakephp-paystack/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":34905180,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-06-28T02:00:05.809Z","response_time":54,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["cakephp","cakephp-paystack-component","cakephp-paystack-plugin","cakephp-plugin","paystack","paystack-cakephp","paystack-library","paystack-php"],"created_at":"2026-06-28T22:02:24.078Z","updated_at":"2026-06-28T22:02:29.824Z","avatar_url":"https://github.com/jtad009.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Cakephp-Paystack\nA Cakephp 3.x Plugin for making paystack payments\nInstallation\nPHP 5.4+ , and Composer are required.\n\nTo get the latest version of Cakephp Paystack, simply require it\n\n    \u003c?php\n\n        composer require jtad009/cakephp-paystack:dev-master\n    ?\u003e\n\nOr add the following line to the require block of your composer.json file.\n\n    \u003c?php\n\n        \"jtad009/cakephp-paystack\": \"dev-master\"\n    ?\u003e\n\nYou'll then need to run composer install or composer update to download it and have the autoloader updated.\n\n##General payment flow\n\nThough there are multiple ways to pay an order, most payment gateways expect you to follow the following flow in your checkout process:\n\n###1. The customer is redirected to the payment provider After the customer has gone through the checkout process and is ready to pay, the customer must be redirected to site of the payment provider.\n\nThe redirection is accomplished by submitting a form with some hidden fields. The form must post to the site of the payment provider. The hidden fields minimally specify the amount that must be paid, the order id and a hash.\n\n\n\n##Usage\nOpen your config/path.php file and add your public key, secret key, merchant email and payment url like so:\n\n    \u003c?php \n\n        define(\"PaystackPublicKey\",xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx);\n        define(\"PaystackSecretKey\",xxxxxxxxxxxxxxxxxxxxxxxxxx);\n\n    ?\u003e\n##Simple Example on how to pay with this plugin\n--Let's say a cutomer wants to pay for sms\n\nStep 1: Include the following code into your AppController.php to load the paystack component\n       \n       \u003c?php \n            require_once(ROOT . DS . 'vendor' . DS . \"jtad009\" . DS . \"cakephp-     paystack\".DS.\"src\".DS.\"Controller\".DS.\"Component\".DS.\"PayStackComponent.php\");\n            require_once(ROOT . DS . 'vendor' . DS . \"jtad009\" . DS . \"cakephp-paystack\".DS.\"src\".DS.\"Controller\".DS.\"Component\".DS.\"CurlConnectionComponent.php\");\n            \n            $this-\u003eloadComponent('PayStack.PayStack');\n            $this-\u003eloadComponent('PayStack.CurlConnection');\n        ?\u003e\n        \nStep 2:create view using the following code \n    \n    \u003c?php\n        //Note This form will be setup as per you requirement. in my case i needed to pay for sms units\n        echo $this-\u003eForm-\u003ecreate(null,['url'=\u003e['controller'=\u003e'as-per-requirement','action'=\u003e'purchase-sms']]);\n        echo $this-\u003eForm-\u003einput('amount',['templates'=\u003e['inputContainer'=\u003e'\u003cdiv class=\"form-group\"\u003e{{content}}\u003cp class=\"  mb-3 mt-2\"\u003e \u003cspan  id=\"allocatedUnits\" class=\"text-danger pull-right small \"\u003e0 \u003c/span\u003e\u003cspan class=\"small pull-right text-muted mr-2 \"\u003eUNIT(S) Worth: \u003c/span\u003e\u003cspan class=\"small text-muted mr-2\"\u003e Send to \u003c/span\u003e\u003cspan  id=\"reach\" class=\"text-danger small \"\u003e0 \u003c/span\u003e\u003c/p\u003e\u003c/div\u003e'],'class'=\u003e'form-control','style'=\u003e'resize:none','maxlength'=\u003e\"290\",'options'=\u003e['500'=\u003e'500','1000'=\u003e'1000','1500'=\u003e'1500','2000'=\u003e'2000','3000'=\u003e'3000','5000'=\u003e'5000','7000'=\u003e'7000','10000'=\u003e'10000'],'empty'=\u003e'Select amount you want to pay','id'=\u003e'sms-amount']);\n       echo $this-\u003eForm-\u003esubmit('PURCHASE UNITS',['class'=\u003e'btn btn-sm btn-danger btn-block mt-2   ']);\n       echo $this-\u003eForm-\u003eend();\n    \n    ?\u003e\n    \nStep 3: in your controller create an action, mine will be PurchaseSMS()\n    \n    \u003c?php\n    \n        public function purchaseSMS(array $data){\n            $postArray = array(\n                'description'=\u003e'SMS UNIT PURCHASE',\n                'first_name'=\u003e'EXPECTED_FIRST_NAME',//name of the person paying\n                'email' =\u003e 'EXPECTED EMAIL', //email of the person paying\n                'amount' =\u003e $data['amount'].'00',\n                'callback_url'=\u003e'https://skole.com.ng/phone-manager/success', //this points back to my website i choose to not use the callback on the dev dashboard of paystack you can choose otherwise\n                'metadata.cancel_action'=\u003e'https://skole.com.ng/phone-manager/error',\n                \"reference\" =\u003e md5(uniqid()));\n\n            $paystackResponse = $this-\u003ePayStack-\u003epayWithPaystack($postArray); //send payment details to the paystack API\n            if($paystackResponse-\u003estatus):\n            //if status is true then get refereence code for confirmation \"$paystackResponse-\u003edata-\u003ereference\"\n            \n            //take us to the payment page to \n                $this-\u003eredirect($paystackResponse-\u003edata-\u003eauthorization_url);\n            endif;\n        }\n\n        //Authorization url will redirect you to this function \n        //$routes-\u003econnect('/success/', ['controller' =\u003e 'StudentsProfiles', 'action' =\u003e 'complete']);\n        //I had set up a route to redirect to complete action when the callback_url above is lookedup by paystack\n        \n        public function complete(){\n            \n            $reference = isset($_GET['reference']) ? $_GET['reference'] : '';\n            if(!$reference){\n            die('No reference supplied');\n            }else{\n                $transactionResponse =  $this-\u003ePayStack-\u003ecallback($reference);\n                   if(!$transactionResponse-\u003estatus){\n                    // there was an error from the API\n                    $this-\u003eflash-\u003eerror('API returned error: ' . $tranx-\u003emessage);\n                  }\n\n                  if('success' == $transactionResponse-\u003edata-\u003estatus){\n                    // transaction was successful...\n                    // print out reponse and use as required\n                   debug(transactionResponse);\n\n                  }\n            }\n            \n        }\n    ?\u003e\n    \n##Todo\nCharge Returning Customers\nAdd Comprehensive Tests\nImplement Transaction Dashboard to see all of the transactions in your Cakephp app\nList/add Customers\nCreate/fetch/update Payment plans\nGet all transaction history\nManage Subsctiptions\nExport Transactions as csv\n\n\n##How can I thank you?\nWhy not star the github repo? I'd love the attention! Why not share the link for this repository on Twitter or HackerNews? Spread the word!\n\nDon't forget to follow me on \u003ca href=\"http://linkedin.com/in/israel-edet\"\u003eLinkedIn\u003c/a\u003e\n\nThanks! Israel Edet.\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjtad009%2Fcakephp-paystack","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjtad009%2Fcakephp-paystack","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjtad009%2Fcakephp-paystack/lists"}