Create a functional test that creates a payment method, creates an order, goes to admin/commerce/orders/$order_id/payments, creates an authorized payment, captures the authorization, then refunds it.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

mbreden created an issue. See original summary.

mbreden’s picture

Title: Create PaymentTest » Create PaymentAdminTest
Status: Active » Needs review
FileSize
6.23 KB

Attached the patch!

steveoliver’s picture

Status: Needs review » Needs work

Looks good -- Maybe just add a test for Void operation?

mbreden’s picture

Status: Needs work » Needs review
FileSize
8.07 KB

Added two more tests, testPaymentVoid() and testPaymentDelete().

steveoliver’s picture

Status: Needs review » Reviewed & tested by the community

Awesome!

  • bojanz committed 82bb8be on 8.x-2.x authored by mbreden
    Issue #2820935 by mbreden: Create PaymentAdminTest
    
bojanz’s picture

Status: Reviewed & tested by the community » Fixed

Committed, thanks!

I removed this part:

+    $plugin = $payment_gateway->getPlugin();
+    $config = $plugin->getConfiguration();
+    $config['payment_method_types'] = ['credit_card'];
+    $plugin->setConfiguration($config);

It's not needed, the credit_card payment method type is always enabled by default.

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.