(token, options)
| 46 | } |
| 47 | |
| 48 | purchase (token, options) { |
| 49 | if (options == null) { options = {} } |
| 50 | options.url = _.result(this, 'url') + '/purchase' |
| 51 | options.method = 'POST' |
| 52 | if (options.data == null) { options.data = {} } |
| 53 | options.data.token = token != null ? token.id : undefined |
| 54 | options.data.timestamp = new Date().getTime() |
| 55 | options.data = JSON.stringify(options.data) |
| 56 | options.contentType = 'application/json' |
| 57 | return $.ajax(options) |
| 58 | } |
| 59 | |
| 60 | purchaseWithPayPal (payment, options) { |
| 61 | return this.purchase(undefined, _.merge({ |
no test coverage detected