An open API service indexing awesome lists of open source software.

https://github.com/athlan/yetipay

PHP library for yetipay.pl
https://github.com/athlan/yetipay

payment payment-button payment-integration yetipay

Last synced: 10 months ago
JSON representation

PHP library for yetipay.pl

Awesome Lists containing this project

README

          

Yetipay PHP Client library
===

This library allows to easy integration with [yetipay](https://www.yetipay.pl/) payments.

## Features

* Generated payment button
* Handles pingback (`URL_STATUS`)
* Verifies payments

## Installation

### Composer

Add dependency in `composer.json` file:

```
{
"require": {
"athlan/yetipay": "1.*"
}
}
```

## Examples

### Handle pingback (`URL_STATUS`)

```php
validateHash($params['hash'], $params)) {
// activate product here

die('ACK'); // yetipay expects "ACK" string in response to confirm transaction
}

die('FAILED');

```

### Generate payment button

```php
setUserId('userid_here');
$button->setProductId('productid_here');
$button->setReturnUrl('http://localhost/validate-transaction.php?transactionId=%transactionId%');

$buttonGenerator = new Yetipay\PaymentButtonCodeGenerator($yetipay);

?>


getButtonCode($button) ?>

```

### Validate payment

```php
validateTransaction($transactionId);

if($data['status'] == 200) {
// activte product here
}

```