commerce_no_payment.module in Commerce No Payment 7.2
Provides a payment method for Drupal Commerce for orders that do not require a payment (free stuff).
File
commerce_no_payment.module
View source
<?php
define('COMMERCE_NO_PAYMENT_MIGRATE_PER_RUN', 100);
function commerce_no_payment_commerce_payment_method_info() {
$payment_methods = array();
$payment_methods['commerce_no_payment'] = array(
'title' => t('No payment required'),
'description' => t('Does a complete payment transaction with no payment required.'),
'active' => TRUE,
);
return $payment_methods;
}
function commerce_no_payment_commerce_payment_transaction_count($commerce_payment_method) {
return db_select('commerce_payment_transaction')
->condition('payment_method', $commerce_payment_method)
->condition('instance_id', $commerce_payment_method . '|commerce_payment_' . $commerce_payment_method)
->countQuery()
->execute()
->fetchField();
}