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

ActiveLibrary[Payment Processing](/categories/payments)

yellowmelon/targetpay
=====================

TargetPay PHP SDK

024PHP

Since Oct 26Pushed 11y ago1 watchersCompare

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

READMEChangelogDependenciesVersions (1)Used By (0)

Targetpay SDK
=============

[](#targetpay-sdk)

With this (namespaced) SDK you can easily make the calls to TargetPay for all the payment methods that are provided.

Required: PHP 5.3+

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

[](#installation)

- Copy the files in /lib to your webserver.

Usage
=====

[](#usage)

First register the autoloader. If your framework already has an autoloader you might not need to use this. Use the proper route to the autoload file

```
require_once __DIR__.'/../lib/TargetPay/autoload.php';
```

Include the TargetPay namespace:

```
use \TargetPay as TargetPay;
```

Now start the payment by calling:

```
$startPaymentResult = TargetPay\Transaction::model("Ideal")
    ->rtlo(121455)
    ->amount(1000)
    ->description('Test payment')
    ->returnUrl('http://www.test.nl/success')
    ->cancelUrl('http://www.test.nl/canceled')
    ->reportUrl('http://www.test.nl/report')
    ->bank('0021')
    ->start();
```

You can check the result. `$startPaymentResult->status` will be true in case of success. If not `startPaymentResult->status` will have the error message.

If all is OK, redirect to the bank:

```
Header ("Location: ".$startPaymentResult->url);
```

After payment the reportUrl will be called by TargetPay, passing amongst others the transaction ID . See the TargetPay documentation for more information.

The script behind this report URL has to check the validity of the report, thus checking the actual payment.

This is done by calling (after including the autoloader and use statement):

```
		$checkPaymentResult = TargetPay\Transaction::model($method)
		 	->rtlo(121455)
		 	->txid($startPaymentResult->txid)
		 	->test(false)
		 	->check();
```

Check the results in `$checkPaymentResult` for more information about the payment. Most important: `$checkPaymentResult = true` indicates a succesful payment. Save the result of the payment in your database.

When the customer paid, he will be redirected to the Return URL. If not, he is redirected to the Cancel URL.

Payment methods
===============

[](#payment-methods)

Currently the following payment methods are implemented. See their classes (in parentheses) under /lib/TargetPay/Methods for their specifics like minimum/maximum amounts and specific properties:

- iDEAL (Methods\_Ideal)
- Bancontact/Mister Cash (Methods\_MisterCash)
- Sofort Banking, former DirectEbanking (Methods\_Sofort)
- Paysafecard, former Wallie (Methods\_Paysafecard)
- Visa/Mastercard (Methods\_Creditcard)

Notes
=====

[](#notes)

- The initial call described above is slightly simplified. For iDEAL you first need to ask the customer to select his bank and pass it with bank(). For Sofort you specify country(), the options are listed in the documentation. Other payment methods do not need these parameters.
- Do not forget to enter your own layoutcode. 121455 is just a testcode.

###  Health Score

20

—

LowBetter than 14% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity6

Limited adoption so far

Community4

Small or concentrated contributor base

Maturity41

Maturing project, gaining track record

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.

### Community

Maintainers

![](https://www.gravatar.com/avatar/6771aeddaca5370b76b2be0f01337c196587f0883448b49de3a0cdc525d9f802?d=identicon)[yellowmelon](/maintainers/yellowmelon)

### Embed Badge

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

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

###  Alternatives

[omnipay/paypal

PayPal gateway for Omnipay payment processing library

3156.8M53](/packages/omnipay-paypal)[eduardokum/laravel-boleto

Biblioteca com boletos para o laravel

626351.9k2](/packages/eduardokum-laravel-boleto)[tbbc/money-bundle

This is a Symfony bundle that integrates moneyphp/money library (Fowler pattern): https://github.com/moneyphp/money.

1961.9M](/packages/tbbc-money-bundle)[2checkout/2checkout-php

2Checkout PHP Library

83740.3k2](/packages/2checkout-2checkout-php)[smhg/sepa-qr-data

Generate QR code data for SEPA payments

61717.2k5](/packages/smhg-sepa-qr-data)[omnipay/dummy

Dummy driver for the Omnipay payment processing library

271.2M33](/packages/omnipay-dummy)

PHPackages © 2026

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