mirror of
https://github.com/codeninjasllc/codecombat.git
synced 2024-12-04 21:01:06 -05:00
cb29d7068b
Closes #3402
31 lines
1.1 KiB
CoffeeScript
31 lines
1.1 KiB
CoffeeScript
c = require './../schemas'
|
|
|
|
PaymentSchema = c.object({title: 'Payment', required: []}, {
|
|
purchaser: c.objectId(links: [ {rel: 'extra', href: '/db/user/{($)}'} ]) # in case of gifts
|
|
recipient: c.objectId(links: [ {rel: 'extra', href: '/db/user/{($)}'} ])
|
|
|
|
service: { enum: ['stripe', 'ios', 'external']}
|
|
amount: { type: 'integer', description: 'Payment in cents.' }
|
|
created: c.date({title: 'Created', readOnly: true})
|
|
gems: { type: 'integer', description: 'The number of gems acquired.' }
|
|
productID: { enum: ['gems_5', 'gems_10', 'gems_20', 'custom']}
|
|
description: { type: 'string' }
|
|
prepaidID: c.objectId()
|
|
|
|
ios: c.object({title: 'iOS IAP Data'}, {
|
|
transactionID: { type: 'string' }
|
|
rawReceipt: { type: 'string' }
|
|
localPrice: { type: 'string' }
|
|
})
|
|
|
|
stripe: c.object({title: 'Stripe Data'}, {
|
|
timestamp: { type: 'integer', description: 'Unique identifier provided by the client, to guard against duplicate payments.' }
|
|
chargeID: { type: 'string' }
|
|
customerID: { type: 'string' }
|
|
invoiceID: { type: 'string' }
|
|
})
|
|
})
|
|
|
|
c.extendBasicProperties(PaymentSchema, 'payment')
|
|
|
|
module.exports = PaymentSchema
|