PHPackages                             domdanao/magpiepay-sdk-php - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [HTTP &amp; Networking](/categories/http)
4. /
5. domdanao/magpiepay-sdk-php

ActiveLibrary[HTTP &amp; Networking](/categories/http)

domdanao/magpiepay-sdk-php
==========================

MagpiePay API for QRPh and Disbursement services

v1.0.0-alpha.11(5mo ago)03unlicensePHPPHP ^8.1

Since Nov 25Pushed 5mo agoCompare

[ Source](https://github.com/domdanao/magpiepay-sdk-php)[ Packagist](https://packagist.org/packages/domdanao/magpiepay-sdk-php)[ Docs](https://openapi-generator.tech)[ RSS](/packages/domdanao-magpiepay-sdk-php/feed)WikiDiscussions main Synced 1mo ago

READMEChangelogDependencies (5)Versions (4)Used By (0)

domdanao/magpiepay-sdk-php
==========================

[](#domdanaomagpiepay-sdk-php)

Magpie API for QRPh and Disbursement services

Installation &amp; Usage
------------------------

[](#installation--usage)

### Requirements

[](#requirements)

PHP 8.1 and later.

### Composer

[](#composer)

To install the bindings via [Composer](https://getcomposer.org/), run:

```
composer require domdanao/magpiepay-sdk-php
```

### Manual Installation

[](#manual-installation)

Download the files and include `autoload.php`:

```

### Laravel Integration

This package includes a Laravel Service Provider for easy integration.

#### Configuration

1.  Add your MagpiePay API key to your `.env` file:

    ```env
    MAGPIEPAY_API_KEY=your_api_key_here
    ```

2.  (Optional) Publish the configuration file:

    ```bash
    php artisan vendor:publish --provider="MagpiePay\Laravel\MagpiePayServiceProvider"
    ```

#### Usage

You can inject the API clients directly into your controllers or services. The Service Provider will automatically configure them with your API key.

```php
use MagpiePay\Api\PaymentsApi;

public function index(PaymentsApi $api)
{
    try {
        $payments = $api->listPayments();
        return response()->json($payments);
    } catch (\Exception $e) {
        return response()->json(['error' => $e->getMessage()], 500);
    }
}

```

Getting Started
---------------

[](#getting-started)

Please follow the [installation procedure](#installation--usage) and then run the following:

```
