(e)
| 174 | } |
| 175 | |
| 176 | onClickRedeemCodeButton (e) { |
| 177 | this.ppc = $('.input-ppc').val() |
| 178 | const options = { |
| 179 | url: '/db/subscription/-/subscribe_prepaid', |
| 180 | method: 'POST', |
| 181 | data: { ppc: this.dashedPPC() } |
| 182 | } |
| 183 | options.error = (model, res, options, foo) => { |
| 184 | let msg = model.responseText != null ? model.responseText : '' |
| 185 | if (model.status === 403) { |
| 186 | if (model.responseJSON.message === 'Activation Code has been used') { |
| 187 | msg = $.i18n.t('account_prepaid.activation_code_used') |
| 188 | } |
| 189 | } |
| 190 | return this.statusMessage($.i18n.t('account_prepaid.redeem_code_error') + msg, 'error') |
| 191 | } |
| 192 | options.success = (model, res, options) => { |
| 193 | this.statusMessage($.i18n.t('account_prepaid.prepaid_applied_success'), 'success') |
| 194 | this.codes.fetch({ cache: false }) |
| 195 | me.fetch({ cache: false }) |
| 196 | return this.loadPrepaid(this.dashedPPC()) |
| 197 | } |
| 198 | return this.supermodel.addRequestResource('subscribe_prepaid', options, 0).load() |
| 199 | } |
| 200 | |
| 201 | destroy () { |
| 202 | super.destroy() |
nothing calls this directly
no test coverage detected