public function SquareApiIntegrationTest::testCreatePaymentBadExpiryDate in Commerce Square Connect 8
Tests creating a payment, with invalid expiration date error.
File
- tests/
src/ Kernel/ SquareApiIntegrationTest.php, line 131
Class
- SquareApiIntegrationTest
- Tests the Square SDK integration with Commerce.
Namespace
Drupal\Tests\commerce_square\KernelCode
public function testCreatePaymentBadExpiryDate() {
$this
->expectException(SoftDeclineException::class);
$this
->expectExceptionCode(0);
$this
->expectExceptionMessage('Invalid card expiration date.');
/** @var \Drupal\commerce_square\Plugin\Commerce\PaymentGateway\SquareInterface $gateway_plugin */
$gateway_plugin = $this->gateway
->getPlugin();
$gateway_plugin
->createPayment($this
->generateTestPayment('cnon:card-nonce-rejected-expiration'));
}