protected function AcceptJsPaymentMethodTest::setUp in Commerce Authorize.Net 8
Overrides OrderKernelTestBase::setUp
File
- tests/
src/ Kernel/ AcceptJsPaymentMethodTest.php, line 42
Class
- AcceptJsPaymentMethodTest
- Tests creating a payment method with AcceptJS.
Namespace
Drupal\Tests\commerce_authnet\KernelCode
protected function setUp() : void {
parent::setUp();
$this
->installEntitySchema('commerce_payment');
$this
->installEntitySchema('commerce_payment_method');
$this
->installConfig('commerce_payment');
/** @var \Drupal\commerce_payment\Entity\PaymentGateway $gateway */
$gateway = PaymentGateway::create([
'id' => 'authorizenet_acceptjs',
'label' => 'Authorize.net AcceptJS',
'plugin' => 'authorizenet_acceptjs',
]);
$gateway
->getPlugin()
->setConfiguration([
'api_login' => '64EZ77a2w8',
'transaction_key' => '2rrbVvBR6949En2d',
'client_key' => '2fejMFQEzA2cg6C5wV3Kz398S94XkPbS56RU2Zq2tfjcmDhDVp8h8XmZ49JQLbY6',
'mode' => 'test',
'payment_method_types' => [
'credit_card',
],
]);
$gateway
->save();
$this->gateway = $gateway;
}