PHPackages                             jsj051/omnipay-mycard - 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. jsj051/omnipay-mycard

ActiveLibrary[Payment Processing](/categories/payments)

jsj051/omnipay-mycard
=====================

MyCard gateway for Omnipay payment processing library

1.1.1(6y ago)04MITPHP

Since Dec 4Pushed 6y agoCompare

[ Source](https://github.com/jsj051/omnipay-mycard)[ Packagist](https://packagist.org/packages/jsj051/omnipay-mycard)[ Docs](https://github.com/jsj051/omnipay-mycard)[ RSS](/packages/jsj051-omnipay-mycard/feed)WikiDiscussions master Synced yesterday

READMEChangelog (1)Dependencies (3)Versions (5)Used By (0)

Omnipay: MyCard
===============

[](#omnipay-mycard)

[![Latest Stable Version](https://camo.githubusercontent.com/c09ebb6bbfbc62d4c1cfe64960050ef20a3d873d0be69ba8a259f35e117f5aee/68747470733a2f2f706f7365722e707567782e6f72672f787874696d652f6f6d6e697061792d6d79636172642f762f737461626c65)](https://packagist.org/packages/xxtime/omnipay-mycard)[![Build Status](https://camo.githubusercontent.com/f5cd69e527ee411a7e9c69c7d95ac48ca1c55da7be4503099c6fdb2402ed3908/68747470733a2f2f7472617669732d63692e6f72672f787874696d652f6f6d6e697061792d6d79636172642e7376673f6272616e63683d6d6173746572)](https://travis-ci.org/xxtime/omnipay-mycard)[![Total Downloads](https://camo.githubusercontent.com/02124f3a116f1ef1890bc5de19b49cd855d340c482cb3cb65953dbda7173067a/68747470733a2f2f706f7365722e707567782e6f72672f787874696d652f6f6d6e697061792d6d79636172642f646f776e6c6f616473)](https://packagist.org/packages/xxtime/omnipay-mycard)[![Scrutinizer Code Quality](https://camo.githubusercontent.com/addd06c85c7b627948c2e64e64e939b29085221b324ad275a40d1efc04e8b232/68747470733a2f2f7363727574696e697a65722d63692e636f6d2f672f787874696d652f6f6d6e697061792d6d79636172642f6261646765732f7175616c6974792d73636f72652e706e673f623d6d6173746572)](https://scrutinizer-ci.com/g/xxtime/omnipay-mycard/?branch=master)[![License](https://camo.githubusercontent.com/deda2604c7506c08cd44d383aa731739ef2d8ea677eec87315760c244763a124/68747470733a2f2f706f7365722e707567782e6f72672f787874696d652f6f6d6e697061792d6d79636172642f6c6963656e7365)](https://packagist.org/packages/xxtime/omnipay-mycard)

**MyCard driver for the Omnipay PHP payment processing library**

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

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

[](#installation)

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

```
{
    "require": {
        "jsj051/omnipay-mycard": "~1.1"
    }
}
```

And run composer to update your dependencies:

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

```

Support Gateways
----------------

[](#support-gateways)

The following gateways are provided by this package:

- MyCard (MyCard Web Checkout)

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

Usage For Purchase
------------------

[](#usage-for-purchase)

```
// Initialize
$config = [
    'appId'  => 'MyCard_ServiceId',
    'appKey' => 'MyCard_Key'
];
$gateway = Omnipay::create('MyCard');
$gateway->initialize($config);

// Send purchase request
$response = $gateway->purchase(
    [
        'amount'        => '1.00',
        'currency'      => 'TWD',
        'description'   => 'product description',
        'transactionId' => mt_rand(100000, 999999),
    ]
)->send();

// Process response
if ($response->isRedirect()) {
    // doing something here
    // $token = $response->getToken();
    // $data = $response->getData();
    // $transactionReference = $response->getTransactionReference();
    $response->redirect();
}
elseif ($response->isSuccessful()) {
    // doing something here
    print_r($response);
}
else {
    echo $response->getMessage();
}
```

Usage For Notify Or Return
--------------------------

[](#usage-for-notify-or-return)

```
// Notify
$config = [
    'appId'  => 'MyCard_ServiceId',
    'appKey' => 'MyCard_Key'
];
$gateway = Omnipay::create('MyCard');
$gateway->initialize($config);
try {
    $response = $gateway->acceptNotification()->send();

    // set token (which saved when send a purchase @see Usage For Purchase)
    // $transactionId = $response->getTransactionId();
    $response->setToken('MyCard_AuthCode');
    // confirm
    $response->confirm();
    if ($response->isSuccessful()) {
        // doing something here
        // save $response->getData()['confirmData'] for further compare
        // $data = $response->getData();
    }
} catch (\Exception $e) {
    // failed logs
}
```

Usage For Query
---------------

[](#usage-for-query)

```
$gateway = Omnipay::create('MyCard');
$gateway->initialize($config);
$response = $gateway->fetchTransaction(['token' => 'MyCard_AuthCode'])->send();
// further functions below
$response->isSuccessful();
$response->getTransactionId();
$response->getAmount();
$response->getCurrency();
$response->getCardNumber();     // card number
$response->getMessage();        // message response from MyCard query api
$response->getData();           // output RAW data
```

Usage For Compare
-----------------

[](#usage-for-compare)

```
$compare = $gateway->compareTransaction();

// Get Params, Exp: ["card"=>"MC123456"] or ["startTime"=>1500000000,"endTime"=>1560000000];
$params = $compare->getParams();

// Get data from database with the $params above
$data = [
    [
        'type'                 => 'INGAME',         // INGAME, COSTPOINT Or Something Else
        'transactionId'        => '12345678',       // My Transaction Id
        'transactionReference' => 'MC973924',       // MyCard Transaction Id
        'card'                 => 'card number',    // Card Number Or Something Else
        'amount'               => '50.00',          // Amount
        'currency'             => 'TWD',            // Currency
        'account'              => 'user123',        // User Id
        'time'                 => 1500000000,       // Timestamp
    ],
    // ... more
];

// Output data
$compare->setData($data)->send();
```

Related
-------

[](#related)

[Project Home Page](https://github.com/xxtime/omnipay-mycard)
[About Usage](https://www.ctolib.com/omnipay.html)
[MyCard Official Website](https://www.mycard520.com.tw)

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/xxtime/omnipay-mycard/issues), or better yet, fork the library and submit a pull request.

###  Health Score

26

—

LowBetter than 43% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity3

Limited adoption so far

Community2

Small or concentrated contributor base

Maturity66

Established project with proven stability

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

Total

4

Last Release

2253d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/7628711?v=4)[jsj051](/maintainers/jsj051)[@jsj051](https://github.com/jsj051)

---

Tags

paymentgatewaypaymerchantomnipaypurchasemycard

### Embed Badge

![Health badge](/badges/jsj051-omnipay-mycard/health.svg)

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

###  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)
