Skip to content

Commit 0f5b9c4

Browse files
Merge pull request #59 from PaystackHQ/patch/magento-2
updated README for Paystack v2
2 parents d5dd77a + 033aecd commit 0f5b9c4

2 files changed

Lines changed: 60 additions & 24 deletions

File tree

README.md

Lines changed: 58 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,38 @@
66

77
Paystack payment gateway Magento2 extension
88

9+
**Version:** 2.5.0 (Paystack v2 Inline.js API)
10+
11+
## Requirements
12+
13+
- Magento 2.x
14+
- PHP 8.3+
15+
- yabacon/paystack-php v2.2.0 or newer
16+
17+
## Installation
18+
19+
### Composer (Recommended)
20+
21+
Go to your Magento2 root folder and run:
22+
23+
```bash
24+
composer require pstk/paystack-magento2-module:^2.5.0
25+
php bin/magento module:enable Pstk_Paystack
26+
php bin/magento setup:upgrade
27+
php bin/magento cache:flush
28+
```
29+
30+
### Manual Installation (Custom Source)
31+
32+
Copy all files from your source folder (`plugin-magento-2`) to `app/code/Pstk/Paystack/` in your Magento installation.
33+
34+
Then run:
35+
```bash
36+
php bin/magento module:enable Pstk_Paystack
37+
php bin/magento setup:upgrade
38+
php bin/magento cache:flush
39+
```
40+
941
## Install
1042

1143
* Go to Magento2 root folder
@@ -28,35 +60,37 @@ php bin/magento setup:di:compile
2860

2961
## Configuration
3062

31-
To configure the plugin in *Magento Admin* , go to __Stores > Configuration__ from the left hand menu, then click __Payment Methods__ from the list of options. You will see __Paystack__ as part of the available Payment Methods. Click on it to configure the payment gateway.
3263

33-
* __Enabled__ - Select _Yes_ to enable Paystack Payment Gateway.
34-
* __Title__ - allows you to determine what your customers will see this payment option as on the checkout page.
35-
* __Integration Type__ - allows you to select the type of checkout experience you want on your website. Select _Inline(Popup)_ if you want your customers to checkout while still on your website, and _Redirect_ to be redirected to the payment gateway's checkout
36-
* __Test Mode__ - Check to enable test mode. Test mode enables you to test payments before going live. If you ready to start receving real payment on your site, kindly uncheck this.
37-
* __Test Secret Key__ - Enter your Test Secret Key here. Get your API keys from your [Paystack account under Settings > Developer/API](https://dashboard.paystack.com/#/settings/developer)
38-
* __Test Public Key__ - Enter your Test Public Key here. Get your API keys from your [Paystack account under Settings > Developer/API](https://dashboard.paystack.com/#/settings/developer)
39-
* __Live Secret Key__ - Enter your Live Secret Key here. Get your API keys from your [Paystack account under Settings > Developer/API](https://dashboard.paystack.com/#/settings/developer)
40-
* __Live Public Key__ - Enter your Live Public Key here. Get your API keys from your [Paystack account under Settings > Developer/API](https://dashboard.paystack.com/#/settings/developer)
41-
* Click on __Save Config__ for the changes you made to be effected.
64+
To configure the plugin in *Magento Admin*:
65+
1. Go to **Stores > Configuration > Sales > Payment Methods**.
66+
2. Find **Paystack** and configure:
67+
- **Enabled**: Yes/No
68+
- **Title**: What customers see at checkout
69+
- **Integration Type**: Inline (Popup) or Redirect
70+
- **Test Mode**: Enable for sandbox testing
71+
- **Test/Live Secret Key**: Get from your [Paystack dashboard](https://dashboard.paystack.com/#/settings/developer)
72+
- **Test/Live Public Key**: Get from your [Paystack dashboard](https://dashboard.paystack.com/#/settings/developer)
73+
3. Click **Save Config**.
74+
75+
**Note:** Inline (Popup) uses Paystack v2 Inline.js API. Make sure your CSP whitelist and RequireJS config are updated as shown in the migration guide.
4276

4377
![Magento Settings](https://res.cloudinary.com/drps6uoe4/image/upload/v1617968546/Screenshot_2021-04-09_at_10.51.31_outbpi.png)
4478

4579
## Known Errors
4680

47-
* Fail to redirect to success page after successful payment
48-
49-
Sometimes after receiving payment for an order you get an error like: `Class Yabacon\Paystack not found`
50-
and magento doesn't redirect to the `success` page.
81+
Sometimes after receiving payment for an order you get an error like: Class Yabacon\Paystack not found and magento doesn't redirect to the `success` page.
5182

52-
** Fix:
53-
Run the following command:
83+
**Fix:**
5484

85+
Run:
5586
```bash
5687
composer require yabacon/paystack-php
5788
```
89+
Enable and configure Paystack in Magento Admin under Stores/Configuration/Sales/Payment Methods
90+
91+
**Fail to redirect to success page after payment**
5892

59-
* Enable and configure `Paystack` in *Magento Admin* under `Stores/Configuration/Payment` Methods
93+
Ensure you are using Paystack v2 Inline.js and your CSP/RequireJS configs are correct.
6094

6195
[ico-version]: https://img.shields.io/packagist/v/pstk/paystack-magento2-module.svg?style=flat-square
6296
[ico-license]: https://img.shields.io/badge/license-MIT-brightgreen.svg?style=flat-square
@@ -67,16 +101,18 @@ composer require yabacon/paystack-php
67101

68102

69103
## Running the magento2 on docker
70-
Contained within this repo, is a dockerfile and a docker-compose file to quickly spin up a magento2 and mysql container with the paystack plugin installed.
104+
105+
Contained within this repo is a Dockerfile and a docker-compose file to quickly spin up Magento 2 and MySQL containers with the Paystack plugin installed.
71106

72107
### Prerequisites
73108
- Install [Docker](https://www.docker.com/)
74109

75110
### Quick Steps
76-
- Create a `.env` file off the `.env.sample` in the root directory. Replace the `*******` with the right values
77-
- Run `docker-compose up` from the root directory to build and start the mysql and magento2 containers.
78-
- Visit `localhost:8000` on your browser to access the magento store. For the admin backend, visit `localhost:8000/<MAGENTO_BACKEND_FRONTNAME>` where `MAGENTO_BACKEND_FRONTNAME` is the value you specified in your `.env` file
79-
- Run `docker-compose down` from the root directory to stop the containers.
111+
112+
- Create a `.env` file from `.env.sample` in the root directory. Fill in your values.
113+
- Run `docker-compose up` from the root directory to build and start the containers.
114+
- Visit `localhost:8000` for the Magento store. For admin, visit `localhost:8000/<MAGENTO_BACKEND_FRONTNAME>` (set in `.env`).
115+
- Run `docker-compose down` to stop the containers.
80116

81117

82118
## Documentation

composer.lock

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)