Files
FOSSBilling/tests/includes/Payment/Adapter/Dummy.php
T
Belle Aerni 50043e6211 Run Rector against our tests (#1761)
* Update rector config to include tests

* Run Rector against the tests

* Delete test-results

* Update .gitignore

* Correctly set the PHP min to 8.1, split the configs

* Corrected PHPDoc

* Deleted tests we can't really get to pass

PHPunit is hard-coded to fail when a class has a return type of `never`, which is the correct return type of our redirect function (and rightfully so).

No way to disable the exception as far as we can tell
2023-11-11 18:41:09 +00:00

47 lines
1.0 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()
{
return array();
}
public function getType()
{
return self::TYPE_FORM;
}
public function getServiceUrl()
{
return 'https://www.google.com/?q=dummy';
}
public function singlePayment(Payment_Invoice $invoice)
{
return array();
}
public function recurrentPayment(Payment_Invoice $invoice)
{
return array();
}
public function ipn($data, Payment_Invoice $invoice)
{
$tx = new Payment_Transaction();
$tx->setAmount($invoice->getTotal());
$tx->setCurrency($invoice->getCurrency());
$tx->setId(md5(uniqid($invoice->getNumber())));
$tx->setIsValid(true);
$tx->setStatus(Payment_Transaction::STATUS_COMPLETE);
$tx->setType(Payment_Transaction::TXTYPE_PAYMENT);
return $tx;
}
}