Skip to content

Commit 5235907

Browse files
Updated README.md
1 parent 2b6fa1c commit 5235907

1 file changed

Lines changed: 60 additions & 58 deletions

File tree

README.md

Lines changed: 60 additions & 58 deletions
Original file line numberDiff line numberDiff line change
@@ -6,13 +6,12 @@
66

77
Paystack payment gateway Magento2 extension
88

9-
**Version:** 2.5.0 (Paystack v2 Inline.js API)
9+
**Version:** 3.0.0 (Paystack v2 Inline.js API)
1010

1111
## Requirements
1212

13-
- Magento 2.x
14-
- PHP 8.3+
15-
- yabacon/paystack-php v2.2.0 or newer
13+
- Magento 2.4.x
14+
- PHP 8.2+
1615

1716
## Installation
1817

@@ -21,46 +20,26 @@ Paystack payment gateway Magento2 extension
2120
Go to your Magento2 root folder and run:
2221

2322
```bash
24-
composer require pstk/paystack-magento2-module:^2.5.0
23+
composer require pstk/paystack-magento2-module
2524
php bin/magento module:enable Pstk_Paystack
2625
php bin/magento setup:upgrade
26+
php bin/magento setup:di:compile
2727
php bin/magento cache:flush
2828
```
2929

30-
### Manual Installation (Custom Source)
30+
### Manual Installation
3131

32-
Copy all files from your source folder (`plugin-magento-2`) to `app/code/Pstk/Paystack/` in your Magento installation.
32+
Copy all files to `app/code/Pstk/Paystack/` in your Magento installation, then run:
3333

34-
Then run:
3534
```bash
3635
php bin/magento module:enable Pstk_Paystack
3736
php bin/magento setup:upgrade
38-
php bin/magento cache:flush
39-
```
40-
41-
## Install
42-
43-
* Go to Magento2 root folder
44-
45-
* Enter following command to install module:
46-
47-
```bash
48-
composer require pstk/paystack-magento2-module
49-
```
50-
51-
* Wait while dependencies are updated.
52-
53-
* Enter following commands to enable module:
54-
55-
```bash
56-
php bin/magento module:enable Pstk_Paystack --clear-static-content
57-
php bin/magento setup:upgrade
5837
php bin/magento setup:di:compile
38+
php bin/magento cache:flush
5939
```
6040

6141
## Configuration
6242

63-
6443
To configure the plugin in *Magento Admin*:
6544
1. Go to **Stores > Configuration > Sales > Payment Methods**.
6645
2. Find **Paystack** and configure:
@@ -72,48 +51,65 @@ To configure the plugin in *Magento Admin*:
7251
- **Test/Live Public Key**: Get from your [Paystack dashboard](https://dashboard.paystack.com/#/settings/developer)
7352
3. Click **Save Config**.
7453

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.
76-
77-
![Magento Settings](https://res.cloudinary.com/drps6uoe4/image/upload/v1617968546/Screenshot_2021-04-09_at_10.51.31_outbpi.png)
54+
### Webhook Setup
7855

79-
## Known Errors
56+
For reliable payment confirmation (especially for the redirect flow), set up a webhook in your Paystack dashboard:
8057

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.
58+
1. Go to **Settings > API Keys & Webhooks** on your [Paystack dashboard](https://dashboard.paystack.com/#/settings/developer)
59+
2. Set the Webhook URL to: `https://yourdomain.com/paystack/payment/webhook`
60+
3. The module handles `charge.success` events and automatically updates order status
8261

83-
**Fix:**
62+
## Development Environment
8463

85-
Run:
86-
```bash
87-
composer require yabacon/paystack-php
88-
```
89-
Enable and configure Paystack in Magento Admin under Stores/Configuration/Sales/Payment Methods
64+
A Docker-based development environment is included in the `dev/` directory for contributors and testing.
9065

91-
**Fail to redirect to success page after payment**
92-
93-
Ensure you are using Paystack v2 Inline.js and your CSP/RequireJS configs are correct.
66+
### Prerequisites
9467

95-
[ico-version]: https://img.shields.io/packagist/v/pstk/paystack-magento2-module.svg?style=flat-square
96-
[ico-license]: https://img.shields.io/badge/license-MIT-brightgreen.svg?style=flat-square
97-
[ico-downloads]: https://img.shields.io/packagist/dt/pstk/paystack-magento2-module.svg?style=flat-square
68+
- [Docker](https://www.docker.com/) (or [Rancher Desktop](https://rancherdesktop.io/) with `dockerd` runtime)
69+
- A [Paystack test account](https://dashboard.paystack.com/#/signup)
9870

99-
[link-packagist]: https://packagist.org/packages/pstk/paystack-magento2-module
100-
[link-downloads]: https://packagist.org/packages/pstk/paystack-magento2-module
71+
### Quick Start
10172

73+
```bash
74+
cd dev
75+
cp .env.example .env # Add your Paystack test keys
76+
docker compose up -d # First run builds the image (~5 min) and installs Magento (~3 min)
77+
bash setup.sh # Enables module, creates test products, configures everything
78+
```
10279

103-
## Running the magento2 on docker
80+
Once complete you'll see:
10481

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.
82+
```
83+
============================================
84+
Setup complete!
85+
86+
Storefront: http://localhost:8080
87+
Admin panel: http://localhost:8080/admin
88+
Admin login: admin / Admin12345!
89+
90+
Test card: 4084 0840 8408 4081
91+
Expiry: 12/30
92+
CVV: 408
93+
PIN: 0000
94+
OTP: 123456
95+
============================================
96+
```
10697

107-
### Prerequisites
108-
- Install [Docker](https://www.docker.com/)
98+
### What's Included
10999

110-
### Quick Steps
100+
- **Magento 2.4.8-p3** via [Mage-OS](https://mage-os.org/) public mirror (no Adobe marketplace auth needed)
101+
- **OpenSearch 2.19.1** + **MariaDB 10.6**
102+
- **5 test products** with images and a configured homepage
103+
- **Paystack payment** pre-configured in test mode (inline popup)
104+
- Container names: `paystack-magento`, `paystack-db`, `paystack-search`
111105

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.
106+
### Tear Down
116107

108+
```bash
109+
cd dev
110+
docker compose down # Stop containers (preserves data)
111+
docker compose down -v # Stop containers and delete all data
112+
```
117113

118114
## Documentation
119115

@@ -122,7 +118,7 @@ Contained within this repo is a Dockerfile and a docker-compose file to quickly
122118

123119
## Support
124120

125-
For bug reports and feature requests directly related to this plugin, please use the [issue tracker](https://github.com/PaystackHQ/plugin-magento-2/issues).
121+
For bug reports and feature requests directly related to this plugin, please use the [issue tracker](https://github.com/PaystackHQ/plugin-magento-2/issues).
126122

127123
For general support or questions about your Paystack account, you can reach out by sending a message from [our website](https://paystack.com/contact).
128124

@@ -134,3 +130,9 @@ If you are a developer, please join our Developer Community on [Slack](https://s
134130

135131
If you have a patch or have stumbled upon an issue with the Magento 2 plugin, you can contribute this back to the code. Please read our [contributor guidelines](https://github.com/PaystackHQ/plugin-magento-2/blob/master/CONTRIBUTING.md) for more information how you can do this.
136132

133+
[ico-version]: https://img.shields.io/packagist/v/pstk/paystack-magento2-module.svg?style=flat-square
134+
[ico-license]: https://img.shields.io/badge/license-MIT-brightgreen.svg?style=flat-square
135+
[ico-downloads]: https://img.shields.io/packagist/dt/pstk/paystack-magento2-module.svg?style=flat-square
136+
137+
[link-packagist]: https://packagist.org/packages/pstk/paystack-magento2-module
138+
[link-downloads]: https://packagist.org/packages/pstk/paystack-magento2-module

0 commit comments

Comments
 (0)