https://github.com/utopia-php/pay
Lite & fast micro PHP payments abstraction library that is **easy to use**.
https://github.com/utopia-php/pay
hacktoberfest php utopia
Last synced: about 2 months ago
JSON representation
Lite & fast micro PHP payments abstraction library that is **easy to use**.
- Host: GitHub
- URL: https://github.com/utopia-php/pay
- Owner: utopia-php
- License: mit
- Created: 2022-04-12T06:22:20.000Z (about 3 years ago)
- Default Branch: main
- Last Pushed: 2025-02-17T08:06:09.000Z (4 months ago)
- Last Synced: 2025-04-11T16:13:25.790Z (about 2 months ago)
- Topics: hacktoberfest, php, utopia
- Language: PHP
- Homepage:
- Size: 143 KB
- Stars: 8
- Watchers: 6
- Forks: 2
- Open Issues: 3
-
Metadata Files:
- Readme: README.md
- Contributing: CONTRIBUTING.md
- License: LICENSE
- Code of conduct: CODE_OF_CONDUCT.md
Awesome Lists containing this project
README
# Utopia Pay
[](https://travis-ci.com/utopia-php/pay)

[](https://appwrite.io/discord)Utopia Pay library is simple and lite library for accepting payments. This library is aiming to be as simple and easy to learn and use. This library is maintained by the [Appwrite team](https://appwrite.io).
Although this library is part of the [Utopia Framework](https://github.com/utopia-php/framework), it is dependency free and can be used as standalone with any other PHP project or framework.
## Getting Started
Install using composer:
```bash
composer require utopia-php/pay
```Get Secret Key and Publishable Key from your Stripe Account.
```php
require_once '../vendor/autoload.php';
use Utopia\Pay\Pay;
use Utopia\Pay\Adapter\Stripe;$pay = new Pay(new Stripe('PUBLISHABLE_KEY', 'SECRET_KEY'));
$customer = $pay->createCustomer('Customer One', '[email protected]');
\var_dump($customer);$pay->setCurrency('INR');
$purchase = $pay->purchase(
5000, // price
$customer['id'], // customer ID
null, // card ID
[
'description' => 'some countries require descriptions'
]
);var_dump($purchase);
```## System Requirements
Utopia Pay requires PHP 8.0 or later. We recommend using the latest PHP version whenever possible.
## Contributing
All code contributions - including those of people having commit access - must go through a pull request and approved by a core developer before being merged. This is to ensure proper review of all the code.
Fork the project, create a feature branch, and send us a pull request.
You can refer to the [Contributing Guide](CONTRIBUTING.md) for more info.
### Testing
```
vendor/bin/phpunit --configuration phpunit.xml
```## Copyright and license
The MIT License (MIT) [http://www.opensource.org/licenses/mit-license.php](http://www.opensource.org/licenses/mit-license.php)