PHPackages                             nash81/bsicards-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. nash81/bsicards-php-sdk

ActiveLibrary[API Development](/categories/api)

nash81/bsicards-php-sdk
=======================

PHP SDK for BSICARDS - Card Issuance API

v1.1.0(1mo ago)04↓100%1MITPHPPHP &gt;=8.1CI passing

Since Mar 11Pushed 1mo agoCompare

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

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

BSICARDS PHP SDK
================

[](#bsicards-php-sdk)

A comprehensive PHP SDK for integrating with the BSICARDS Card Issuance API. Create and manage Mastercard, Visa, and Digital Wallet cards with ease.

[![PHP Version](https://camo.githubusercontent.com/0e453ac103a792731f3ece9ec10b3119ecc4e74b4ab84ae491bf91f0cdd0ff6f/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f7068702d253345253344382e312d627269676874677265656e)](https://www.php.net/)[![License](https://camo.githubusercontent.com/b8cadaa967891081f8f165695470689986c028821dd8a040132f6e661795dc0d/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f6c6963656e73652d4d49542d626c7565)](LICENSE)[![Composer](https://camo.githubusercontent.com/18af985ea6412a5ae3357ede6d718b87cdda8d14e06f1f266c258a260b722475/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f636f6d706f7365722d617661696c61626c652d627269676874677265656e)](https://packagist.org/)

Features
--------

[](#features)

- ✅ **MasterCard Issuance** - Create and manage MasterCards
- ✅ **Visa Card Issuance** - Create and manage Visa Cards
- ✅ **Digital Wallet Cards** - Create and manage Digital Wallet cards
- ✅ **Digital Visa Wallet Cards** - Virtual Visa cards with GPay/Apple Pay &amp; 3DS auto-approve
- ✅ **Card Management** - Freeze, unfreeze, change PIN, view transactions
- ✅ **Card Funding** - Fund cards with minimum $10.00
- ✅ **Transaction History** - View detailed transaction records
- ✅ **Laravel Support** - Built-in service provider and configuration
- ✅ **Environment Configuration** - Secure credential management via .env
- ✅ **Type Safe** - Full PHP type hints and PHPDoc documentation
- ✅ **Error Handling** - Custom exceptions for API errors

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

[](#requirements)

- PHP &gt;= 8.1
- Composer
- GuzzleHTTP 7.0+

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

[](#installation)

### Via Composer

[](#via-composer)

```
composer require nash81/bsicards-php-sdk:^1.0
```

This package now publishes stable semantic version tags. The first stable release is `v1.0.0`, so Composer can resolve it normally without lowering your project's stability settings.

If you prefer, installing without an explicit constraint will also resolve the latest stable release:

```
composer require nash81/bsicards-php-sdk
```

### Packagist Auto-Update Setup

[](#packagist-auto-update-setup)

If Packagist shows "This package is not auto-updated", set up one of the following:

1. GitHub Hook (recommended by Packagist)

    - Open your package on Packagist
    - Click `Update` / `Auto Update`
    - Connect your GitHub repository (`nash81/bsicards-php-sdk`)
    - Packagist will create/manage the webhook
2. GitHub Actions fallback (included in this repo)

    - Add this GitHub repository secret:
        - `PACKAGIST_TOKEN`
    - Workflow file: `.github/workflows/packagist-update.yml`
    - This workflow pings Packagist for `https://github.com/nash81/bsicards-php-sdk` on push/release

### Manual Setup

[](#manual-setup)

1. Clone the repository
2. Copy `src/` and `config/` directories to your project
3. Ensure Composer autoload is configured

Configuration
-------------

[](#configuration)

### Environment Variables

[](#environment-variables)

Create a `.env` file in your project root:

```
BSICARDS_PUBLIC_KEY=your_public_key_here
BSICARDS_SECRET_KEY=your_secret_key_here
```

### Laravel Setup

[](#laravel-setup)

For Laravel projects, the service provider is auto-discovered. Add credentials to your `.env`:

```
BSICARDS_PUBLIC_KEY=your_public_key
BSICARDS_SECRET_KEY=your_secret_key
```

Optional: Publish configuration file:

```
php artisan vendor:publish --tag=bsicards-config
```

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

[](#quick-start)

### Basic Usage

[](#basic-usage)

```
use BSICards\BSICardsClient;
use BSICards\APIException;

// Initialize client (credentials from .env)
$client = new BSICardsClient();

try {
    // Create a MasterCard
    $response = $client->mastercardCreateCard(
        'user@example.com',
        'John Doe',
        '1234'
    );

    echo "Card created: " . $response['message'];
} catch (APIException $e) {
    echo "Error: " . $e->getMessage();
}
```

### Laravel Usage

[](#laravel-usage)

```
use BSICards\BSICardsClient;

class CardController extends Controller
{
    public function createCard(BSICardsClient $client)
    {
        $response = $client->mastercardCreateCard(
            request('email'),
            request('name'),
            request('pin')
        );

        return response()->json($response);
    }
}
```

API Methods
-----------

[](#api-methods)

### MasterCard Operations

[](#mastercard-operations)

```
// Create a new MasterCard
$client->mastercardCreateCard($email, $name, $pin);

// Get all MasterCards
$client->mastercardGetAllCards($email);

// Get pending MasterCards
$client->mastercardGetPendingCards($email);

// Get specific card details
$client->mastercardGetCard($email, $cardId);

// Get card transactions
$client->mastercardGetTransactions($email, $cardId);

// Change card PIN
$client->mastercardChangePin($email, $cardId, $newPin);

// Freeze card
$client->mastercardFreezeCard($email, $cardId);

// Unfreeze card
$client->mastercardUnfreezeCard($email, $cardId);

// Fund card (minimum $10.00)
$client->mastercardFundCard($email, $cardId, '50.00');
```

### Visa Card Operations

[](#visa-card-operations)

```
// Create a new Visa card
$client->visaCreateCard(
    $email,
    $name,
    $nationalIdNumber,
    $nationalIdImageUrl,
    $userPhotoUrl,
    '1990-01-15' // DOB
);

// Get all Visa cards
$client->visaGetAllCards($email);

// Get pending Visa cards
$client->visaGetPendingCards($email);

// Get specific card
$client->visaGetCard($email, $cardId);

// Get transactions
$client->visaGetTransactions($email, $cardId);

// Freeze/Unfreeze
$client->visaFreezeCard($email, $cardId);
$client->visaUnfreezeCard($email, $cardId);

// Fund card
$client->visaFundCard($email, $cardId, '50.00');
```

### Digital Wallet Operations

[](#digital-wallet-operations)

```
// Create virtual card
$client->digitalCreateVirtualCard(
    $email,
    $firstName,
    $lastName,
    '1990-01-15',
    $address,
    $postalCode,
    $city,
    'GB', // Country code
    $state,
    '44', // Country phone code
    $phone
);

// Get all cards
$client->digitalGetAllCards($email);

// Get specific card
$client->digitalGetCard($email, $cardId);

// Fund card
$client->digitalFundCard($email, $cardId, $amount);

// Freeze/Unfreeze
$client->digitalFreezeCard($email, $cardId);
$client->digitalUnfreezeCard($email, $cardId);

// Check 3DS verification
$client->digitalCheck3DS($email);

// Approve 3DS transaction
$client->digitalApprove3DS($email, $cardId, $eventId);

// Terminate card
$client->digitalTerminateCard($email, $cardId);

// Create add-on card
$client->digitalCreateAddonCard($email, $cardId);

// Loyalty points
$client->digitalGetLoyaltyPoints($email, $cardId);
$client->digitalRedeemPoints($email, $cardId);
```

### Digital Visa Wallet Operations

[](#digital-visa-wallet-operations)

Virtual Visa cards with 3DS auto-approve, Google Pay, and Apple Pay support.

```
// Create a virtual Visa wallet card (minimum $5 funding deducted on creation)
$client->visaWalletCreateVirtualCard($email, $firstName, $lastName);

// Get all Visa wallet cards
$client->visaWalletGetAllCards($email);

// Get specific card details (includes full card number, CVV, transactions)
$client->visaWalletGetCard($email, $cardId);

// Fund card (minimum $5.00)
$client->visaWalletFundCard($email, $cardId, '50.00');

// Get OTP for GPay / Apple Pay provisioning
$client->visaWalletGetOTP($email, $cardId);

// Block / Unblock card
$client->visaWalletBlockCard($email, $cardId);
$client->visaWalletUnblockCard($email, $cardId);
```

### Administrator Operations

[](#administrator-operations)

```
// Get wallet balance
$balance = $client->getWalletBalance();

// Get all deposits
$deposits = $client->getDeposits();

// Get all transactions
$transactions = $client->getTransactions();

// Get all Visa cards
$visaCards = $client->getAllVisaCards();

// Get all MasterCards
$mastercards = $client->getAllMastercards();

// Get all Digital cards
$digitalCards = $client->getAllDigitalCards();
```

Error Handling
--------------

[](#error-handling)

```
use BSICards\APIException;

try {
    $response = $client->mastercardCreateCard(
        'user@example.com',
        'John Doe',
        '1234'
    );
} catch (APIException $e) {
    // Handle API error
    echo "API Error: " . $e->getMessage();
    echo "Code: " . $e->getCode();
}
```

Response Format
---------------

[](#response-format)

All API responses follow this format:

```
{
    "code": 200,
    "status": "success",
    "message": "Descriptive message",
    "data": {}
}
```

Advanced Configuration
----------------------

[](#advanced-configuration)

### Custom HTTP Settings

[](#custom-http-settings)

```
$client = new BSICardsClient(
    'public_key',
    'secret_key',
    [
        'timeout' => 60,
        'connect_timeout' => 15,
    ]
);
```

### Switching Credentials

[](#switching-credentials)

```
$client->setPublicKey('new_key');
$client->setSecretKey('new_secret');

$publicKey = $client->getPublicKey();
$secretKey = $client->getSecretKey();
```

Base URL
--------

[](#base-url)

The SDK automatically uses the correct base URL:

```
https://cards.bsigroup.tech/api/

```

Best Practices
--------------

[](#best-practices)

1. **Never hardcode credentials** - Always use environment variables
2. **Use try-catch blocks** - Always handle API exceptions
3. **Validate input** - Check email and other data before sending
4. **Log errors** - Keep records of API failures
5. **Implement retry logic** - For network failures
6. **Cache responses** - Where appropriate for performance

Contributing
------------

[](#contributing)

Contributions are welcome! Please see [CONTRIBUTING.md](CONTRIBUTING.md) for guidelines.

License
-------

[](#license)

This SDK is released under the MIT License. See [LICENSE](LICENSE) for details.

Support
-------

[](#support)

For issues, questions, or support:

- Email:
- Website:
- Documentation: See `/docs` directory

Changelog
---------

[](#changelog)

See [CHANGELOG.md](CHANGELOG.md) for version history.

Disclaimer
----------

[](#disclaimer)

This SDK is provided as-is. Always test in a sandbox environment before production use.

###  Health Score

40

—

FairBetter than 87% of packages

Maintenance96

Actively maintained with recent releases

Popularity6

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity43

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

Total

2

Last Release

52d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/0fbd3b4eb83c9f07b6ee4a936753c223f5b87ffbcba727bfbe1c3caf17afa1a8?d=identicon)[nash81](/maintainers/nash81)

---

Top Contributors

[![nash81](https://avatars.githubusercontent.com/u/10265375?v=4)](https://github.com/nash81 "nash81 (17 commits)")

---

Tags

apisdkvisamastercardbsicardscard-issuancedigital-wallet

###  Code Quality

TestsPHPUnit

Static AnalysisPHPStan

Type Coverage Yes

### Embed Badge

![Health badge](/badges/nash81-bsicards-php-sdk/health.svg)

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

###  Alternatives

[openai-php/laravel

OpenAI PHP for Laravel is a supercharged PHP API client that allows you to interact with the Open AI API

3.7k7.6M74](/packages/openai-php-laravel)[saloonphp/saloon

Build beautiful API integrations and SDKs with Saloon

2.4k9.6M467](/packages/saloonphp-saloon)[hubspot/api-client

Hubspot API client

23414.2M16](/packages/hubspot-api-client)[php-opencloud/openstack

PHP SDK for OpenStack APIs. Supports BlockStorage, Compute, Identity, Images, Networking and Metric Gnocchi

2292.2M23](/packages/php-opencloud-openstack)[mailchimp/transactional

458.9M16](/packages/mailchimp-transactional)[resend/resend-php

Resend PHP library.

564.7M21](/packages/resend-resend-php)

PHPackages © 2026

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