PHPackages                             markronquillo/magpie-php-sdk - 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. markronquillo/magpie-php-sdk

ActiveLibrary[API Development](/categories/api)

markronquillo/magpie-php-sdk
============================

PHP SDK for Magpie API

0.0.2(5y ago)07MITPHP

Since Aug 1Pushed 5y ago5 watchersCompare

[ Source](https://github.com/flairlabs/magpie-php-sdk-v2)[ Packagist](https://packagist.org/packages/markronquillo/magpie-php-sdk)[ RSS](/packages/markronquillo-magpie-php-sdk/feed)WikiDiscussions master Synced today

READMEChangelogDependencies (3)Versions (3)Used By (0)

Documentation
=============

[](#documentation)

Initialization
--------------

[](#initialization)

To initialize a Magpie instance you have to provide a set of keys

```
$pk = 'pk_test_';
$sk = 'sk_test_';
$magpie = new Magpie\Magpie($pk, $sk);
```

Customer
--------

[](#customer)

### Create Customer

[](#create-customer)

```
$pk = 'pk_test_';
$sk = 'sk_test_';
$magpie = new Magpie\Magpie($pk, $sk);
$params = [
    'email' => 'test@gmail.com',
    'description' => 'Person Name'
];
$customer = $magpie->customer->create($params);
```

### Get Customer

[](#get-customer)

```
$pk = 'pk_test_';
$sk = 'sk_test_';
$magpie = new Magpie\Magpie($pk, $sk);
$customerId = 'cus_';
$customer = $magpie->customer->get($customerId);
```

### Delete Customer

[](#delete-customer)

```
$pk = 'pk_test_';
$sk = 'sk_test_';
$magpie = new Magpie\Magpie($pk, $sk);
$customerId = 'cus_';
$customer = $magpie->customer->delete($customerId);
```

Token
-----

[](#token)

### Create Token

[](#create-token)

```
$token = $magpie->token->create([
    'card' => [
        'number' => '4242424242424242',
        'name' => 'Mark',
        'exp_month' => '02',
        'exp_year' => '2023',
        'cvc' => '2023',
    ]
]);
```

Retrieve token
--------------

[](#retrieve-token)

```
$id = 'tok_';
$cardToken = $magpie->token->get($id);
```

Charge
------

[](#charge)

### Create Charge

[](#create-charge)

```
$params = [
    "amount" => 50000,
    "currency" => "php",
    "source" => $token,
    "description" => "Pet food and other supplies",
    "statement_descriptor" => "Pet Shop Inc",
    "capture" => true
];
$charge = $magpie->charge->create($params);
```

### Retrieve Charge

[](#retrieve-charge)

```
$chargeId = 'ch_'
$charge = $magpie->charge->get($chargeId);
```

### Capture Charge

[](#capture-charge)

```
$captureCharge = $magpie->charge->capture($chargeId, [
    'amount' => 50000
]);
```

### Void Charge

[](#void-charge)

```
$magpie->charge->void($chargeId);
```

### Refund Charge

[](#refund-charge)

```
$magpie->charge->refund($chargeId, ['amount' => 50000]);
```

###  Health Score

21

—

LowBetter than 18% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity4

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity46

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~0 days

Total

2

Last Release

2162d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/1182515?v=4)[Mark Joseph Ronquillo](/maintainers/markronquillo)[@markronquillo](https://github.com/markronquillo)

---

Top Contributors

[![markronquillo](https://avatars.githubusercontent.com/u/1182515?v=4)](https://github.com/markronquillo "markronquillo (2 commits)")

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/markronquillo-magpie-php-sdk/health.svg)

```
[![Health](https://phpackages.com/badges/markronquillo-magpie-php-sdk/health.svg)](https://phpackages.com/packages/markronquillo-magpie-php-sdk)
```

###  Alternatives

[statamic/cms

The Statamic CMS Core Package

4.8k3.6M984](/packages/statamic-cms)[tencentcloud/tencentcloud-sdk-php

TencentCloudApi php sdk

3741.3M47](/packages/tencentcloud-tencentcloud-sdk-php)[neuron-core/neuron-ai

The PHP Agentic Framework.

2.0k656.1k38](/packages/neuron-core-neuron-ai)[avalara/avataxclient

Client library for Avalara's AvaTax suite of business tax calculation and processing services. Uses the REST v2 API.

528.5M7](/packages/avalara-avataxclient)[eslazarev/wildberries-sdk

Wildberries OpenAPI clients (generated).

273.0k](/packages/eslazarev-wildberries-sdk)[files.com/files-php-sdk

Files.com PHP SDK

2481.1k](/packages/filescom-files-php-sdk)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
