()
| 91 | } |
| 92 | |
| 93 | confirmRedeem () { |
| 94 | const options = { |
| 95 | url: '/db/subscription/-/subscribe_prepaid', |
| 96 | method: 'POST', |
| 97 | data: { ppc: this.dashedPPC() } |
| 98 | } |
| 99 | |
| 100 | options.error = (model, res, options, foo) => { |
| 101 | // console.error 'FAILED redeeming prepaid code' |
| 102 | const msg = model.responseText != null ? model.responseText : '' |
| 103 | return this.statusMessage(`Error: Could not redeem prepaid code. ${msg}`, 'error') |
| 104 | } |
| 105 | |
| 106 | options.success = (model, res, options) => { |
| 107 | // console.log 'SUCCESS redeeming prepaid code' |
| 108 | this.statusMessage('Prepaid Code Redeemed!', 'success') |
| 109 | this.supermodel.loadCollection(this.codes, 'prepaid', { cache: false }) |
| 110 | this.codes.fetch() |
| 111 | return me.fetch({ cache: false }) |
| 112 | } |
| 113 | |
| 114 | return this.supermodel.addRequestResource('subscribe_prepaid', options, 0).load() |
| 115 | } |
| 116 | |
| 117 | loadPrepaid (ppc) { |
| 118 | if (!ppc) { return } |
nothing calls this directly
no test coverage detected