You are here

public function CommercePayleapTest::testCommercePayleapDirectTransaction in Commerce Payleap 7

Test the PayLeap direct transaction.

File

tests/commerce_payleap.test, line 95
Functional tests for the commerce payment module user interface.

Class

CommercePayleapTest
Test payment user interface.

Code

public function testCommercePayleapDirectTransaction() {
  $user = $this->store_customer;

  // Log in as normal user.
  $this
    ->drupalLogin($user);
  $product = $this
    ->createDummyProduct($this
    ->randomName(), $this
    ->randomName(), 2, 'USD', $this->store_admin->uid);
  $this->order = $this
    ->createDummyOrder($user->uid, array(
    $product->product_id => 20,
  ));

  // Generate random information, as city, postal code, etc.
  $payment_method = $this
    ->getPayleapSettings();
  $info = $this
    ->createDummyCreditCardInfo($this->order);
  $response = commerce_payleap_request($payment_method, $info);
  $this
    ->assertTrue($response['status']);
}