Skip to content

Commit

Permalink
update README|.gitnore
Browse files Browse the repository at this point in the history
  • Loading branch information
jeremyikwuje committed Dec 8, 2020
1 parent 8bcfce6 commit 56bc422
Show file tree
Hide file tree
Showing 10 changed files with 68 additions and 13 deletions.
3 changes: 2 additions & 1 deletion .gitattributes
Original file line number Diff line number Diff line change
Expand Up @@ -7,5 +7,6 @@
/.travis.yml export-ignore
/phpunit.xml.dist export-ignore
/.scrutinizer.yml export-ignore
/tests export-ignore
/.editorconfig export-ignore
/playground export-ignore
/tests export-ignore
78 changes: 66 additions & 12 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,31 +1,85 @@
# ProcessWith PHP
![paywith repo image](image_name.png "Image Title")
# PayWith PHP

[![](https://img.shields.io/github/release/processwith/processwith-php.svg)](https://github.com/processwith/processwith-php/releases/)
[![](https://img.shields.io/github/license/processwith/processwith-php.svg)](https://github.com/processwith/processwith-php/blob/master/LICENSE)
[![](https://img.shields.io/travis/processwith/processwith-php.svg)](https://travis-ci.com/github/processwith/processwith-php/)
[![](https://img.shields.io/github/release/processwith/paywith-php.svg)](https://github.com/processwith/paywith-php/releases/)
[![](https://img.shields.io/github/license/processwith/paywith-php.svg)](https://github.com/processwith/paywith-php/blob/master/LICENSE)
[![](https://img.shields.io/travis/processwith/paywith-php.svg)](https://travis-ci.com/github/processwith/paywith-php/)

ProcessWith makes it easy to switch payment gateway.
PayWith-PHP makes it easy to use multiple payment gateways in your PHP application.

## Installation

You can install the package via composer:

```bash
composer require processwith/processwith-php
composer require processwith/paywith-php
```

## Usage

### basic transaction
``` php

use ProcessWith\PayWith;

$paywith = new PayWith('Paystack', 'Your Paystack Secret');
$transaction->initialize([
'amount' => 5000,
'customer' => [
'email' => 'jeremiahsucceed@gmail.com',
'name' => 'Ade Kolawole'
],
'redirect_url' => 'http://localhost:3000/tests/verify.php',
'currency' => 'NGN'
]);

$transaction->checkout(); // redirect to checkout page
```
Love more examples, see the example page.

### Testing
### verify a transaction
``` php
// Paywith must have be initialize with Paystack or Flutterwave
$transaction = $paywith->transaction();
$transaction->verify( $_GET['reference'] );

if( $transaction->status() )
{
// check the email and the amount
// before giving value
$amount = 5000;
$email = 'jeremiah@gmail.com';

if ( $amount == $transaction->getAmount() && $email == $transaction->getEmail() )
{
// give value
// echo 'thanks for making payment';
}
}
```

``` bash
composer test
### webhook
``` php
// Paywith must have be initialize with Paystack or Flutterwave
$transaction = $paywith->transaction();
$transaction->webhook();

if( $transaction->status() )
{
// check the email and the amount
// before giving value
$amount = 5000;
$email = 'jeremiah@gmail.com';
if ( $amount == $transaction->getAmount() && $email == $transaction->getEmail() )
{
// give value
// echo 'thanks for making payment';
}
}
```

### Tutorials
We are making some plug and play tutorials. If you like to recieve one when it still HOT, click [here](#).

### Changelog

Please see [CHANGELOG](CHANGELOG.md) for more information what has changed recently.
Expand All @@ -36,11 +90,11 @@ Please see [CONTRIBUTING](CONTRIBUTING.md) for details.

### Security

If you discover any security related issues, please email yes@processwith.com instead of using the issue tracker.
If you discover any security related issues, please email jeremiah@processwith.com instead of using the issue tracker.

## Credits

- [Jeremiah Ikwuje](https://github.com/processwith)
- [Jeremiah Ikwuje](https://github.com/ijsucceed)
- [All Contributors](../../contributors)

## License
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

0 comments on commit 56bc422

Please sign in to comment.