本文整理汇总了PHP中Transaction::delete方法的典型用法代码示例。如果您正苦于以下问题:PHP Transaction::delete方法的具体用法?PHP Transaction::delete怎么用?PHP Transaction::delete使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Transaction
的用法示例。
在下文中一共展示了Transaction::delete方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: delete
public function delete()
{
$Transaction = new Transaction($this->data->id);
$Transaction->delete();
$go = '>auth/Transaction/formFind';
$this->renderPrompt('information', "Transaction [{$this->data->idTransaction}] removido.", $go);
}
示例2: deleteEntry
/**
* Delete requested transaction
*
* @access private
*/
private function deleteEntry()
{
global $_ARRAYLANG;
if (empty($_GET['id'])) {
\Cx\Core\Csrf\Controller\Csrf::header('location: index.php?cmd=Checkout');
}
if ($this->objTransaction->delete($_GET['id'])) {
$this->arrStatusMessages['ok'][] = $_ARRAYLANG['TXT_CHECKOUT_ENTRY_DELETED_SUCCESSFULLY'];
} else {
$this->arrStatusMessages['alert'][] = $_ARRAYLANG['TXT_CHECKOUT_ENTRY_COULD_NOT_BE_DELETED'];
}
}
示例3: actionIndex
//.........这里部分代码省略.........
$model_btc->attributes = $btcFormData;
if ($model_btc->validate(array('transfer_amount', 'address'))) {
$btc_trans = new Transaction();
$btc_trans->amount = $model_btc->transfer_amount;
$btc_trans->currency = 'BTC';
$btc_trans->wallet_address = $model_btc->address;
$btc_trans->id_user = $user->id;
$btc_trans->type = Transaction::TYPE_WITHDRAW_BTC;
$btc_trans->status = Transaction::STATUS_PENDING;
if (!$btc_trans->save()) {
$model_btc->addError('dummy', 'Save failed');
Yii::log('Unable to submit transaction, save failed');
}
}
}
if ($wire_submit && $bankFormData) {
$model_bank->attributes = $bankFormData;
if ($intermediateFormData) {
$model_intermediate->attributes = $intermediateFormData;
if ($intermediateFormData && $model_intermediate->validate(array('account_number', 'account_name', 'bank_name', 'swift_number', 'comments', 'city', 'postcode', 'countrycode'))) {
$intermediate_ok = TRUE;
}
}
}
if ($model_bank->validate(array('transfer_amount', 'account_number', 'account_name', 'bank_name', 'swift_number', 'comments', 'city', 'postcode', 'countrycode'))) {
$primary_ok = TRUE;
}
if ($primary_ok == TRUE) {
$bank_trans = new Transaction();
$bank_trans->amount = $model_bank->transfer_amount;
$bank_trans->currency = '';
$bank_trans->wallet_address = $model_bank->account_number;
$bank_trans->id_user = $user->id;
$bank_trans->type = Transaction::TYPE_WITHDRAW_FIAT;
$bank_trans->status = Transaction::STATUS_PENDING;
$bank_trans->descr = var_dump($model_bank);
$bank_info = new TransactionBankInfo();
$bank_info->account_number = $model_bank->account_number;
$bank_info->account_name = $model_bank->account_name;
$bank_info->bank_name = $model_bank->bank_name;
$bank_info->swift_number = $model_bank->swift_number;
$bank_info->comments = $model_bank->comments;
$bank_info->line1 = $model_bank->line1;
$bank_info->line2 = $model_bank->line2;
$bank_info->city = $model_bank->city;
$bank_info->postcode = $model_bank->postcode;
$bank_info->countrycode = $model_bank->countrycode;
if (!$bank_trans->save()) {
$model_bank->addError('dummy', 'Save failed');
Yii::log('Unable to submit transaction, save failed');
}
$bank_info->id_trans = $bank_trans->id_trans;
if (!$bank_info->save()) {
$model_bank->addError('dummy', 'Save failed');
Yii::log('Unable to submit transaction, save failed');
$bank_trans->delete();
}
if ($intermediate_ok == TRUE) {
$inter_info = new TransactionBankInfo();
$inter_info->account_number = $model_intermediate->account_number;
$inter_info->account_name = $model_intermediate->account_name;
$inter_info->bank_name = $model_intermediate->bank_name;
$inter_info->swift_number = $model_intermediate->swift_number;
$inter_info->comments = $model_intermediate->comments;
$inter_info->line1 = $model_intermediate->line1;
$inter_info->line2 = $model_intermediate->line2;
$inter_info->city = $model_intermediate->city;
$inter_info->postcode = $model_intermediate->postcode;
$inter_info->countrycode = $model_intermediate->countrycode;
$inter_info->intermediate = 1;
$inter_info->id_trans = $bank_trans->id_trans;
if (!$inter_info->save()) {
$model_intermediate->addError('dummy', 'Save failed');
Yii::log('Unable to submit transaction, save failed');
$bank_trans->delete();
$bank_info->delete();
}
}
}
if ($paypal_submit && $paypalFormData) {
$model_paypal->attributes = $paypalFormData;
if ($model_paypal->validate(array('transfer_amount', 'email'))) {
$paypal_trans = new Transaction();
$paypal_trans->amount = $model_bank->transfer_amount;
$paypal_trans->wallet_address = $model_bank->email;
$paypal_trans->currency = 'MXN';
$paypal_trans->id_user = $user->id;
$paypal_trans->type = Transaction::TYPE_WITHDRAW_FIAT;
$paypal_trans->status = Transaction::STATUS_PENDING;
$paypal_trans->descr = $model_paypal->notes;
if (!$paypal_trans->save()) {
$model_paypal->addError('dummy', 'Save failed');
Yii::log('Unable to submit transaction, save failed');
}
}
}
}
}
$this->render('index', compact('balance', 'user', 'tab', 'model_btc', 'model_bank', 'model_paypal', 'model_intermediate', 'user_country_code', 'deliveras'));
}