You are here

public function PaymentIntentTest::dataProviderCreatePaymentIntent in Commerce Stripe 8

Data provider for createPaymentIntent.

Return value

\Generator The test data.

File

tests/src/Kernel/PaymentIntentTest.php, line 203

Class

PaymentIntentTest
Payment intent tests.

Namespace

Drupal\Tests\commerce_stripe\Kernel

Code

public function dataProviderCreatePaymentIntent() {

  // 3DS 2 authentication must be completed for the payment to be successful.
  (yield [
    'pm_card_threeDSecure2Required',
    TRUE,
    PaymentIntent::STATUS_REQUIRES_CONFIRMATION,
    PaymentIntent::STATUS_REQUIRES_ACTION,
  ]);
  (yield [
    'pm_card_threeDSecure2Required',
    FALSE,
    PaymentIntent::STATUS_REQUIRES_CONFIRMATION,
    PaymentIntent::STATUS_REQUIRES_ACTION,
  ]);

  // 3DS authentication may still be performed, but is not required.
  (yield [
    'pm_card_threeDSecureOptional',
    TRUE,
    PaymentIntent::STATUS_REQUIRES_CONFIRMATION,
    PaymentIntent::STATUS_SUCCEEDED,
  ]);

  // 3DS is supported for this card, but this card is not enrolled in 3D Secure
  (yield [
    'pm_card_visa',
    TRUE,
    PaymentIntent::STATUS_REQUIRES_CONFIRMATION,
    PaymentIntent::STATUS_SUCCEEDED,
  ]);

  // 3DS is not supported on this card and cannot be invoked.
  (yield [
    'pm_card_amex_threeDSecureNotSupported',
    TRUE,
    PaymentIntent::STATUS_REQUIRES_CONFIRMATION,
    PaymentIntent::STATUS_SUCCEEDED,
  ]);
}