MCPcopy Create free account
hub / github.com/codecombat/codecombat / purchase

Method purchase

app/models/Product.js:48–58  ·  view source on GitHub ↗
(token, options)

Source from the content-addressed store, hash-verified

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({

Callers 2

purchaseWithPayPalMethod · 0.95

Calls 1

stringifyMethod · 0.45

Tested by

no test coverage detected