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

https://github.com/zerosdev/linkqu-php

Unofficial Integration Kit for LinkQu.id
https://github.com/zerosdev/linkqu-php

Last synced: 6 months ago
JSON representation

Unofficial Integration Kit for LinkQu.id

Awesome Lists containing this project

README

          

# linkqu-php

Unofficial Integration Kit for LinkQu.id

## Requirements

- PHP v7.0.0+
- PHP JSON Extension
- [Guzzle, PHP HTTP Client](https://github.com/guzzle/guzzle) v6.5+

## Installation

1. Run command

composer require zerosdev/linkqu-php

2. Run command

composer dump-autoload

### The following steps only needed if you are using Laravel

3. Then

php artisan vendor:publish --provider="ZerosDev\LinkQu\Laravel\ServiceProvider"

4. Edit **config/linkqu.php** and put your API credentials

## Basic Usage

### Laravel Usage

```php
createVa(function($va) {
$va->setAmount(10000)
->setExpired(60)
->setCustomerId(uniqid())
->setPartnerRef(time())
->setCustomerName('Nama Pelanggan')
->setCustomerPhone('08123456789')
->setCustomerEmail('email@customer.com')
->setBankCode('014');
});

if( LinkQu::hasError() ) {
print_r(LinkQu::errors());
} else {
print_r($result);
}
}
}
```

### Non-Laravel Usage

```php
setMode(Constant::DEVELOPMENT)
->setClientId('testing')
->setClientSecret('123')
->setServerKey('LinkQu@2020')
->setUsername('LI307GXIN')
->setPin('2K2NPCBBNNTovgB');
});

$result = $linkqu->transaction()->createVa(function($va) {
$va->setAmount(10000)
->setExpired(60)
->setCustomerId(uniqid())
->setPartnerRef(time())
->setCustomerName('Nama Pelanggan')
->setCustomerPhone('08123456789')
->setCustomerEmail('email@customer.com')
->setBankCode('014');
});

if( $linkqu->hasError() ) {
print_r($linkqu->errors());
} else {
print_r($result);
}
```