PHPackages                             icarddirect/ipg-sdk-php - 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. icarddirect/ipg-sdk-php

ActiveLibrary[Payment Processing](/categories/payments)

icarddirect/ipg-sdk-php
=======================

IPG SDK PHP

1.0.5(8mo ago)0908[1 issues](https://github.com/iCardDirect/IPG-WEB-SDK-PHP/issues)[1 PRs](https://github.com/iCardDirect/IPG-WEB-SDK-PHP/pulls)MITPHPPHP &gt;=7.3CI passing

Since Aug 1Pushed 3mo agoCompare

[ Source](https://github.com/iCardDirect/IPG-WEB-SDK-PHP)[ Packagist](https://packagist.org/packages/icarddirect/ipg-sdk-php)[ RSS](/packages/icarddirect-ipg-sdk-php/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (6)Dependencies (2)Versions (8)Used By (0)

IPG SDK PHP
===========

[](#ipg-sdk-php)

Installing
----------

[](#installing)

```
composer require icarddirect/ipg-sdk-php

```

Example of purchase
-------------------

[](#example-of-purchase)

### Require library:

[](#require-library)

```
require __DIR__ . '/vendor/autoload.php';
```

### Set up configuration data:

[](#set-up-configuration-data)

```
$privKey = setLanguage( 'en' );
$config->setMerchantId( 33 ); //Originator
$config->setMerchantName( 'IPG Example' );
$config->setVersion( '4.5' );
$config->setVirtualTerminalId( '112' ); //MID
$config->setAPIPublicKey( $pubKey );
$config->setPrivateKey( $privKey );
```

Keys can be set by path, using path methods.

### Build Cart Object /removed from version 4.5/

[](#build-cart-object-removed-from-version-45)

```
$cart = new \IPG\Cart();
$cart->add( 'Item', 1, 1.20 );
$cart->add( 'Another Item', 2, 2.00 );
$cart->add( 'Third item', 3, 3.00 );
```

### Build Customer Object

[](#build-customer-object)

```
$customer = new \IPG\Customer();
$customer->setEmail( 'customer@email.com' );
$customer->setIdentifier('Customer_Identifier');
$customer->setMobileNumber('+359888123456');
$customer->setIP( '127.0.0.1' );
```

### Build Billing address Object

[](#build-billing-address-object)

```
$billingAddress = new \IPG\BillingAddress();
$billingAddress->setBillAddrCountry( 100 );
$billingAddress->setBillAddrState('State if applicable');
$billingAddress->setBillAddrPostCode('PostCode');
$billingAddress->setBillAddrCity( 'City' );
$billingAddress->setBillAddrLine1( 'Line1' );
$billingAddress->setBillAddrLine2( 'Line2' );
$billingAddress->setBillAddrLine3( 'Line3' );
```

### Process Purchase

[](#process-purchase)

```
$purchase = new IPG\Purchase( $config );
$purchase->setBannerIndex(8);
$purchase->setCart( $cart ); //required for a version setCurrency( '978' );
$purchase->setAmount( 10.50 ); //required for a version >= 4.5
$purchase->setCustomer( $customer );
$purchase->setBillingAddress( $billingAddress );
$purchase->setOrderId( time() );
$purchase->setUrlOK( 'http://yoursite.com//urlOK' );
$purchase->setUrlNotify( 'http://yoursite.com//urlNotify' );
$purchase->setUrlCancel( 'http://yoursite.com//urlCancel' );
try {
	$purchase->process();
} catch ( \IPG\IPG_Exception $exc ) {
	echo $exc->getMessage();
}
```

### Process 3DSPurchaseWithStoredCard

[](#process-3dspurchasewithstoredcard)

```
$purchase = new IPG\ThreeDSPurchaseWithStoredCard( $config );
$purchase->setBannerIndex(8);
$purchase->setCurrency( 978 );
$purchase->setAmount( 10.50 );
$purchase->setCustomer( $customer );
$purchase->setBillingAddress( $billingAddress );
$purchase->setOrderId( time() );
$purchase->setUrlOK( 'http://yoursite.com//urlOK' );
$purchase->setUrlNotify( 'http://yoursite.com//urlNotify' );
$purchase->setUrlCancel( 'http://yoursite.com//urlCancel' );
$purchase->setCardToken('40B1B011C4A21E ... 36E452619059');
$purchase->setIsVerifyCVC(true);
try {
	$purchase->process();
} catch ( \IPG\IPG_Exception $exc ) {
	echo $exc->getMessage();
}
```

### Process PaymentToken

[](#process-paymenttoken)

```
$paymentToken = new IPG\PaymentToken( $purchase );
$paymentToken->setOutputFormat(\IPG\Defines::OUTPUT_FORMAT_JSON);
try {
	$paymentToken->process();
} catch ( \IPG\IPG_Exception $exc ) {
	echo $exc->getMessage();
}
```

### Process EmbeddedPayment

[](#process-embeddedpayment)

```
$embeddedPayment = new IPG\EmbeddedPayment( $purchase );
$embeddedPayment->setTheme('ThemeName');
$embeddedPayment->setOutputFormat(\IPG\Defines::OUTPUT_FORMAT_JSON);
try {
	$embeddedPayment->process();
} catch ( \IPG\IPG_Exception $exc ) {
	echo $exc->getMessage();
}
```

### Process Reversal

[](#process-reversal)

```
$reversal = new IPG\Reversal( $config );
$reversal->setOrderId( time() )
$reversal->setTrnRef('20250925084241282100');
$reversal->setOutputFormat(\IPG\Defines::OUTPUT_FORMAT_JSON);
try {
	$response = $reversal->process();
} catch ( \IPG\IPG_Exception $exc ) {
	echo $exc->getMessage();
}
```

### Process Refund

[](#process-refund)

```
$refund = new IPG\Refund( $config );
$refund->setCustomer( $customer );
$refund->setOrderId( time() );
$refund->setAmount(1.00);
$refund->setCurrency(978);
$refund->setTrnRef('20250925084241282100');
$refund->setOutputFormat(\IPG\Defines::OUTPUT_FORMAT_JSON);
try {
	$response = $refund->process();
} catch ( \IPG\IPG_Exception $exc ) {
	echo $exc->getMessage();
}
```

### Process GetTxnStatus

[](#process-gettxnstatus)

```
$txnStatus = new IPG\TxnStatus( $config );
$txnStatus->setOrderId('OrderID of previous transaction');
$txnStatus->setOutputFormat(\IPG\Defines::OUTPUT_FORMAT_JSON);
try {
	$response = $txnStatus->process();
} catch ( \IPG\IPG_Exception $exc ) {
	echo $exc->getMessage();
}
```

###  Health Score

43

—

FairBetter than 91% of packages

Maintenance71

Regular maintenance activity

Popularity17

Limited adoption so far

Community8

Small or concentrated contributor base

Maturity62

Established project with proven stability

 Bus Factor1

Top contributor holds 91.7% 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 ~518 days

Recently: every ~499 days

Total

6

Last Release

257d ago

PHP version history (2 changes)1.0.0PHP &gt;=5.4.8

1.0.3PHP &gt;=7.3

### Community

Maintainers

![](https://www.gravatar.com/avatar/3b0ba5116bbd6d5dcc4eefa37320cdf325cad02e68c75b0b71e0bcd525a464b9?d=identicon)[iCardDirect](/maintainers/iCardDirect)

---

Top Contributors

[![slavizdravkov](https://avatars.githubusercontent.com/u/22374572?v=4)](https://github.com/slavizdravkov "slavizdravkov (11 commits)")[![iCardDirect](https://avatars.githubusercontent.com/u/39292286?v=4)](https://github.com/iCardDirect "iCardDirect (1 commits)")

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/icarddirect-ipg-sdk-php/health.svg)

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

###  Alternatives

[chargebee/chargebee-php

ChargeBee API client implementation for PHP

768.0M9](/packages/chargebee-chargebee-php)[imdhemy/google-play-billing

Google Play Billing

491.3M5](/packages/imdhemy-google-play-billing)[bitpay/sdk

Complete version of the PHP library for the new cryptographically secure BitPay API

42337.5k4](/packages/bitpay-sdk)[buckaroo/sdk

Buckaroo payment SDK

12189.1k9](/packages/buckaroo-sdk)[contica/facturador-electronico-cr

Un facturador de código libre para integrar facturación electrónica en Costa Rica a un proyecto PHP

2128.8k](/packages/contica-facturador-electronico-cr)[karson/mpesa-php-sdk

172.2k](/packages/karson-mpesa-php-sdk)

PHPackages © 2026

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