CCrypto VPN public website https://vpn.ccrypto.org/
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

61 lines
3.0 KiB

  1. # -*- coding: utf-8 -*-
  2. from __future__ import unicode_literals
  3. from django.db import migrations, models
  4. import jsonfield.fields
  5. from django.conf import settings
  6. class Migration(migrations.Migration):
  7. dependencies = [
  8. migrations.swappable_dependency(settings.AUTH_USER_MODEL),
  9. ]
  10. operations = [
  11. migrations.CreateModel(
  12. name='Payment',
  13. fields=[
  14. ('id', models.AutoField(verbose_name='ID', primary_key=True, serialize=False, auto_created=True)),
  15. ('backend_id', models.CharField(choices=[('bitcoin', 'Bitcoin'), ('coinbase', 'Coinbase'), ('manual', 'Manual'), ('paypal', 'PayPal'), ('stripe', 'Stripe')], max_length=16)),
  16. ('status', models.CharField(choices=[('new', 'Waiting for payment'), ('confirmed', 'Confirmed'), ('cancelled', 'Cancelled'), ('rejected', 'Rejected by processor'), ('error', 'Payment processing failed')], max_length=16)),
  17. ('created', models.DateTimeField(auto_now_add=True)),
  18. ('modified', models.DateTimeField(auto_now=True)),
  19. ('confirmed_on', models.DateTimeField(null=True, blank=True)),
  20. ('amount', models.IntegerField()),
  21. ('paid_amount', models.IntegerField(default=0)),
  22. ('time', models.DurationField()),
  23. ('status_message', models.TextField(null=True, blank=True)),
  24. ('backend_extid', models.CharField(null=True, max_length=64, blank=True)),
  25. ('backend_data', jsonfield.fields.JSONField(blank=True, default=dict)),
  26. ],
  27. options={
  28. 'ordering': ('-created',),
  29. },
  30. ),
  31. migrations.CreateModel(
  32. name='RecurringPaymentSource',
  33. fields=[
  34. ('id', models.AutoField(verbose_name='ID', primary_key=True, serialize=False, auto_created=True)),
  35. ('backend', models.CharField(choices=[('bitcoin', 'Bitcoin'), ('coinbase', 'Coinbase'), ('manual', 'Manual'), ('paypal', 'PayPal'), ('stripe', 'Stripe')], max_length=16)),
  36. ('created', models.DateTimeField(auto_now_add=True)),
  37. ('modified', models.DateTimeField(auto_now=True)),
  38. ('period', models.CharField(choices=[('monthly', 'Monthly'), ('biannually', 'Bianually'), ('yearly', 'Yearly')], max_length=16)),
  39. ('last_confirmed_payment', models.DateTimeField(null=True, blank=True)),
  40. ('backend_id', models.CharField(null=True, max_length=64, blank=True)),
  41. ('backend_data', jsonfield.fields.JSONField(blank=True, default=dict)),
  42. ('user', models.ForeignKey(to=settings.AUTH_USER_MODEL)),
  43. ],
  44. ),
  45. migrations.AddField(
  46. model_name='payment',
  47. name='recurring_source',
  48. field=models.ForeignKey(null=True, to='payments.RecurringPaymentSource', blank=True),
  49. ),
  50. migrations.AddField(
  51. model_name='payment',
  52. name='user',
  53. field=models.ForeignKey(to=settings.AUTH_USER_MODEL),
  54. ),
  55. ]