Skip to content

Commit

Permalink
Fixing Initialization Params
Browse files Browse the repository at this point in the history
  • Loading branch information
frankyso committed Nov 25, 2019
1 parent c4389fe commit 86dcf20
Show file tree
Hide file tree
Showing 2 changed files with 44 additions and 2 deletions.
40 changes: 39 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,41 @@ composer require frankyso/ipaymu
```

## Usage

### Initialization
```php
<?php
use frankyso\iPaymu\iPaymu;

$iPaymu = new iPaymu('your-api-key', ['ureturn','unotify','ucancel']);
```
### Set UReturn URL
```php
<?php
use frankyso\iPaymu\iPaymu;

$iPaymu = new iPaymu('your-api-key');
$iPaymu->setUreturn('https://your-website');
```

### Set Unotify URL
```php
<?php
use frankyso\iPaymu\iPaymu;

$iPaymu = new iPaymu('your-api-key');
$iPaymu->setUnotify('https://your-website');
```

### Set UCancel URL
```php
<?php
use frankyso\iPaymu\iPaymu;

$iPaymu = new iPaymu('your-api-key');
$iPaymu->setUcancel('https://your-website');
```

### Check Balance
```php
<?php
Expand Down Expand Up @@ -67,8 +102,11 @@ $cart = $iPaymu->cart()->add("id","product-name", 'product-quantity','product-pr
$cart->checkout();
```

### Check Transaction Status - @deprecated
### ~~Check Transaction Status - @deprecated~~
To checking your account transaction status (deposit, transfer, send money).

to be honest, this endpoint still working, but somehow i cannot find `transaction-id` from any other endpoint.

```php
<?php
use frankyso\iPaymu\iPaymu;
Expand Down
6 changes: 5 additions & 1 deletion src/iPaymu.php
Original file line number Diff line number Diff line change
Expand Up @@ -43,12 +43,16 @@ class iPaymu
/**
* iPaymu constructor.
* @param null $apiKey
* @param array $url
* @throws ApiKeyNotFound
*/
public function __construct($apiKey = null)
public function __construct($apiKey = null, $url = ["", "", ""])
{
$this->setApiKey($apiKey);
$this->cart = new Cart($this);
$this->setUcancel($url[0]);
$this->setUreturn($url[1]);
$this->setUnotify($url[2]);
}

/**
Expand Down

0 comments on commit 86dcf20

Please sign in to comment.