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 1mo ago

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 19% 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

2108d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/bbe48452b0bcc9c999d0a2ffbe93bb9036aea6597f97e60c7e5ac82a5179f970?d=identicon)[markronquillo](/maintainers/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

[tencentcloud/tencentcloud-sdk-php

TencentCloudApi php sdk

3731.2M42](/packages/tencentcloud-tencentcloud-sdk-php)[convertkit/convertkitapi

Kit PHP SDK for the Kit API

2167.1k1](/packages/convertkit-convertkitapi)[mapado/rest-client-sdk

Rest Client SDK for hydra API

1125.9k2](/packages/mapado-rest-client-sdk)

PHPackages © 2026

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