PHP code example of pagodigital / php-library

1. Go to this page and download the library: Download pagodigital/php-library 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/ */

    

pagodigital / php-library example snippets


use PagoDigital\PagoDigital;
...

$pagoDigital = new PagoDigital(
    $commerceId = 120,
    $token = "791a736e949d4ec57af5684679bea5d5a9f485c5"
);

use PagoDigital\PagoDigital;
...

$pagoDigital = new PagoDigital(
    $commerceId = 120,
    $token = "791a736e949d4ec57af5684679bea5d5a9f485c5"
);

$paymentResponse = $pagoDigital->payment->paymentWithPlatform(
    $amount = 12500,
    $description = "Pago de prueba con la librería",
    $email = "[email protected]",
    $payerIdentification = "485987",
    $payerName = "Andrés López",
    $phone = "0984856321",
    $platform = "tigo",
    $reference = "pago-22",
    $location = "-27.55486, -2744157"
)


use PagoDigital\PagoDigital;
...

$pagoDigital = new PagoDigital(
    $commerceId = 120,
    $token = "791a736e949d4ec57af5684679bea5d5a9f485c5"
);

$paymentResponse = $pagoDigital->payment->paymentWithLink(
    $amount = 12500,
    $description = "Pago de prueba con la librería",
    $reference = "pago-22",
    $currency = "PYG",
    $subscriptionInterval = "monthly",
)
bash
composer