PHPackages                             mfauveau/omnipay-safecharge - 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. [Payment Processing](/categories/payments)
4. /
5. mfauveau/omnipay-safecharge

ActiveLibrary[Payment Processing](/categories/payments)

mfauveau/omnipay-safecharge
===========================

SafeCharge Gateway driver for the Omnipay PHP payment processing library

2.0.3(9y ago)11.8k2[1 issues](https://github.com/mfauveau/omnipay-safecharge/issues)MITPHP

Since Jul 7Pushed 9y ago1 watchersCompare

[ Source](https://github.com/mfauveau/omnipay-safecharge)[ Packagist](https://packagist.org/packages/mfauveau/omnipay-safecharge)[ Docs](https://github.com/mfauveau/omnipay-safecharge)[ RSS](/packages/mfauveau-omnipay-safecharge/feed)WikiDiscussions master Synced 1mo ago

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

Omnipay: SafeCharge
===================

[](#omnipay-safecharge)

**SafeCharge Direct Gateway driver for the Omnipay PHP payment processing library**

[![Build Status](https://camo.githubusercontent.com/c29ff9d6df110f19f128c0bda130728ed5ad644b044b451edcd29e702d969c6d/68747470733a2f2f7472617669732d63692e6f72672f6d666175766561752f6f6d6e697061792d736166656368617267652e706e673f6272616e63683d6d6173746572)](https://travis-ci.org/mfauveau/omnipay-safecharge)[![Latest Stable Version](https://camo.githubusercontent.com/987b39a0a1ecf0e68996ce6bcd2e85bd07034fd15d9842d47876627bdd200ce0/68747470733a2f2f706f7365722e707567782e6f72672f6d666175766561752f6f6d6e697061792d736166656368617267652f76657273696f6e2e706e67)](https://packagist.org/packages/mfauveau/omnipay-safecharge)[![Total Downloads](https://camo.githubusercontent.com/cacc224f9159f0f82c2a770ae2d7af9c5dc59d89a9d94474c5fc26a445bf0535/68747470733a2f2f706f7365722e707567782e6f72672f6d666175766561752f6f6d6e697061792d736166656368617267652f642f746f74616c2e706e67)](https://packagist.org/packages/mfauveau/omnipay-safecharge)

[Omnipay](https://github.com/omnipay/omnipay) is a framework agnostic, multi-gateway payment processing library for PHP 5.3+. This package implements [SafeCharge](http://www.safecharge.com/) Gateway support for Omnipay.

If you are looking for the "SafeCharge Cashier" implementation see [Omnipay Gate2Shop](https://github.com/mfauveau/omnipay-gate2shop). It's the same thing except for the endpoint URL.

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

[](#installation)

Omnipay is installed via [Composer](http://getcomposer.org/). To install, simply add it to your `composer.json` file:

```
{
    "require": {
        "mfauveau/omnipay-safecharge": "~2.0"
    }
}
```

And run composer to update your dependencies:

```
$ curl -s http://getcomposer.org/installer | php
$ php composer.phar update

```

Usage
-----

[](#usage)

The following gateways are provided by this package:

- SafeCharge Direct Gateway (without support for 3D secure at this time, feel free to do a PR ;))

For general usage instructions, please see the main [Omnipay](https://github.com/omnipay/omnipay)repository.

### Setup

[](#setup)

```
$gateway = Omnipay::create('Safecharge');
$gateway->initialize(array(
    'username' => 'AccountTestTRX',
    'password' => 'password',
    'testMode' => true,
    'vendorId' => 'Vendor ID',
    'websiteId' => 'Website ID'
));
```

### Authorize

[](#authorize)

```
$cardData = [
    'name'          => 'John Doe',
    'number'        => '4000021059386316',
    'expiryMonth'   => '06',
    'expiryYear'    => '2016',
    'cvv'           => '123'
];

try {
    $response = $gateway->authorize([
        'amount' => '100.00',
        'currency' => 'USD',
        'card' => $cardData
    ])->send();

    if ($response->isSuccessful()) {
        print_r($response->getData());
    } else {
        print $response->getMessage();
    }
} catch (Exception $e) {
    print $e->getMessage();
}
```

### Purchase

[](#purchase)

```
$cardData = [
    'name'          => 'John Doe',
    'number'        => '4000021059386316',
    'expiryMonth'   => '06',
    'expiryYear'    => '2016',
    'cvv'           => '123'
];

try {
    $response = $gateway->purchase([
        'amount'    => '100.00',
        'currency'  => 'USD',
        'card'      => $cardData
    ])->send();

    if ($response->isSuccessful()) {
        print_r($response->getData());
    } else {
        print $response->getMessage();
    }
} catch (Exception $e) {
    print $e->getMessage();
}
```

### Purchase using a Token

[](#purchase-using-a-token)

```
try {
    $response = $gateway->purchase([
        'amount'        => '100.00',
        'currency'      => 'USD',
        'token'         => 'XXXXXXXXXXXXXXXXXXXXX',
        'transactionId' => '123456789'
    ])->send();

    if ($response->isSuccessful()) {
        print_r($response->getData());
    } else {
        print $response->getMessage();
    }
} catch (Exception $e) {
    print $e->getMessage();
}
```

### Void

[](#void)

```
try {
    $response = $gateway->void([
        'amount'        => '100.00',
        'currency'      => 'USD',
        'token'         => 'XXXXXXXXXXXXXXXXXXXXX',
        'transactionId' => '123456789',
        'authCode'      => '12345',
        'expMonth'      => '06',
        'expYear'       => '2016'
    ])->send();

    if ($response->isSuccessful()) {
        print_r($response->getData());
    } else {
        print $response->getMessage();
    }
} catch (Exception $e) {
    print $e->getMessage();
}
```

### Refund

[](#refund)

```
try {
    $response = $gateway->refund([
        'amount'        => '100.00',
        'currency'      => 'USD',
        'token'         => 'XXXXXXXXXXXXXXXXXXXXX',
        'transactionId' => '123456789',
        'authCode'      => '12345',
        'expMonth'      => '06',
        'expYear'       => '2016'
    ])->send();

    if ($response->isSuccessful()) {
        print_r($response->getData());
    } else {
        print $response->getMessage();
    }
} catch (Exception $e) {
    print $e->getMessage();
}
```

Support
-------

[](#support)

If you are having general issues with Omnipay, we suggest posting on [Stack Overflow](http://stackoverflow.com/). Be sure to add the [omnipay tag](http://stackoverflow.com/questions/tagged/omnipay) so it can be easily found.

If you want to keep up to date with release anouncements, discuss ideas for the project, or ask more detailed questions, there is also a [mailing list](https://groups.google.com/forum/#!forum/omnipay) which you can subscribe to.

If you believe you have found a bug, please report it using the [GitHub issue tracker](https://github.com/mfauveau/omnipay-safecharge/issues), or better yet, fork the library and submit a pull request.

###  Health Score

27

—

LowBetter than 49% of packages

Maintenance0

Infrequent updates — may be unmaintained

Popularity18

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity66

Established project with proven stability

 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 ~159 days

Total

4

Last Release

3491d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/dd46aa55ec780059a0c97e335b3479ce8cb04399daf9415c9f8c9d57493fb9f6?d=identicon)[mfauveau](/maintainers/mfauveau)

---

Top Contributors

[![mfauveau](https://avatars.githubusercontent.com/u/32339?v=4)](https://github.com/mfauveau "mfauveau (18 commits)")

---

Tags

composerdrivergatewaysomnipayphpsafechargesafecharge-driverpaymentgatewaypaymerchantomnipaypurchasesafecharge

### Embed Badge

![Health badge](/badges/mfauveau-omnipay-safecharge/health.svg)

```
[![Health](https://phpackages.com/badges/mfauveau-omnipay-safecharge/health.svg)](https://phpackages.com/packages/mfauveau-omnipay-safecharge)
```

###  Alternatives

[lokielse/omnipay-alipay

Alipay gateway for Omnipay payment processing library

587421.0k11](/packages/lokielse-omnipay-alipay)

PHPackages © 2026

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