public function BraintreeApiIntegrationTest::testCreatePaymentProcessorDeclined in Commerce Braintree 8
Tests creating a payment, with processor declined.
@dataProvider dataProviderBillingProfile
File
- tests/
src/ Kernel/ BraintreeApiIntegrationTest.php, line 95
Class
- BraintreeApiIntegrationTest
- Tests the Braintree SDK integration.
Namespace
Drupal\Tests\commerce_braintree\KernelCode
public function testCreatePaymentProcessorDeclined($billing_profile) {
$this
->expectException(SoftDeclineException::class);
$this
->expectExceptionMessage('Processor Declined (2101 : )');
/** @var \Drupal\commerce_braintree\Plugin\Commerce\PaymentGateway\HostedFieldsInterface $gateway_plugin */
$gateway_plugin = $this->gateway
->getPlugin();
$gateway_plugin
->createPayment($this
->generateTestPayment($billing_profile, '2101.00'));
throw new \Exception('Charge should not have been successful.');
}