Change address handling for card button

Make the name field to always appear and send at least one address
This commit is contained in:
Alex P 2022-07-19 09:24:19 +03:00
parent d4e8bd453c
commit 619e9d2552
4 changed files with 59 additions and 30 deletions

View file

@ -1046,8 +1046,6 @@ class OrderEndpointTest extends TestCase
$payer = Mockery::mock(Payer::class);
$payer->expects('email_address')->andReturn('email@email.com');
$payerName = Mockery::mock(PayerName::class);
$payer->expects('name')->andReturn($payerName);
$payer->expects('to_array')->andReturn(['payer']);
$result = $testee->create([$purchaseUnit], ApplicationContext::SHIPPING_PREFERENCE_GET_FROM_FILE, $payer);
$this->assertEquals($expectedOrder, $result);
@ -1138,8 +1136,6 @@ class OrderEndpointTest extends TestCase
$payer = Mockery::mock(Payer::class);
$payer->expects('email_address')->andReturn('email@email.com');
$payerName = Mockery::mock(PayerName::class);
$payer->expects('name')->andReturn($payerName);
$payer->expects('to_array')->andReturn(['payer']);
$testee->create([$purchaseUnit], ApplicationContext::SHIPPING_PREFERENCE_NO_SHIPPING, $payer);
}
@ -1229,8 +1225,6 @@ class OrderEndpointTest extends TestCase
$this->expectException(RuntimeException::class);
$payer = Mockery::mock(Payer::class);
$payer->expects('email_address')->andReturn('email@email.com');
$payerName = Mockery::mock(PayerName::class);
$payer->expects('name')->andReturn($payerName);
$payer->expects('to_array')->andReturn(['payer']);
$testee->create([$purchaseUnit], ApplicationContext::SHIPPING_PREFERENCE_GET_FROM_FILE, $payer);
}