mirror of
https://github.com/woocommerce/woocommerce-paypal-payments.git
synced 2025-09-04 08:47:23 +08:00
Handle denied authorization when capturing via order action
If nothing to capture and do not have captures, then show error.
This commit is contained in:
parent
06e437e0c3
commit
ea7f56c402
4 changed files with 72 additions and 36 deletions
|
@ -117,6 +117,12 @@ class AuthorizedPaymentsProcessorTest extends TestCase
|
|||
$this->assertEquals(AuthorizedPaymentsProcessor::ALREADY_CAPTURED, $this->testee->process($this->wcOrder));
|
||||
}
|
||||
|
||||
public function testBadAuthorization() {
|
||||
$this->paypalOrder = $this->createPaypalOrder([$this->createAuthorization($this->authorizationId, AuthorizationStatus::DENIED)]);
|
||||
|
||||
$this->assertEquals(AuthorizedPaymentsProcessor::BAD_AUTHORIZATION, $this->testee->process($this->wcOrder));
|
||||
}
|
||||
|
||||
private function createWcOrder(string $paypalOrderId): WC_Order {
|
||||
$wcOrder = Mockery::mock(WC_Order::class);
|
||||
$wcOrder
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue