Introduce oxxo payment (WIP)

This commit is contained in:
dinamiko 2022-07-05 11:30:20 +02:00
parent 49048c59d5
commit 2b67884900
10 changed files with 344 additions and 104 deletions

View file

@ -13,6 +13,7 @@ use WooCommerce\PayPalCommerce\ApiClient\Factory\PurchaseUnitFactory;
use WooCommerce\PayPalCommerce\Onboarding\Environment;
use WooCommerce\PayPalCommerce\TestCase;
use WooCommerce\PayPalCommerce\WcGateway\Gateway\TransactionUrlProvider;
use WooCommerce\PayPalCommerce\WcGateway\Helper\CheckoutHelper;
use WooCommerce\PayPalCommerce\WcGateway\Helper\PayUponInvoiceHelper;
use function Brain\Monkey\Functions\when;
@ -26,6 +27,7 @@ class PayUponInvoiceGatewayTest extends TestCase
private $logger;
private $testee;
private $pui_helper;
private $checkout_helper;
public function setUp(): void
{
@ -38,6 +40,7 @@ class PayUponInvoiceGatewayTest extends TestCase
$this->logger = Mockery::mock(LoggerInterface::class);
$this->transaction_url_provider = Mockery::mock(TransactionUrlProvider::class);
$this->pui_helper = Mockery::mock(PayUponInvoiceHelper::class);
$this->checkout_helper = Mockery::mock(CheckoutHelper::class);
$this->setInitStubs();
@ -48,7 +51,8 @@ class PayUponInvoiceGatewayTest extends TestCase
$this->environment,
$this->transaction_url_provider,
$this->logger,
$this->pui_helper
$this->pui_helper,
$this->checkout_helper
);
}

View file

@ -4,6 +4,7 @@ declare(strict_types=1);
namespace WooCommerce\PayPalCommerce\WcGateway\Helper;
use DateTime;
use Mockery;
use WooCommerce\PayPalCommerce\TestCase;
class PayUponInvoiceHelperTest extends TestCase
@ -13,7 +14,7 @@ class PayUponInvoiceHelperTest extends TestCase
*/
public function testValidateBirthDate($input, $output)
{
$this->assertSame((new PayUponInvoiceHelper())->validate_birth_date($input), $output);
$this->assertSame((new CheckoutHelper())->validate_birth_date($input), $output);
}
public function datesProvider(): array{