Get payer from order instead of customer

This commit is contained in:
dinamiko 2022-08-12 10:38:42 +02:00
parent 0e24b1d0f8
commit 76a81b535b
4 changed files with 5 additions and 9 deletions

View file

@ -105,7 +105,7 @@ class VaultedCreditCardHandlerTest extends TestCase
$customer = Mockery::mock(WC_Customer::class);
$payer = Mockery::mock(Payer::class);
$this->payerFactory->shouldReceive('from_customer')
$this->payerFactory->shouldReceive('from_wc_order')
->andReturn($payer);
$this->shippingPreferenceFactory->shouldReceive('from_state')
->andReturn('some_preference');

View file

@ -90,6 +90,7 @@ class CreditCardGatewayTest extends TestCase
public function testProcessPaymentVaultedCard()
{
$wc_order = Mockery::mock(WC_Order::class);
$wc_order->shouldReceive('get_customer_id')->andReturn(1);
when('wc_get_order')->justReturn($wc_order);
$savedCreditCard = 'abc123';