Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/dmouse/compropago-api
API para ComproPago
https://github.com/dmouse/compropago-api
Last synced: 1 day ago
JSON representation
API para ComproPago
- Host: GitHub
- URL: https://github.com/dmouse/compropago-api
- Owner: dmouse
- Created: 2014-03-05T01:35:55.000Z (almost 11 years ago)
- Default Branch: master
- Last Pushed: 2014-06-23T19:05:45.000Z (over 10 years ago)
- Last Synced: 2024-11-11T06:34:40.940Z (about 1 month ago)
- Language: PHP
- Homepage: https://www.compropago.com
- Size: 285 KB
- Stars: 1
- Watchers: 2
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
ComproPago API
==============
[![Latest Stable Version](https://poser.pugx.org/hechoendrupal/compropago-api/v/stable.svg)](https://packagist.org/packages/hechoendrupal/compropago-api) [![Total Downloads](https://poser.pugx.org/hechoendrupal/compropago-api/downloads.svg)](https://packagist.org/packages/hechoendrupal/compropago-api) [![Latest Unstable Version](https://poser.pugx.org/hechoendrupal/compropago-api/v/unstable.svg)](https://packagist.org/packages/hechoendrupal/compropago-api) [![License](https://poser.pugx.org/hechoendrupal/compropago-api/license.svg)](https://packagist.org/packages/hechoendrupal/compropago-api)### Instalation
* Via composer
```bash
$ curl -sS https://getcomposer.org/installer | php
$ cat composer.json
{
"require": {
"hechoendrupal/compropago-api": "~1.0"
}
}
$ ./composer.phar install
```
### Usage```php
use HechoEnDrupal\ComproPago\Api;
use HechoEnDrupal\ComproPago\Charge;
use HechoEnDrupal\ComproPago\Customer;require __DIR__ . 'vendor/autoload.php';
// ...
$api = new Api($api_key);
$product = $api->createCharge($charge);
$status = $api->getCharge($product['payment_id']);
$sms = $api->createSMS($customer,$product['payment_id']);
```#### Webhooks
```php
use HechoEnDrupal\ComproPago\Webhook;$webhook = new WebHook();
// Charge data
print $webhook->getAmount()."\n";
print $webhook->getCreated($format=null)."\n";
print $webhook->getID()."\n";
print $webhook->getShortID()."\n";
if ($webhook->paid()) {
print "Paid\n";
}// Payment Details
$payment = $webhook->getPaymentDetails();
print "Payment Details"."\n";
print $payment->getStore()."\n";
print $payment->getProductID()."\n";
print $payment->getCustomerPhone()."\n";
print $payment->getCustomerEmail()."\n";
print $payment->getCountry()."\n";
```More information in [examples section](https://github.com/dmouse/compropago-api/tree/master/samples)