Files
FOSSBilling/tests-legacy/includes/Payment/Adapter/Dummy.php
T
renovate[bot]andBelle Aerni cd60dba2d8 chore(deps): update dependency league/csv to v9.27.0 (#2977)
* chore(deps): update dependency league/csv to v9.27.0

* Fixed the tests, also ran the cs fix script

---------

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: Belle Aerni <belleaerni@gmail.com>
2025-10-17 01:24:37 -07:00

50 lines
1.1 KiB
PHP

<?php
class Payment_Adapter_Dummy
{
protected ?Pimple\Container $di = null;
public function setDi(Pimple\Container $di): void
{
$this->di = $di;
}
public function getConfig(): array
{
return [];
}
public function getType()
{
return self::TYPE_FORM;
}
public function getServiceUrl(): string
{
return 'https://www.google.com/?q=dummy';
}
public function singlePayment(Payment_Invoice $invoice): array
{
return [];
}
public function recurrentPayment(Payment_Invoice $invoice): array
{
return [];
}
public function ipn($data, Payment_Invoice $invoice): Payment_Transaction
{
$tx = new Payment_Transaction();
$tx->setAmount($invoice->getTotal());
$tx->setCurrency($invoice->getCurrency());
$tx->setId(md5(uniqid((string) $invoice->getNumber())));
$tx->setIsValid(true);
$tx->setStatus(Payment_Transaction::STATUS_COMPLETE);
$tx->setType(Payment_Transaction::TXTYPE_PAYMENT);
return $tx;
}
}