PHPackages                             tpweb/targetpay - 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. tpweb/targetpay

ActiveLibrary

tpweb/targetpay
===============

PHP TargetPay Library

1.5.0(6y ago)25.9k↓100%3LGPLPHPPHP &gt;=5.6CI failing

Since May 8Pushed 6y ago3 watchersCompare

[ Source](https://github.com/TPWeb/targetpay)[ Packagist](https://packagist.org/packages/tpweb/targetpay)[ Docs](http://www.tpweb.org/my-projects/php-targetpay/)[ RSS](/packages/tpweb-targetpay/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (7)Dependencies (1)Versions (15)Used By (0)

PHP TargetPay Library
=====================

[](#php-targetpay-library)

[![Build Status](https://camo.githubusercontent.com/0b7059f2710fd0f3fb243313904c4cf2b29bf1c82a3ff55731287a9ea912ce3b/68747470733a2f2f7472617669732d63692e6f72672f54505765622f7461726765747061792e7376673f6272616e63683d6d6173746572)](https://travis-ci.org/TPWeb/targetpay)[![Coverage Status](https://camo.githubusercontent.com/e546fe0d8848c136314d71ed413d5b7d2ff996962a90ac10294477745eb831a6/68747470733a2f2f636f766572616c6c732e696f2f7265706f732f6769746875622f54505765622f7461726765747061792f62616467652e7376673f6272616e63683d6d6173746572)](https://coveralls.io/github/TPWeb/targetpay?branch=master)[![Latest Stable Version](https://camo.githubusercontent.com/885e37ce70ed0f808898e964258fb315759f4fad29784cbb0daadbf18ebb3914/68747470733a2f2f706f7365722e707567782e6f72672f74707765622f7461726765747061792f762f737461626c652e737667)](https://packagist.org/packages/tpweb/targetpay)[![Latest Unstable Version](https://camo.githubusercontent.com/ae7c1fccaec9dc0a3960a3200f2deea7173317d6ab22bd65291eb172510bb250/68747470733a2f2f706f7365722e707567782e6f72672f74707765622f7461726765747061792f762f756e737461626c652e737667)](https://packagist.org/packages/tpweb/targetpay)[![Total Downloads](https://camo.githubusercontent.com/1bbdadc917e45fae75ffcfca4f7aa036b3a662c265f6a2cdd1ea7342b29e906a/68747470733a2f2f706f7365722e707567782e6f72672f74707765622f7461726765747061792f642f746f74616c2e737667)](https://packagist.org/packages/tpweb/targetpay)[![License](https://camo.githubusercontent.com/7139323d6c853dfe8c02f46f5c6d067301a158447b40c55b9dbcc28f9092fcd7/68747470733a2f2f706f7365722e707567782e6f72672f74707765622f7461726765747061792f6c6963656e73652e737667)](https://packagist.org/packages/tpweb/targetpay)

Installation
============

[](#installation)

Require this package in your `composer.json` and update composer.

```
"tpweb/targetpay": "1.*"
```

After updating composer, add the ServiceProvider to the providers array in `config/app.php`

```
TPWeb\TargetPay\TargetPayServiceProvider::class,
```

You can use the facade for shorter code. Add this to your aliases:

```
'TargetPay' => TPWeb\TargetPay\TargetPayFacade::class,
```

To publish the config settings in Laravel 5 use:

```
php artisan vendor:publish --provider="TPWeb\TargetPay\TargetPayServiceProvider"
```

This will add a `targetpay.php` config file to your config folder. In your .env file you can use:

```
TARGETPAY_LAYOUTCODE=xxxxx
TARGETPAY_KLANTCODE=xxxxx
TARGETPAY_TEST=false
TARGETPAY_DEBUG=true
```

(LAYOUTCODE refers to your 'outlet code' which is unique per webstore/website and KLANTCODE refers to your API key which is unique per TP account.)

Documentation
=============

[](#documentation)

IVR 090X- (Pay Per Call &amp; Pay Per Minute)
---------------------------------------------

[](#ivr-090x--pay-per-call--pay-per-minute)

### Get payment info

[](#get-payment-info)

```
$targetPay = new TargetPay(new \TPWeb\TargetPay\Transaction\IVR);
//$targetPay->transaction->setCountry(32);
$targetPay->transaction->setCountry(\TPWeb\TargetPay\Transaction\IVR::BELGIUM);
$targetPay->setAmount(3.00);
$targetPay->getPaymentInfo(); //Fetch payment info

echo $targetPay->transaction->getCurrency(); //Currency: EURO, GBP, ...
echo $targetPay->getAmount(); //Real payed amount.: 3.00
echo $targetPay->transaction->getServiceNumber(); //Number to call
echo $targetPay->transaction->getPayCode(); //Code to enter during call
echo $targetPay->transaction->getMode(); //Call type: PC or PM
echo ($targetPay->transaction->getMode() == "PM" ? $targetPay->transaction->getDuration() . "s" : ""); //duration in seconds
```

### Check payment

[](#check-payment)

(This will only give you a one-time successful callback!)

```
$targetPay = new TargetPay(new \TPWeb\TargetPay\Transaction\IVR);
$targetPay->transaction->setCountry($request->get('country'));
$targetPay->setAmount($request->get('amount'));
$targetPay->transaction->setServiceNumber($request->get('servicenumber'));
$targetPay->transaction->setPayCode($request->get('paycode'));
$targetPay->checkPaymentInfo();
if($targetPay->transaction->getPaymentDone()) {
    //Payment done
    echo $targetPay->getAmount(); //Real payed amount
    echo targetPay->transaction->getPayout(); //amount you 'll receive.
} else {
    //payment not completed
}
```

IDEAL
-----

[](#ideal)

### Get payment info &amp; url

[](#get-payment-info--url)

Save $transactionId, redirect user to $redirectUrl.

```
$targetPay = new TargetPay(new \TPWeb\TargetPay\Transaction\IDeal);
$targetPay->transaction->setBank(IDeal::ING);
$targetPay->setAmount(10.00);
$targetPay->transaction->setDescription("Description");
$targetPay->transaction->setReturnUrl("https://www.example.com");
$targetPay->getPaymentInfo();
$redirectUrl = $targetPay->transaction->getIdealUrl();
$transactionId = $targetPay->transaction->getTransactionId();
```

### Check payment

[](#check-payment-1)

```
$targetPay = new TargetPay(new \TPWeb\TargetPay\Transaction\IDeal);
$targetPay->transaction->setTransactionId($transactionId);
$targetPay->checkPaymentInfo();
$once = false;
$targetPay->transaction->getPaymentDone($once);
```

Mister Cash
-----------

[](#mister-cash)

### Get payment info &amp; url

[](#get-payment-info--url-1)

Save $transactionId, redirect user to $redirectUrl.

```
$targetPay = new TargetPay(new \TPWeb\TargetPay\Transaction\MisterCash);
$targetPay->transaction->setLang("NL");
$targetPay->setAmount(10.00);
$targetPay->transaction->setDescription("Description");
$targetPay->transaction->setReturnUrl("https://www.example.com");
$targetPay->getPaymentInfo();
$redirectUrl = $targetPay->transaction->getMisterCashUrl();
$transactionId = $targetPay->transaction->getTransactionId();
```

### Check payment

[](#check-payment-2)

```
$targetPay = new TargetPay(new \TPWeb\TargetPay\Transaction\MisterCash);
$targetPay->transaction->setTransactionId($transactionId);
$targetPay->checkPaymentInfo();
$once = false;
$targetPay->transaction->getPaymentDone($once);
```

Paysafecard
-----------

[](#paysafecard)

### Get payment info &amp; url

[](#get-payment-info--url-2)

Save $transactionId, redirect user to $redirectUrl.

```
$targetPay = new TargetPay(new \TPWeb\TargetPay\Transaction\Paysafecard);
$targetPay->setAmount(10.00);
$targetPay->transaction->setDescription("Description");
$targetPay->transaction->setReturnUrl("https://www.example.com");
$targetPay->getPaymentInfo();
$redirectUrl = $targetPay->transaction->getPaysafecardUrl();
$transactionId = $targetPay->transaction->getTransactionId();
//redirect to $redirectUrl
```

### Check payment

[](#check-payment-3)

```
$targetPay = new TargetPay(new \TPWeb\TargetPay\Transaction\Paysafecard);
$targetPay->transaction->setTransactionId($transactionId);
$targetPay->checkPaymentInfo();
$once = false;
$targetPay->transaction->getPaymentDone($once);
```

Premium SMS
-----------

[](#premium-sms)

### Get payment info &amp; url

[](#get-payment-info--url-3)

Save $transactionId, redirect user to $redirectUrl.

```
$targetPay = new TargetPay(new \TPWeb\TargetPay\Transaction\SMS);
$targetPay->transaction->setCountry(SMS::BELGIUM);
$targetPay->setAmount(1.00);
$shortcode = $targetPay->transaction->getShortcode();
$keyword = $targetPay->transaction->getKeyword();
//User send keyword to shortcode, user get answer with code
```

### Check payment

[](#check-payment-4)

```
$targetPay = new TargetPay(new \TPWeb\TargetPay\Transaction\SMS);
$targetPay->transaction->setCountry(SMS::BELGIUM);
$targetPay->setAmount(1.00);
$targetPay->transaction->setPayCode($code);
$targetPay->checkPaymentInfo();
$targetPay->transaction->getPaymentDone();
```

The complete documentation can be found at:

Support
=======

[](#support)

Support github or mail:

Contributing
============

[](#contributing)

Please try to follow the psr-2 coding style guide.

License
=======

[](#license)

This package is licensed under LGPL. You are free to use it in personal and commercial projects. The code can be forked and modified, but the original copyright author should always be included!

###  Health Score

34

—

LowBetter than 77% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity24

Limited adoption so far

Community14

Small or concentrated contributor base

Maturity66

Established project with proven stability

 Bus Factor1

Top contributor holds 60.6% 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 ~138 days

Recently: every ~248 days

Total

10

Last Release

2408d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/836a5bdb48e67021dd11b14934c9c13e03b6072fefd5b033d6bdce157103306c?d=identicon)[tpweb](/maintainers/tpweb)

---

Top Contributors

[![madeITBelgium](https://avatars.githubusercontent.com/u/20304892?v=4)](https://github.com/madeITBelgium "madeITBelgium (20 commits)")[![TPWeb](https://avatars.githubusercontent.com/u/6589788?v=4)](https://github.com/TPWeb "TPWeb (10 commits)")[![ChrisBPB](https://avatars.githubusercontent.com/u/7156240?v=4)](https://github.com/ChrisBPB "ChrisBPB (3 commits)")

---

Tags

paymentsidealpaysafecardivrtargetpayMister cash

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/tpweb-targetpay/health.svg)

```
[![Health](https://phpackages.com/badges/tpweb-targetpay/health.svg)](https://phpackages.com/packages/tpweb-targetpay)
```

###  Alternatives

[mollie/mollie-api-php

Mollie API client library for PHP. Mollie is a European Payment Service provider and offers international payment methods such as Mastercard, VISA, American Express and PayPal, and local payment methods such as iDEAL, Bancontact, SOFORT Banking, SEPA direct debit, Belfius Direct Net, KBC Payment Button and various gift cards such as Podiumcadeaukaart and fashioncheque.

59914.4M61](/packages/mollie-mollie-api-php)[mollie/laravel-mollie

Mollie API client wrapper for Laravel &amp; Mollie Connect provider for Laravel Socialite

3624.1M28](/packages/mollie-laravel-mollie)[mollie/magento2

Mollie Payment Module for Magento 2

1121.6M10](/packages/mollie-magento2)[mollie/oauth2-mollie-php

Mollie Provider for OAuth 2.0 Client

251.7M1](/packages/mollie-oauth2-mollie-php)[mollie/magento

iDEAL, Creditcard, Bancontact/Mister Cash, SOFORT, Bank transfer, Bitcoin, PayPal &amp; paysafecard for Magento https://www.mollie.com/

397.9k](/packages/mollie-magento)[enupal/stripe

Allows customers sign up for recurring and one-time payments with Stripe, perfect for orders, donations, subscriptions, and events. Create simple payment forms in seconds easily without coding. For Craft CMS 3.x

3416.5k1](/packages/enupal-stripe)

PHPackages © 2026

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