Download the PHP package obinnaakaolisa/flutterwave-pay without Composer

On this page you can find all versions of the php package obinnaakaolisa/flutterwave-pay. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package flutterwave-pay

��# flutterwave-pay

This is a PHP package for intializing and verifying Flutterwave transactions via the Flutterave transactions API

## Requirements

The package requires the folowing resources:

1. PHP ^8.0

2. Composer

3. Curl

## Getting started

### Installation

Navigate to your project's directory

`bash

cd folder/my-project

`

In your project folder, run the following command

`bash

composer require obinnaakaolisa/flutterwave-pay

`

### Set your api key

`php

$apiKey = "FLWSECK_TEST-xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx-X";

`

### Instantiate a new transaction object

Pass in the API_KEY upon instantiation.

`php

$transaction = new FlutterwavePay($apiKey);

`

Define your payload data for a POST request.

`php

$payload = [

'txref' => 'FLWTEST'.bin2hex(randombytes(5)),

'amount' => 2000, //in naira

'redirecturl' => "https://{$SERVER['SERVER_NAME']}/verify.php",

'currency' => 'NGN',

'customer' => [

'name' => 'Firstname' .' '.'Lastname',

'email' => 'customer@email.com',

'phone_number' => '08031010101',

],

'payment_options' => "card, banktransfer, ussd",

'customizations' => [

'title' => 'Some Payment',

],

'meta' => [

'fieldname' => 'fieldvalue',

],

'subaccounts' => []

];

`

Note:

1. The customizations field is optional. Define it if you want to customize the look and feel of the payment page. See [documentation](https://developer.flutterwave.com/docs/collecting-payments/standard) for reference.

2. The subaccounts field is optional. It is only defined when you want to split the transaction into different settlement accounts. See [documentation](https://developer.flutterwave.com/docs/collecting-payments/split-payments) for reference.

2. The meta field is optional. It is only defined when you want to save additional info about the customer or the transaction. See [documentation](https://developer.flutterwave.com/docs/collecting-payments/standard) for reference.

### Intialize the transaction

The response you get for a request is a json encoded object, so you need to decode it thus:

`php

$response = json_decode($transaction->initialize($payload));

`

or

`php

$request = $transaction->initialize($payload);

$response = json_decode($request);

`

### Verifying a transaction

Upon a successfull transaction or close of the payment page, the customer will be redirected to the redirect_url you set when initiating the transaction. Normally, that's the url where you'll verify the status of the transaction.

It is advised to verify a transaction before you give value to the customer.

Define your API_KEY

`php

$apiKey = "FLWSECK_TEST-xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx-X";

`

Instantiate a new transaction object and pass in the API_KEY upon instantiation.

`php

$transaction = new FlutterwavePay($apiKey);

`

Pass in the transaction reference that was defined while intiating the transaction.

You can also get this from the query parameter of the get request returned along with the redirect_url.

`php

$response = jsondecode($transaction->verify($GET['tx_ref']));

`

## Contributing

Contributions are always welcome!

See contributing.md for ways to get started.

Please adhere to this project's code of conduct.

## License

[MIT](https://choosealicense.com/licenses/mit/)


All versions of flutterwave-pay with dependencies

PHP Build Version
Package Version
Requires php Version ^8.0
curl/curl Version ^2.5
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package obinnaakaolisa/flutterwave-pay contains the following files

Loading the files please wait ....