diablomedia/gpcsv-generator

Library to assist with the generation of CashPro Global Payments GPCSV files


README

Build codecov Latest Stable Version Total Downloads Psalm Type coverage Psalm level

Library to assist with the generation of CashPro Global Payments GPCSV files

Usage

CLI

composer require diablomedia/gpcsv

Code

<?php
$payment = new GPCSV\Payment();
$payment->setDestinationCountry($country);
// Set other values...

$csv = new GPCSV\File();
$csv->addPayment($payment);
// Add other payments...

echo $csv->getCsvString();

Options

By default, the Payment class will automatically strip unsupported characters from values that are sent to it. If you would prefer it to throw an error instead, you can disable the autoClean option:

<?php
$payment = new Payment(['autoClean' => false]);

// or:

$payment = new Payment();
$payment->setOptionAutomaticallyCleanFields(false);