PHPackages                             magpieim/magpie-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. [API Development](/categories/api)
4. /
5. magpieim/magpie-php

ActiveLibrary[API Development](/categories/api)

magpieim/magpie-php
===================

The Magpie API Library for PHP enables you to work with Magpie APIs. Built for Laravel and modern PHP applications.

v1.1.6(7mo ago)0565MITPHPPHP ^8.1CI failing

Since Sep 5Pushed 7mo agoCompare

[ Source](https://github.com/magpieimdev/magpie-php)[ Packagist](https://packagist.org/packages/magpieim/magpie-php)[ Docs](https://github.com/magpieimdev/magpie-php)[ RSS](/packages/magpieim-magpie-php/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (8)Dependencies (10)Versions (9)Used By (0)

Magpie PHP Library
==================

[](#magpie-php-library)

The official Magpie PHP library for seamless integration with Magpie's payment processing APIs. Built for modern PHP applications and Laravel, with comprehensive support for all Magpie API features.

[![Latest Version](https://camo.githubusercontent.com/a39cf3f06fa1336c7f9dfdc55ef37f427341ff2801f4007b81b6d4701a460c7d/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f6d6167706965696d2f6d61677069652d7068702e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/magpieim/magpie-php)[![PHP Version](https://camo.githubusercontent.com/ca346a7c778140bb03ceaa586a7f8719dd3a4dac92f720b7699c8dcabe27bbc9/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f7068702d762f6d6167706965696d2f6d61677069652d7068702e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/magpieim/magpie-php)[![Total Downloads](https://camo.githubusercontent.com/9348b37f6973421a1a9507cd53c3c78bbe642b0f230471d5d583bb76c5acb51e/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f6d6167706965696d2f6d61677069652d7068702e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/magpieim/magpie-php)[![License: MIT](https://camo.githubusercontent.com/1b01ef0024ba0866c115986b895301f657c1b21fc29f05c4844b7f2e8d89204d/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f4c6963656e73652d4d49542d79656c6c6f772e7376673f7374796c653d666c61742d737175617265)](https://opensource.org/licenses/MIT)

Features
--------

[](#features)

- **💳 Complete Payment Processing**: Cards, bank transfers, e-wallets (GCash, Maya, etc.)
- **🔄 Hybrid API Design**: Choose between simple arrays or type-safe DTOs
- **🛡️ Full Type Safety**: IDE autocompletion, compile-time validation, and runtime checks
- **🔒 Secure by Design**: Built-in authentication, SSL verification, and secure error handling
- **⚡ Laravel Integration**: Service provider, facades, and configuration publishing
- **🔄 Automatic Retries**: Exponential backoff with jitter for transient failures
- **📝 Comprehensive Logging**: Debug mode with request/response logging
- **🌐 Modern HTTP Client**: Built on Guzzle with middleware support
- **⬅️ Backward Compatible**: Existing array-based code continues to work unchanged

Requirements
------------

[](#requirements)

- PHP 8.1 or higher
- Laravel 10+ (for Laravel integration features)
- Guzzle HTTP client

Installation
------------

[](#installation)

Install the package using Composer:

```
composer require magpieim/magpie-php
```

### Laravel Integration

[](#laravel-integration)

If you're using Laravel, the service provider will be auto-registered. Publish the configuration file:

```
php artisan vendor:publish --provider="Magpie\Laravel\MagpieServiceProvider" --tag="magpie-config"
```

Add your Magpie credentials to your `.env` file:

```
MAGPIE_SECRET_KEY=sk_test_your_secret_key_here
MAGPIE_DEBUG=false
```

Quick Start
-----------

[](#quick-start)

The Magpie PHP SDK supports two usage patterns: **array-based** (simple and backward compatible) and **DTO-based** (type-safe with IDE support).

### Array-Based Usage (Simple)

[](#array-based-usage-simple)

```
