function CommerceNoPaymentUpgrade::createTransaction in Commerce No Payment 7.2
Creates a Commerce Payment transaction.
Parameters
string $transaction_status:
Return value
NULL
1 call to CommerceNoPaymentUpgrade::createTransaction()
- CommerceNoPaymentUpgrade::setUp in tests/
CommerceNoPaymentUpgrade.test - Overrides parent::setUp().
File
- tests/
CommerceNoPaymentUpgrade.test, line 81 - Contains class CommerceNoPaymentUpgrade.
Class
- CommerceNoPaymentUpgrade
- Tests the upgrade path from Commerce no payment 7.x-1.x to 7.x-2.x.
Code
function createTransaction($transaction_status) {
$transaction = commerce_payment_transaction_new('commerce_no_payment', 1);
$transaction->instance_id = 'commerce_no_payment|commerce_payment_commerce_no_payment';
$transaction->amount = 999;
$transaction->currency_code = 'EUR';
$transaction->status = $transaction_status;
commerce_payment_transaction_save($transaction);
}