Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
25 commits
Select commit Hold shift + click to select a range
e8dfd50
Merge pull request #50 from Flutterwave/development
corneliusyaovi Nov 22, 2022
9319ff7
Merge pull request #54 from Flutterwave/development
corneliusyaovi Jan 24, 2023
86adab4
Add contributing guidelines
corneliusyaovi Apr 8, 2023
ae3498e
Add redirect to support forum
corneliusyaovi Apr 8, 2023
77fd11b
Add issue template
corneliusyaovi Apr 8, 2023
b879ac1
Merge pull request #60 from Flutterwave/dev
corneliusyaovi Jul 24, 2023
2d3b55d
Merge pull request #61 from Flutterwave/dev
Abraham-Flutterwave Jul 27, 2023
bc2ad8e
Merge pull request #63 from Flutterwave/dev
Abraham-Flutterwave Feb 21, 2024
8e1f919
Merge pull request #79 from Flutterwave/dev
corneliusyaovi Apr 10, 2025
c39d4bb
Add logs for v1.1.0
corneliusyaovi Apr 10, 2025
ed39a22
Update README.md
corneliusyaovi Apr 10, 2025
41d8c14
Merge pull request #86 from Flutterwave/dev
corneliusyaovi May 19, 2025
add719b
initial sigonz update commit
bajoski34 Jun 11, 2026
0881036
setup Ona workspace setup
bajoski34 Jun 11, 2026
d62d54a
update signoz service implementation
bajoski34 Jun 11, 2026
acdcfef
clean up
bajoski34 Jun 12, 2026
4f460ea
update signoz service logger test
Abraham-Flutterwave Jun 12, 2026
8272e4a
Merge pull request #89 from bajoski34/FTPI-1660
Abraham-Flutterwave Jun 12, 2026
4fa0f69
add circuit breaker
Abraham-Flutterwave Jun 12, 2026
53be404
Merge pull request #90 from bajoski34/FTPI-1660
Abraham-Flutterwave Jun 12, 2026
b33399b
update applepay and transaction test
Abraham-Flutterwave Jun 12, 2026
2dae90f
Merge pull request #92 from bajoski34/FTPI-1660
Abraham-Flutterwave Jun 12, 2026
a6c1043
update dev sandbox settings
Abraham-Flutterwave Jun 12, 2026
9c604fd
update github workflows
Abraham-Flutterwave Jun 12, 2026
d48ee9b
Merge pull request #93 from Abraham-Flutterwave/FTPI-1660
Abraham-Flutterwave Jun 12, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 15 additions & 0 deletions .devcontainer/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
FROM mcr.microsoft.com/devcontainers/base:0-focal

RUN apt-get update && \
apt-get install -y software-properties-common && \
add-apt-repository ppa:ondrej/php -y && \
apt-get update && \
apt-get install -y \
php7.4 php7.4-cli php7.4-common php7.4-curl \
php7.4-mysql php7.4-bcmath php7.4-soap php7.4-zip php7.4-intl \
php7.4-gd php7.4-xsl php7.4-dom php7.4-mbstring \
unzip && \
rm -rf /var/lib/apt/lists/*

RUN curl -sS https://getcomposer.org/installer | php -- \
--install-dir=/usr/local/bin --filename=composer
12 changes: 12 additions & 0 deletions .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{
"name": "Ona",
"build": {
"context": ".",
"dockerfile": "Dockerfile"
},
"features": {
"ghcr.io/devcontainers/features/node:2": {},
"ghcr.io/devcontainers/features/python:1": {},
"ghcr.io/devcontainers/features/docker-in-docker:3.0.1": {}
}
}
37 changes: 37 additions & 0 deletions .github/ISSUE_TEMPLATE/bug_report.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
---
name: Bug report
about: Create a report to help us improve
title: ''
labels: ''
assignees: ''

---

Have you read our [Code of Conduct](https://github.com/Flutterwave/PHP/blob/master/CONTRIBUTING.md)? By filing an Issue, you are expected to comply with it, including treating everyone with respect.

# Description
<!-- Description of the issue -->

# Steps to Reproduce

1. <!-- First Step -->
2. <!-- Second Step -->
3. <!-- and so on… -->

## Expected behaviour
<!-- What you expect to happen -->

## Actual behaviour
<!-- What actually happens -->

## Reproduces how often
<!-- What percentage of the time does it reproduce? -->

# Configuration
- API Version: <!-- v2 or v3 -->
- Environment: <!-- test mode or live mode -->
- Browser: <!-- [all | Chrome XX | Firefox XX | IE XX | Safari XX | Mobile Chrome XX | Android X.X Web Browser | iOS XX Safari | iOS XX UIWebView | iOS XX WKWebView ] -->
- Language: <!-- [all | Node X.X | TypeScript X.X | Python X.X | ES6/7 | ES5 | Dart | Android X.X | PHP X.X | Laravel X.X ] -->

# Additional Information
<!-- Any additional information, configuration or data that might be necessary to reproduce the issue e.g. detailed explanation, stack traces, related issues, suggestions on how to fix, links for us to have more context like StackOverflow, Gitter, etc. -->
5 changes: 5 additions & 0 deletions .github/ISSUE_TEMPLATE/config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
blank_issues_enabled: false
contact_links:
- name: Developer Support Forum
url: https://forum.flutterwave.com
about: If you're having general trouble with your integration, Kindly contact our support team.
16 changes: 16 additions & 0 deletions .github/workflows/artifact-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@ on:
jobs:
build:
runs-on: ubuntu-latest
permissions:
contents: write

strategy:
matrix:
Expand All @@ -30,6 +32,20 @@ jobs:
id: tag
run: echo "VERSION=${GITHUB_REF#refs/tags/}" >> "$GITHUB_ENV"

- name: Inject SigNoz API key
env:
SIGNOZ_API_KEY: ${{ secrets.SIGNOZ_API_KEY }}
run: |
if [ -z "$SIGNOZ_API_KEY" ]; then
echo "::error::SIGNOZ_API_KEY secret is not set"
exit 1
fi
sed -i "s|%%SIGNOZ_API_KEY%%|${SIGNOZ_API_KEY}|g" src/Monitoring/SignozServiceLogger.php
if grep -q '%%SIGNOZ_API_KEY%%' src/Monitoring/SignozServiceLogger.php; then
echo "::error::Placeholder replacement failed"
exit 1
fi

- name: Create release artifact
run: |
mkdir -p build
Expand Down
18 changes: 16 additions & 2 deletions .github/workflows/change-review.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,14 +14,15 @@ jobs:
strategy:
fail-fast: true
matrix:
php: [7.4, 8.1, 8.2, 8.3]
php: [7.4, 8.1, 8.2, 8.3, 8.4]

env:
XDEBUG_MODE: coverage
PUBLIC_KEY: ${{ secrets.PUBLIC_KEY }}
SECRET_KEY: ${{ secrets.SECRET_KEY }}
ENCRYPTION_KEY: ${{ secrets.ENCRYPTION_KEY }}
ENV: ${{ secrets.ENV }}
SIGNOZ_API_KEY: ${{ secrets.SIGNOZ_API_KEY }}

steps:
- uses: actions/checkout@v3
Expand All @@ -48,14 +49,27 @@ jobs:
- name: Install dependencies
run: composer install --prefer-dist --no-progress

- name: Inject SigNoz API key
env:
SIGNOZ_API_KEY: ${{ secrets.SIGNOZ_API_KEY }}
run: |
if [ -z "$SIGNOZ_API_KEY" ]; then
echo "::error::SIGNOZ_API_KEY secret is not set"
exit 1
fi
sed -i "s|%%SIGNOZ_API_KEY%%|${SIGNOZ_API_KEY}|g" src/Monitoring/SignozServiceLogger.php
if grep -q '%%SIGNOZ_API_KEY%%' src/Monitoring/SignozServiceLogger.php; then
echo "::error::Placeholder replacement failed"
exit 1
fi

- name: run unit tests and coverage scan
run: ./vendor/bin/pest --coverage --min=20 --coverage-clover ./coverage.xml
env:
PUBLIC_KEY: ${{ secrets.PUBLIC_KEY }}
SECRET_KEY: ${{ secrets.SECRET_KEY }}
ENCRYPTION_KEY: ${{ secrets.ENCRYPTION_KEY }}
ENV: ${{ secrets.ENV }}

- name: Upload to Codecov
uses: codecov/codecov-action@v2
with:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/package-publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ jobs:
strategy:
fail-fast: true
matrix:
php: [7.4, 8.1, 8.2]
php: [7.4, 8.1, 8.2, 8.3, 8.4]

steps:
- uses: actions/checkout@v2
Expand Down
26 changes: 17 additions & 9 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,15 @@
## 1.0.6 | 2023-24-07
## 1.1.0 | 2025-04-10
Performance enhancements, feature updates and bugfixes.

Changes include:
- [ADDED] Test for card Preauthorization, ENAIRA, FAWRYPAY and GOOGLEPAY.
- [FIXED] Removed enums to support PHP v7.4 and above.
- [UPDATED] Code refactor.

## 1.0.6 | 2023-07-24
Performance Optimization and Feature Update.

Changes include:
- [FIXED] RequeryPayment method on checkout
- [ADDED] Support for TANZANIA MOBILE MONEY
- [ADDED] Support for FAWRY PAY
Expand All @@ -8,18 +18,16 @@ Performance Optimization and Feature Update.
- [UPDATED] Simplified the Custom Configuration Contract to allow for easy configuration with the package.
- [SECURITY & PERF] Checkout Process and Callback in processPayment.php

## 1.0.5 | 2023-24-01
## 1.0.5 | 2023-01-24
This change allows the package to automatically detect .env file and use the variables declared in them.

### composer updates and bugfixes
Changes include:
- [UPDATE] Log files generated in project directory.
- [REFACTOR] remove unused files from distribution.

## 1.0.4 | 2022-11-06

This release adds support for 7.4 and above. a new workflow for old and new tests.

### Dependency updates and bugfixes
## 1.0.4 | 2022-06-11
This release adds support for PHP version 7.4 and above, as well as a new workflow for old and new tests.

Changes include:
- [ADDED] Support for PHP 7.4 and above
- [ADDED] New workflow for old and new tests
- [ADDED] New workflow for old and new tests
95 changes: 95 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,95 @@
<p align="center">
<img title="Flutterwave" height="200" src="https://flutterwave.com/images/logo/full.svg" width="50%"/>
</p>

Thank you for taking the time to contribute to our libraryπŸ™ŒπŸΎ.

In this section, we detail everything you need to know about contributing to this library.


**[Code of Conduct](https://github.com/probot/template/blob/master/CODE_OF_CONDUCT.md)**

## **I don't want to contribute, I have a question**

Please don't raise an issue to ask a question. You can ask questions on our [forum](http://forum.flutterwave.com) or developer [slack](https://bit.ly/34Vkzcg). We have an army of Engineers on hand to answer your questions there.

## How can I contribute?

### Reporting a bug

Have you spotted a bug? Fantastic! Before raising an issue, here are some things to do:

1. Search to see if another user has reported the bug. For existing issues that are still open, add a comment instead of creating a new one.
2. Check our forum and developer slack to confirm that we did not address it there.

When you report an issue, it is important to:

1. Explain the problem
- Use a clear and descriptive title to help us to identify the problem.
- Describe steps we can use to replicate the bug and be as precise as possible.
- Include screenshots of the error messages.
2. Include details about your configuration and setup
- What version of the library are you using?
- Did you experience the bug on test mode or live?
- Do you have the recommended versions of the library dependencies?

<aside>

πŸ’‘ Please make use of the issue template when reporting bugs.

</aside>

### Requesting a feature

If you need an additional feature added to the library, kindly send us an email at developers@flutterwavego.com. Be sure to include the following in your request:

1. A clear title that helps us to identify the requested feature.
2. A brief description of the use case for that feature.
3. Explain how this feature would be helpful to your integration.
4. Library name and version.

### Submitting changes (PR)

Generally, you can make any of the following changes to the library:

1. Bug fixes
2. Performance improvement
3. Documentation update
4. Functionality change (usually new features)

<aside>

πŸ’‘ Changes that are cosmetic in nature and do not add anything substantial to the stability, functionality, or testability of the library will generally not be accepted.

</aside>

Follow these steps when making a pull request to the library:

1. Fork the repository and create your branch from master.
2. For all types of changes (excluding documentation updates), add tests for the changes.
3. If you are making a functionality change, update the docs to show how to use the new feature.
4. Ensure all your tests pass.
5. Make sure your code lints.
6. Write clear log messages for your commits. one-liners are fine for small changes, but bigger changes should have a more descriptive commit message (see sample below).
7. Use present tense for commit messages, "Add feature" not "Added feature”.
8. Ensure that you fill out all sections of the PR template.
9. Raise the PR against the `staging`Β branch.
10. After you submit the PR, verify that all [status checks](https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/collaborating-on-repositories-with-code-quality-features/about-status-checks) are passing

```markdown
$ git commit -m "A brief summary of the commit
>
> A paragraph describing what changed and its impact."
```

<aside>

πŸ’‘ For your pull request to be reviewed, you need to meet the requirements above. We may ask you to complete additional tests, or other changes before your pull request can be ultimately accepted.

</aside>

We encourage you to contribute and help make the library better for the community. Got questions? send us a [message](https://bit.ly/34Vkzcg).

Thank you.

The Flutterwave team πŸ¦‹
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ If you do not want to make use of composer. each [release](https://github.com/Fl

### Installation via Composer.

To install the package via Composer, run the following command.
To install the package via Composer, run the following command:
```shell
composer require flutterwavedev/flutterwave-v3
```
Expand All @@ -67,7 +67,7 @@ Save your PUBLIC_KEY, SECRET_KEY, ENV in the `.env` file
```bash
cp .env.example .env
```
Your `.env` file should look this.
Your `.env` file should look this. Make sure to retrieve your API keys from your dashboard.

```env
FLW_PUBLIC_KEY=FLWSECK_TEST-XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX-X
Expand Down
5 changes: 4 additions & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
"mockery/mockery": ">=1.2",
"symfony/var-dumper": "5.4.13",
"phpstan/phpstan": "^1.9",
"pestphp/pest": "^1.22",
"pestphp/pest": "1.22",
"nunomaduro/phpinsights": "^2.6",
"eloquent/liberator": "^3.0",
"squizlabs/php_codesniffer": "3.*",
Expand All @@ -45,6 +45,9 @@
}
],
"config": {
"platform": {
"php": "7.4"
},
"allow-plugins": {
"pestphp/pest-plugin": true,
"dealerdirect/phpcodesniffer-composer-installer": true
Expand Down
4 changes: 2 additions & 2 deletions paymentForm.php
Original file line number Diff line number Diff line change
Expand Up @@ -43,9 +43,9 @@
<!-- Replace the value with the payment button text you prefer (optional) -->
<!-- <input type="hidden" name="tx_ref" value="TEST_TXREF_--><?//= uniqid() ?><!--"/>-->
<!-- Replace the value with your transaction reference. It must be unique per transaction. You can delete this line if you want one to be generated for you. -->
<input type="hidden" name="success_url" value="http://request.lendlot.com/13b9gxc1?status=success">
<input type="hidden" name="success_url" value="https://example.com/success">
<!-- Put your success url here -->
<input type="hidden" name="failure_url" value="http://request.lendlot.com/13b9gxc1?status=failed">
<input type="hidden" name="failure_url" value="https://example.com/failure">
<!-- Put your failure url here -->
<center><input id="btn-of-destiny" class="btn btn-warning" type="submit" value="Pay Now"/></center>
</form>
Expand Down
13 changes: 12 additions & 1 deletion processPayment.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
use Flutterwave\Library\Modal;
use \Flutterwave\Config\ForkConfig;

// start a session.
// start a session for redirect metadata.
session_start();

// Define custom config.
Expand Down Expand Up @@ -39,9 +39,15 @@
$controller = new PaymentController( $client, $customHandler, $modalType );
} catch(\Exception $e ) {
echo $e->getMessage();
exit();
}

if ($_SERVER["REQUEST_METHOD"] === "POST") {
if ($controller === null) {
echo 'Unable to initialize payment controller.';
exit();
}

$request = $_REQUEST;
$request['redirect_url'] = $_SERVER['HTTP_ORIGIN'] . $_SERVER['REQUEST_URI'];
try {
Expand All @@ -54,6 +60,11 @@
$request = $_GET;
# Confirming Payment.
if(isset($request['tx_ref'])) {
if ($controller === null) {
echo 'Unable to initialize payment controller.';
exit();
}

$controller->callback( $request );
} else {

Expand Down
1 change: 1 addition & 0 deletions src/AbstractPayment.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
use Flutterwave\Contract\ConfigInterface;
use Flutterwave\EventHandlers\EventHandlerInterface;
use Flutterwave\Helper\EnvVariables;
use Flutterwave\Monitoring\SignozServiceLogger;
use Flutterwave\Traits\ApiOperations as Api;
use Flutterwave\Traits\PayloadOperations as Payload;
use Psr\Log\LoggerInterface;
Expand Down
Loading