You are here

protected function CommercePayleapTest::createDummyCreditCardInfo in Commerce Payleap 7

Return an array with credit card info.

3 calls to CommercePayleapTest::createDummyCreditCardInfo()
CommercePayleapTest::testCommercePayleapAuthTransaction in tests/commerce_payleap.test
Test the PayLeap Auth transaction.
CommercePayleapTest::testCommercePayleapCardonFileTranscation in tests/commerce_payleap.test
CommercePayleapTest::testCommercePayleapDirectTransaction in tests/commerce_payleap.test
Test the PayLeap direct transaction.

File

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

Class

CommercePayleapTest
Test payment user interface.

Code

protected function createDummyCreditCardInfo($order, $transaction_type = 'Sale', $credit_card_number = '5555555555554444') {
  $order_wrapper = entity_metadata_wrapper('commerce_order', $order);
  $billing_data = commerce_payleap_get_billing_info($order);
  return array(
    'TransType' => $transaction_type,
    'CardNum' => $credit_card_number,
    'ExpDate' => '0420',
    'CVNum' => '123',
    'Amount' => commerce_currency_amount_to_decimal($order_wrapper->commerce_order_total->amount
      ->value(), $order_wrapper->commerce_order_total->currency_code
      ->value()),
    'MagData' => '',
    'NameOnCard' => $billing_data['name_on_card'],
    'InvNum' => $this->order->order_number,
    'Street' => $billing_data['street'],
    'Zip' => $billing_data['zip'],
    'ExtData' => $billing_data['ext_data'],
  );
}