mirror of
https://github.com/woocommerce/woocommerce-paypal-payments.git
synced 2025-09-05 08:59:14 +08:00
Merge remote-tracking branch 'origin/trunk' into PCP-155-tracking-api
# Conflicts: # modules/ppcp-wc-gateway/services.php # modules/ppcp-wc-gateway/src/Helper/PayUponInvoiceHelper.php # tests/PHPUnit/WcGateway/Helper/PayUponInvoiceHelperTest.php
This commit is contained in:
commit
9b63ab0b91
81 changed files with 3707 additions and 1031 deletions
109
tests/PHPUnit/WcGateway/Gateway/CreditCardGatewayTest.php
Normal file
109
tests/PHPUnit/WcGateway/Gateway/CreditCardGatewayTest.php
Normal file
|
@ -0,0 +1,109 @@
|
|||
<?php
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace WooCommerce\PayPalCommerce\WcGateway\Gateway;
|
||||
|
||||
use Mockery;
|
||||
use Psr\Container\ContainerInterface;
|
||||
use Psr\Log\LoggerInterface;
|
||||
use WC_Order;
|
||||
use WooCommerce\PayPalCommerce\ApiClient\Endpoint\PaymentsEndpoint;
|
||||
use WooCommerce\PayPalCommerce\Onboarding\State;
|
||||
use WooCommerce\PayPalCommerce\Session\SessionHandler;
|
||||
use WooCommerce\PayPalCommerce\Subscription\Helper\SubscriptionHelper;
|
||||
use WooCommerce\PayPalCommerce\TestCase;
|
||||
use WooCommerce\PayPalCommerce\Vaulting\VaultedCreditCardHandler;
|
||||
use WooCommerce\PayPalCommerce\WcGateway\Processor\OrderProcessor;
|
||||
use WooCommerce\PayPalCommerce\WcGateway\Processor\RefundProcessor;
|
||||
use WooCommerce\PayPalCommerce\WcGateway\Settings\SettingsRenderer;
|
||||
use function Brain\Monkey\Functions\when;
|
||||
|
||||
class CreditCardGatewayTest extends TestCase
|
||||
{
|
||||
private $settingsRenderer;
|
||||
private $orderProcessor;
|
||||
private $config;
|
||||
private $moduleUrl;
|
||||
private $sessionHandler;
|
||||
private $refundProcessor;
|
||||
private $state;
|
||||
private $transactionUrlProvider;
|
||||
private $subscriptionHelper;
|
||||
private $logger;
|
||||
private $paymentsEndpoint;
|
||||
private $vaultedCreditCardHandler;
|
||||
private $testee;
|
||||
|
||||
public function setUp(): void
|
||||
{
|
||||
parent::setUp();
|
||||
|
||||
$this->settingsRenderer = Mockery::mock(SettingsRenderer::class);
|
||||
$this->orderProcessor = Mockery::mock(OrderProcessor::class);
|
||||
$this->config = Mockery::mock(ContainerInterface::class);
|
||||
$this->moduleUrl = '';
|
||||
$this->sessionHandler = Mockery::mock(SessionHandler::class);
|
||||
$this->refundProcessor = Mockery::mock(RefundProcessor::class);
|
||||
$this->state = Mockery::mock(State::class);
|
||||
$this->transactionUrlProvider = Mockery::mock(TransactionUrlProvider::class);
|
||||
$this->subscriptionHelper = Mockery::mock(SubscriptionHelper::class);
|
||||
$this->logger = Mockery::mock(LoggerInterface::class);
|
||||
$this->paymentsEndpoint = Mockery::mock(PaymentsEndpoint::class);
|
||||
$this->vaultedCreditCardHandler = Mockery::mock(VaultedCreditCardHandler::class);
|
||||
|
||||
$this->state->shouldReceive('current_state')->andReturn(State::STATE_ONBOARDED);
|
||||
$this->config->shouldReceive('has')->andReturn(true);
|
||||
$this->config->shouldReceive('get')->andReturn('');
|
||||
|
||||
$this->testee = new CreditCardGateway(
|
||||
$this->settingsRenderer,
|
||||
$this->orderProcessor,
|
||||
$this->config,
|
||||
$this->moduleUrl,
|
||||
$this->sessionHandler,
|
||||
$this->refundProcessor,
|
||||
$this->state,
|
||||
$this->transactionUrlProvider,
|
||||
$this->subscriptionHelper,
|
||||
$this->logger,
|
||||
$this->paymentsEndpoint,
|
||||
$this->vaultedCreditCardHandler
|
||||
);
|
||||
}
|
||||
|
||||
public function testProcessPayment()
|
||||
{
|
||||
$wc_order = Mockery::mock(WC_Order::class);
|
||||
when('wc_get_order')->justReturn($wc_order);
|
||||
|
||||
$this->orderProcessor->shouldReceive('process')
|
||||
->with($wc_order)
|
||||
->andReturn(true);
|
||||
$this->subscriptionHelper->shouldReceive('has_subscription')
|
||||
->andReturn(false);
|
||||
$this->sessionHandler->shouldReceive('destroy_session_data')->once();
|
||||
|
||||
$result = $this->testee->process_payment(1);
|
||||
$this->assertEquals('success', $result['result']);
|
||||
}
|
||||
|
||||
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';
|
||||
when('filter_input')->justReturn($savedCreditCard);
|
||||
|
||||
$this->vaultedCreditCardHandler
|
||||
->shouldReceive('handle_payment')
|
||||
->with($savedCreditCard, $wc_order)
|
||||
->andReturn($wc_order);
|
||||
|
||||
$this->sessionHandler->shouldReceive('destroy_session_data')->once();
|
||||
|
||||
$result = $this->testee->process_payment(1);
|
||||
$this->assertEquals('success', $result['result']);
|
||||
}
|
||||
}
|
141
tests/PHPUnit/WcGateway/Gateway/OXXO/OXXOGatewayTest.php
Normal file
141
tests/PHPUnit/WcGateway/Gateway/OXXO/OXXOGatewayTest.php
Normal file
|
@ -0,0 +1,141 @@
|
|||
<?php
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace WooCommerce\PayPalCommerce\WcGateway\Gateway\OXXO;
|
||||
|
||||
use Mockery;
|
||||
use Psr\Log\LoggerInterface;
|
||||
use WC_Order;
|
||||
use WooCommerce\PayPalCommerce\ApiClient\Endpoint\OrderEndpoint;
|
||||
use WooCommerce\PayPalCommerce\ApiClient\Entity\Order;
|
||||
use WooCommerce\PayPalCommerce\ApiClient\Entity\PurchaseUnit;
|
||||
use WooCommerce\PayPalCommerce\ApiClient\Exception\RuntimeException;
|
||||
use WooCommerce\PayPalCommerce\ApiClient\Factory\PurchaseUnitFactory;
|
||||
use WooCommerce\PayPalCommerce\ApiClient\Factory\ShippingPreferenceFactory;
|
||||
use WooCommerce\PayPalCommerce\TestCase;
|
||||
use function Brain\Monkey\Functions\when;
|
||||
|
||||
class OXXOGatewayTest extends TestCase
|
||||
{
|
||||
private $orderEndpoint;
|
||||
private $purchaseUnitFactory;
|
||||
private $shippingPreferenceFactory;
|
||||
private $logger;
|
||||
private $wcOrder;
|
||||
private $testee;
|
||||
|
||||
public function setUp(): void
|
||||
{
|
||||
parent::setUp();
|
||||
|
||||
$this->orderEndpoint = Mockery::mock(OrderEndpoint::class);
|
||||
$this->purchaseUnitFactory = Mockery::mock(PurchaseUnitFactory::class);
|
||||
$this->shippingPreferenceFactory = Mockery::mock(ShippingPreferenceFactory::class);
|
||||
$this->logger = Mockery::mock(LoggerInterface::class);
|
||||
|
||||
$this->wcOrder = Mockery::mock(WC_Order::class);
|
||||
when('wc_get_order')->justReturn($this->wcOrder);
|
||||
when('get_option')->justReturn([
|
||||
'title' => 'foo',
|
||||
'description' => 'bar',
|
||||
]);
|
||||
|
||||
$this->testee = new OXXOGateway(
|
||||
$this->orderEndpoint,
|
||||
$this->purchaseUnitFactory,
|
||||
$this->shippingPreferenceFactory,
|
||||
'oxxo.svg',
|
||||
$this->logger
|
||||
);
|
||||
}
|
||||
|
||||
public function testProcessPaymentSuccess()
|
||||
{
|
||||
$this->wcOrder->shouldReceive('get_billing_first_name')->andReturn('John');
|
||||
$this->wcOrder->shouldReceive('get_billing_last_name')->andReturn('Doe');
|
||||
$this->wcOrder->shouldReceive('get_billing_email')->andReturn('foo@bar.com');
|
||||
$this->wcOrder->shouldReceive('get_billing_country')->andReturn('MX');
|
||||
|
||||
list($purchaseUnit, $shippingPreference) = $this->setStubs();
|
||||
|
||||
$linkHref = 'https://sandbox.paypal.com/payment/oxxo?token=ABC123';
|
||||
$this->orderEndpoint
|
||||
->shouldReceive('confirm_payment_source')
|
||||
->with('1', [
|
||||
'oxxo' => [
|
||||
'name' => 'John Doe',
|
||||
'email' => 'foo@bar.com',
|
||||
'country_code' => 'MX',
|
||||
]
|
||||
]
|
||||
)->andReturn((object)[
|
||||
'links' => [
|
||||
(object)[
|
||||
'rel' => 'payer-action',
|
||||
'href' => $linkHref,
|
||||
],
|
||||
]
|
||||
]);
|
||||
|
||||
$order = Mockery::mock(Order::class);
|
||||
$order->shouldReceive('id')->andReturn('1');
|
||||
|
||||
$this->orderEndpoint
|
||||
->shouldReceive('create')
|
||||
->with([$purchaseUnit], $shippingPreference)
|
||||
->andReturn($order);
|
||||
|
||||
$this->wcOrder
|
||||
->shouldReceive('add_meta_data')
|
||||
->with('ppcp_oxxo_payer_action', $linkHref)
|
||||
->andReturn(true);
|
||||
$this->wcOrder->shouldReceive('save_meta_data');
|
||||
|
||||
$woocommerce = Mockery::mock(\WooCommerce::class);
|
||||
$cart = Mockery::mock(\WC_Cart::class);
|
||||
when('WC')->justReturn($woocommerce);
|
||||
$woocommerce->cart = $cart;
|
||||
$cart->shouldReceive('empty_cart');
|
||||
|
||||
$result = $this->testee->process_payment(1);
|
||||
$this->assertEquals('success', $result['result']);
|
||||
}
|
||||
|
||||
public function testProcessPaymentFailure()
|
||||
{
|
||||
list($purchaseUnit, $shippingPreference) = $this->setStubs();
|
||||
|
||||
$this->orderEndpoint
|
||||
->shouldReceive('create')
|
||||
->with([$purchaseUnit], $shippingPreference)
|
||||
->andThrows(RuntimeException::class);
|
||||
|
||||
$this->logger->shouldReceive('error');
|
||||
when('wc_add_notice')->justReturn();
|
||||
when('wc_get_checkout_url')->justReturn();
|
||||
$this->wcOrder->shouldReceive('update_status');
|
||||
|
||||
$result = $this->testee->process_payment(1);
|
||||
$this->assertEquals('failure', $result['result']);
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* @return array
|
||||
*/
|
||||
private function setStubs(): array
|
||||
{
|
||||
$purchaseUnit = Mockery::mock(PurchaseUnit::class);
|
||||
$this->purchaseUnitFactory
|
||||
->shouldReceive('from_wc_order')
|
||||
->with($this->wcOrder)
|
||||
->andReturn($purchaseUnit);
|
||||
|
||||
$shippingPreference = 'SOME_SHIPPING_PREFERENCE';
|
||||
$this->shippingPreferenceFactory
|
||||
->shouldReceive('from_state')
|
||||
->with($purchaseUnit, 'checkout')
|
||||
->andReturn($shippingPreference);
|
||||
return array($purchaseUnit, $shippingPreference);
|
||||
}
|
||||
}
|
|
@ -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
|
||||
);
|
||||
}
|
||||
|
||||
|
|
|
@ -3,14 +3,7 @@ declare(strict_types=1);
|
|||
|
||||
namespace WooCommerce\PayPalCommerce\WcGateway\Gateway;
|
||||
|
||||
use Psr\Container\ContainerInterface;
|
||||
use Psr\Log\LoggerInterface;
|
||||
use WooCommerce\PayPalCommerce\ApiClient\Endpoint\OrderEndpoint;
|
||||
use WooCommerce\PayPalCommerce\ApiClient\Endpoint\PaymentsEndpoint;
|
||||
use Psr\Log\NullLogger;
|
||||
use WooCommerce\PayPalCommerce\ApiClient\Entity\Capture;
|
||||
use WooCommerce\PayPalCommerce\ApiClient\Entity\CaptureStatus;
|
||||
use WooCommerce\PayPalCommerce\ApiClient\Factory\ShippingPreferenceFactory;
|
||||
use WooCommerce\PayPalCommerce\Onboarding\Environment;
|
||||
use WooCommerce\PayPalCommerce\Onboarding\State;
|
||||
use WooCommerce\PayPalCommerce\Session\SessionHandler;
|
||||
|
@ -37,7 +30,6 @@ class WcGatewayTest extends TestCase
|
|||
private $settingsRenderer;
|
||||
private $funding_source_renderer;
|
||||
private $orderProcessor;
|
||||
private $authorizedOrdersProcessor;
|
||||
private $settings;
|
||||
private $refundProcessor;
|
||||
private $onboardingState;
|
||||
|
@ -45,10 +37,7 @@ class WcGatewayTest extends TestCase
|
|||
private $subscriptionHelper;
|
||||
private $environment;
|
||||
private $paymentTokenRepository;
|
||||
private $shipping_preference_factory;
|
||||
private $logger;
|
||||
private $paymentsEndpoint;
|
||||
private $orderEndpoint;
|
||||
private $apiShopCountry;
|
||||
|
||||
public function setUp(): void {
|
||||
|
@ -60,7 +49,6 @@ class WcGatewayTest extends TestCase
|
|||
|
||||
$this->settingsRenderer = Mockery::mock(SettingsRenderer::class);
|
||||
$this->orderProcessor = Mockery::mock(OrderProcessor::class);
|
||||
$this->authorizedOrdersProcessor = Mockery::mock(AuthorizedPaymentsProcessor::class);
|
||||
$this->settings = Mockery::mock(Settings::class);
|
||||
$this->sessionHandler = Mockery::mock(SessionHandler::class);
|
||||
$this->refundProcessor = Mockery::mock(RefundProcessor::class);
|
||||
|
@ -69,10 +57,7 @@ class WcGatewayTest extends TestCase
|
|||
$this->subscriptionHelper = Mockery::mock(SubscriptionHelper::class);
|
||||
$this->environment = Mockery::mock(Environment::class);
|
||||
$this->paymentTokenRepository = Mockery::mock(PaymentTokenRepository::class);
|
||||
$this->shipping_preference_factory = Mockery::mock(ShippingPreferenceFactory::class);
|
||||
$this->logger = Mockery::mock(LoggerInterface::class);
|
||||
$this->paymentsEndpoint = Mockery::mock(PaymentsEndpoint::class);
|
||||
$this->orderEndpoint = Mockery::mock(OrderEndpoint::class);
|
||||
$this->funding_source_renderer = new FundingSourceRenderer($this->settings);
|
||||
$this->apiShopCountry = 'DE';
|
||||
|
||||
|
@ -87,6 +72,7 @@ class WcGatewayTest extends TestCase
|
|||
$this->settings->shouldReceive('has')->andReturnFalse();
|
||||
|
||||
$this->logger->shouldReceive('info');
|
||||
$this->logger->shouldReceive('error');
|
||||
}
|
||||
|
||||
private function createGateway()
|
||||
|
@ -95,7 +81,6 @@ class WcGatewayTest extends TestCase
|
|||
$this->settingsRenderer,
|
||||
$this->funding_source_renderer,
|
||||
$this->orderProcessor,
|
||||
$this->authorizedOrdersProcessor,
|
||||
$this->settings,
|
||||
$this->sessionHandler,
|
||||
$this->refundProcessor,
|
||||
|
@ -105,10 +90,7 @@ class WcGatewayTest extends TestCase
|
|||
PayPalGateway::ID,
|
||||
$this->environment,
|
||||
$this->paymentTokenRepository,
|
||||
$this->shipping_preference_factory,
|
||||
$this->logger,
|
||||
$this->paymentsEndpoint,
|
||||
$this->orderEndpoint,
|
||||
$this->apiShopCountry
|
||||
);
|
||||
}
|
||||
|
@ -173,8 +155,10 @@ class WcGatewayTest extends TestCase
|
|||
when('wc_get_checkout_url')
|
||||
->justReturn($redirectUrl);
|
||||
|
||||
expect('wc_add_notice')
|
||||
->with('Couldn\'t find order to process','error');
|
||||
$this->sessionHandler
|
||||
->shouldReceive('destroy_session_data');
|
||||
|
||||
expect('wc_add_notice');
|
||||
|
||||
$this->assertEquals(
|
||||
[
|
||||
|
@ -195,7 +179,6 @@ class WcGatewayTest extends TestCase
|
|||
->andReturnFalse();
|
||||
$this->orderProcessor
|
||||
->expects('last_error')
|
||||
->twice()
|
||||
->andReturn($lastError);
|
||||
$this->subscriptionHelper->shouldReceive('has_subscription')->with($orderId)->andReturn(true);
|
||||
$this->subscriptionHelper->shouldReceive('is_subscription_change_payment')->andReturn(true);
|
||||
|
@ -206,6 +189,8 @@ class WcGatewayTest extends TestCase
|
|||
expect('wc_get_order')
|
||||
->with($orderId)
|
||||
->andReturn($wcOrder);
|
||||
$this->sessionHandler
|
||||
->shouldReceive('destroy_session_data');
|
||||
expect('wc_add_notice')
|
||||
->with($lastError, 'error');
|
||||
|
||||
|
|
|
@ -14,8 +14,7 @@ class PayUponInvoiceHelperTest extends TestCase
|
|||
*/
|
||||
public function testValidateBirthDate($input, $output)
|
||||
{
|
||||
$pui_product_status = Mockery::mock(PayUponInvoiceProductStatus::class);
|
||||
$this->assertSame((new PayUponInvoiceHelper('DE', $pui_product_status))->validate_birth_date($input), $output);
|
||||
$this->assertSame((new CheckoutHelper())->validate_birth_date($input), $output);
|
||||
}
|
||||
|
||||
public function datesProvider(): array{
|
||||
|
@ -28,6 +27,7 @@ class PayUponInvoiceHelperTest extends TestCase
|
|||
['1942-02-31', false],
|
||||
['01-01-1942', false],
|
||||
['1942-01-01', true],
|
||||
['0001-01-01', false],
|
||||
];
|
||||
}
|
||||
|
||||
|
|
|
@ -4,6 +4,7 @@ declare(strict_types=1);
|
|||
namespace WooCommerce\PayPalCommerce\WcGateway\Processor;
|
||||
|
||||
|
||||
use Mockery\MockInterface;
|
||||
use Psr\Container\ContainerInterface;
|
||||
use Psr\Log\NullLogger;
|
||||
use WC_Order;
|
||||
|
@ -26,7 +27,11 @@ use WooCommerce\PayPalCommerce\WcGateway\Notice\AuthorizeOrderActionNotice;
|
|||
|
||||
class AuthorizedPaymentsProcessorTest extends TestCase
|
||||
{
|
||||
/**
|
||||
* @var WC_Order&MockInterface
|
||||
*/
|
||||
private $wcOrder;
|
||||
|
||||
private $paypalOrderId = 'abc';
|
||||
private $authorizationId = 'qwe';
|
||||
private $amount = 42.0;
|
||||
|
@ -37,7 +42,7 @@ class AuthorizedPaymentsProcessorTest extends TestCase
|
|||
private $paymentsEndpoint;
|
||||
private $notice;
|
||||
private $config;
|
||||
private $subscription_helperauthorization;
|
||||
private $captureId = '123qwe';
|
||||
private $testee;
|
||||
|
||||
public function setUp(): void {
|
||||
|
@ -79,7 +84,7 @@ class AuthorizedPaymentsProcessorTest extends TestCase
|
|||
$this->paymentsEndpoint
|
||||
->expects('capture')
|
||||
->with($this->authorizationId, equalTo(new Money($this->amount, $this->currency)))
|
||||
->andReturn($this->createCapture(CaptureStatus::COMPLETED));
|
||||
->andReturn($this->createCapture($this->captureId, CaptureStatus::COMPLETED));
|
||||
|
||||
$this->assertEquals(AuthorizedPaymentsProcessor::SUCCESSFUL, $this->testee->process($this->wcOrder));
|
||||
}
|
||||
|
@ -99,7 +104,7 @@ class AuthorizedPaymentsProcessorTest extends TestCase
|
|||
$this->paymentsEndpoint
|
||||
->expects('capture')
|
||||
->with($authorizations[2]->id(), equalTo(new Money($this->amount, $this->currency)))
|
||||
->andReturn($this->createCapture(CaptureStatus::COMPLETED));
|
||||
->andReturn($this->createCapture($this->captureId, CaptureStatus::COMPLETED));
|
||||
|
||||
$this->assertEquals(AuthorizedPaymentsProcessor::SUCCESSFUL, $this->testee->process($this->wcOrder));
|
||||
}
|
||||
|
@ -150,12 +155,13 @@ class AuthorizedPaymentsProcessorTest extends TestCase
|
|||
$this->paymentsEndpoint
|
||||
->expects('capture')
|
||||
->with($this->authorizationId, equalTo(new Money($this->amount, $this->currency)))
|
||||
->andReturn($this->createCapture(CaptureStatus::COMPLETED));
|
||||
->andReturn($this->createCapture($this->captureId, CaptureStatus::COMPLETED));
|
||||
|
||||
$this->wcOrder->shouldReceive('payment_complete')->andReturn(true);
|
||||
$this->wcOrder->expects('add_order_note');
|
||||
$this->wcOrder->expects('add_order_note')->twice();
|
||||
$this->wcOrder->expects('update_meta_data');
|
||||
$this->wcOrder->expects('save');
|
||||
$this->wcOrder->expects('set_transaction_id')->with($this->captureId);
|
||||
$this->wcOrder->shouldReceive('save')->atLeast()->times(1);
|
||||
|
||||
$this->assertTrue(
|
||||
$this->testee->capture_authorized_payment($this->wcOrder)
|
||||
|
@ -248,8 +254,11 @@ class AuthorizedPaymentsProcessorTest extends TestCase
|
|||
return new Authorization($id, new AuthorizationStatus($status));
|
||||
}
|
||||
|
||||
private function createCapture(string $status): Capture {
|
||||
private function createCapture(string $id, string $status): Capture {
|
||||
$capture = Mockery::mock(Capture::class);
|
||||
$capture
|
||||
->shouldReceive('id')
|
||||
->andReturn($id);
|
||||
$capture
|
||||
->shouldReceive('status')
|
||||
->andReturn(new CaptureStatus($status));
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue