Skip to content

Commit

Permalink
Update README.md
Browse files Browse the repository at this point in the history
  • Loading branch information
sdrenth authored Mar 23, 2021
1 parent 87af8be commit 04cd7cb
Showing 1 changed file with 56 additions and 1 deletion.
57 changes: 56 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,2 +1,57 @@
# SprayPay
SprayPay API client for PHP
SprayPay API client for PHP.

## Getting started
For usage and allowed parameters please view the official SprayPay API documentation.

**Initialize client**
```
$client = new SprayPayApiClient();
$client->setApiKey('YOUR_API_KEY);
$client->setWebshopId('YOUR_WEBSHOP_ID');
$client->setTestMode();
```

**Run preflight request**
```
$response = $client->loanrequestpreflight->preflight([
'emailAddress' => 'some_email',
'webshopOrderAmount' => '10.00',
'webshopOrderId' => 1,
'webshopCustomerId' => 1,
'returnUrl' => ''
]);
```

**Payment/Loan request**

```
$loanrequest->create($data, true, true);
```

**Get order status**
```
$this->client->orderstatus->get(1);
```

**Create a chargeback request**
```
$client->chargebackrequest->create([
'date' => '2020-02-02',
'amount' => '10.00',
'chargebackNotificationUrl' => '',
'orderId' => 1,
'reason' => 'Some reason'
]);
```

**Get chargeback request status**
```
$response = $client->chargebackrequest->getStatus(['reference' => 'SOME_REFERENCE']);
```

**Payment resource example**
```
$payment = new Payment(client->loanrequest->create($data, true, true));
$payment->isPaid();
```

0 comments on commit 04cd7cb

Please sign in to comment.