public function actionPaymentDelete($id) { /** @var UserAuthorizeNet $model */ $model = UserAuthorizeNet::findOne($id); if (!is_null($model) && $model->user_id == $this->getLoggedUser()->id && $model->deleteProfile()) { $model->delete(); } return $this->renderPartial('_sc_payment', ['model' => null, 'id' => null]); }
/** * @return \yii\db\ActiveQuery */ public function getUserAuthorizeNet() { return $this->hasMany(UserAuthorizeNet::className(), ['user_id' => 'id']); }
public function getUserProfileID() { /** @var UserAuthorizeNet $model */ $model = UserAuthorizeNet::find()->where("user_id=:uid and profile_id is not null and profile_id<>''", [':uid' => $this->user_id])->one(); return !is_null($model) ? $model->profile_id : ''; }
public function getCardInfo() { /** @var UserAuthorizeNet $model */ $model = UserAuthorizeNet::find()->where(['profile_id' => $this->profile_id, 'payment_profile_id' => $this->payment_profile_id])->one(); return !is_null($model) && !empty($model->getCc_info()) ? $model->getCc_info() : ''; }