PHP code example of hechoendrupal / compropago-api
1. Go to this page and download the library: Download hechoendrupal/compropago-api library. Choose the download type require. 2. Extract the ZIP file and open the index.php. 3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
hechoendrupal / compropago-api example snippets
use HechoEnDrupal\ComproPago\Api;
use HechoEnDrupal\ComproPago\Charge;
use HechoEnDrupal\ComproPago\Customer;
'payment_id']);
$sms = $api->createSMS($customer,$product['payment_id']);
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";