diff --git a/app/schemas/models/payment.schema.coffee b/app/schemas/models/payment.schema.coffee index 1332c199e..d4e7d7815 100644 --- a/app/schemas/models/payment.schema.coffee +++ b/app/schemas/models/payment.schema.coffee @@ -3,19 +3,19 @@ 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' ]} + + service: { enum: ['stripe', 'ios', 'invoice']} 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']} - + 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' } diff --git a/scripts/mongodb/addExternalSubs.js b/scripts/mongodb/addExternalSubs.js new file mode 100644 index 000000000..644d41c94 --- /dev/null +++ b/scripts/mongodb/addExternalSubs.js @@ -0,0 +1,70 @@ +// Add externally purchased subscriptions + +// Usage: +// Edit hard coded data below. +// mongo
:/