Store payload into fields

main
Laurent 2 years ago
parent 7996e069e8
commit 00be33d681
  1. 1
      payload.txt
  2. 23
      subscriptions/migrations/0001_initial.py
  3. 20
      subscriptions/migrations/0002_tester.py
  4. 33
      subscriptions/migrations/0003_alter_assnotification_expiresdate_and_more.py
  5. 18
      subscriptions/migrations/0004_alter_assnotification_transactionreason.py
  6. 18
      subscriptions/migrations/0005_alter_assnotification_isupgraded.py
  7. 27
      subscriptions/models.py
  8. 2
      subscriptions/urls.py
  9. 148
      subscriptions/views.py

File diff suppressed because one or more lines are too long

@ -1,4 +1,4 @@
# Generated by Django 4.1.1 on 2024-01-15 08:49 # Generated by Django 4.1.1 on 2024-02-16 12:31
from django.db import migrations, models from django.db import migrations, models
@ -15,7 +15,26 @@ class Migration(migrations.Migration):
name='ASSNotification', name='ASSNotification',
fields=[ fields=[
('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('content', models.CharField(max_length=5000)), ('notificationType', models.CharField(max_length=100)),
('subtype', models.CharField(blank=True, max_length=100, null=True)),
('notificationUUID', models.CharField(max_length=100)),
('signedDate', models.DateField()),
('productId', models.CharField(blank=True, max_length=100, null=True)),
('appAccountToken', models.CharField(blank=True, max_length=100, null=True)),
('currency', models.CharField(blank=True, max_length=100, null=True)),
('expiresDate', models.DateField()),
('isUpgraded', models.BooleanField()),
('originalPurchaseDate', models.DateField()),
('originalTransactionId', models.CharField(blank=True, max_length=100, null=True)),
('price', models.IntegerField(blank=True, null=True)),
('quantity', models.IntegerField(blank=True, null=True)),
('revocationDate', models.DateField()),
('storefront', models.CharField(blank=True, max_length=100, null=True)),
('transactionId', models.CharField(blank=True, max_length=100, null=True)),
('transactionReason', models.IntegerField(blank=True, null=True)),
('succeededCount', models.IntegerField(blank=True, null=True)),
('failedCount', models.IntegerField(blank=True, null=True)),
('requestIdentifier', models.CharField(blank=True, max_length=100, null=True)),
], ],
), ),
] ]

@ -0,0 +1,20 @@
# Generated by Django 4.1.1 on 2024-02-16 14:06
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('subscriptions', '0001_initial'),
]
operations = [
migrations.CreateModel(
name='Tester',
fields=[
('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('date', models.DateField()),
],
),
]

@ -0,0 +1,33 @@
# Generated by Django 4.1.1 on 2024-02-16 14:14
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('subscriptions', '0002_tester'),
]
operations = [
migrations.AlterField(
model_name='assnotification',
name='expiresDate',
field=models.DateField(blank=True, null=True),
),
migrations.AlterField(
model_name='assnotification',
name='originalPurchaseDate',
field=models.DateField(blank=True, null=True),
),
migrations.AlterField(
model_name='assnotification',
name='revocationDate',
field=models.DateField(blank=True, null=True),
),
migrations.AlterField(
model_name='assnotification',
name='signedDate',
field=models.DateField(blank=True, null=True),
),
]

@ -0,0 +1,18 @@
# Generated by Django 4.1.1 on 2024-02-16 14:19
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('subscriptions', '0003_alter_assnotification_expiresdate_and_more'),
]
operations = [
migrations.AlterField(
model_name='assnotification',
name='transactionReason',
field=models.CharField(blank=True, max_length=50, null=True),
),
]

@ -0,0 +1,18 @@
# Generated by Django 4.1.1 on 2024-02-16 14:20
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('subscriptions', '0004_alter_assnotification_transactionreason'),
]
operations = [
migrations.AlterField(
model_name='assnotification',
name='isUpgraded',
field=models.BooleanField(blank=True, null=True),
),
]

@ -1,4 +1,29 @@
from django.db import models from django.db import models
class ASSNotification(models.Model): class ASSNotification(models.Model):
content = models.CharField(max_length=5000) # Payload
notificationType = models.CharField(max_length=100)
subtype = models.CharField(max_length=100, null=True, blank=True)
notificationUUID = models.CharField(max_length=100)
signedDate = models.DateField(null=True, blank=True)
productId = models.CharField(max_length=100, null=True, blank=True)
# TransactionInfo
appAccountToken = models.CharField(max_length=100, null=True, blank=True)
currency = models.CharField(max_length=100, null=True, blank=True)
expiresDate = models.DateField(null=True, blank=True)
isUpgraded = models.BooleanField(null=True, blank=True)
originalPurchaseDate = models.DateField(null=True, blank=True)
originalTransactionId = models.CharField(max_length=100, null=True, blank=True)
price = models.IntegerField(null=True, blank=True)
quantity = models.IntegerField(null=True, blank=True)
revocationDate = models.DateField(null=True, blank=True)
storefront = models.CharField(max_length=100, null=True, blank=True)
transactionId = models.CharField(max_length=100, null=True, blank=True)
transactionReason = models.CharField(max_length=50, null=True, blank=True)
# Summary
succeededCount = models.IntegerField(null=True, blank=True)
failedCount = models.IntegerField(null=True, blank=True)
requestIdentifier = models.CharField(max_length=100, null=True, blank=True)

@ -6,5 +6,5 @@ urlpatterns = [
path("", views.index, name="index"), path("", views.index, name="index"),
path('app-store-webhook/', views.app_store_webhook, name='app_store_webhook'), path('app-store-webhook/', views.app_store_webhook, name='app_store_webhook'),
path('app-store-webhook-prod/', views.app_store_webhook_prod, name='app_store_webhook_prod'), path('app-store-webhook-prod/', views.app_store_webhook_prod, name='app_store_webhook_prod'),
path('test/', views.test, name='test'), # path('test/', views.test, name='test'),
] ]

File diff suppressed because one or more lines are too long
Loading…
Cancel
Save