# Generated by Django 2.1.3 on 2018-12-06 10:24

from django.conf import settings
import django.core.validators
from django.db import migrations, models
import django.db.models.deletion
import drf_paytm.utils


class Migration(migrations.Migration):

    initial = True

    dependencies = [
        migrations.swappable_dependency(settings.AUTH_USER_MODEL),
    ]

    operations = [
        migrations.CreateModel(
            name='PayTMConfiguration',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('create_date', models.DateTimeField(auto_now_add=True, verbose_name='Create Date/Time')),
                ('update_date', models.DateTimeField(auto_now=True, verbose_name='Date/Time Modified')),
                ('mid', models.CharField(max_length=20, unique=True, verbose_name='Merchant ID')),
                ('mkey', models.CharField(max_length=32, validators=[drf_paytm.utils.validate_key], verbose_name='Merchant Key')),
                ('is_active', models.BooleanField(default=False, verbose_name='Is Active?')),
                ('gateway_url', models.URLField(default='https://securegw-stage.paytm.in/theia/processTransaction', verbose_name='Payment Gateway URL')),
                ('status_url', models.URLField(default='https://securegw-stage.paytm.in/merchant-status/getTxnStatus', verbose_name='Payment Status URL')),
                ('company_name', models.CharField(max_length=254, verbose_name='Company Name')),
                ('created_by', models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, to=settings.AUTH_USER_MODEL)),
            ],
            options={
                'verbose_name': 'PayTM Configuration',
                'verbose_name_plural': 'PayTM Configurations',
            },
        ),
        migrations.CreateModel(
            name='TransactionRequest',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('create_date', models.DateTimeField(auto_now_add=True, verbose_name='Create Date/Time')),
                ('update_date', models.DateTimeField(auto_now=True, verbose_name='Date/Time Modified')),
                ('mid', models.CharField(max_length=20, verbose_name='Merchant ID')),
                ('itid', models.CharField(max_length=20, verbose_name='Industry Type ID')),
                ('oid', models.CharField(max_length=50, unique=True, validators=[django.core.validators.RegexValidator('^[\\w.-@]+$')], verbose_name='Order ID')),
                ('website', models.CharField(max_length=30, verbose_name='Website')),
                ('amount', models.DecimalField(decimal_places=3, max_digits=15, verbose_name='Amount')),
                ('channel', models.CharField(choices=[('WEB', 'Website'), ('WAP', 'Mobile Website/App')], max_length=3, verbose_name='Channel')),
                ('checksum', models.CharField(max_length=108, verbose_name='Checksum')),
                ('mobile', models.CharField(blank=True, max_length=15, null=True, verbose_name="Customer's Mobile Number")),
                ('email', models.EmailField(blank=True, max_length=254, null=True, verbose_name="Customer's Email")),
                ('callback_url', models.URLField(max_length=255, verbose_name='Callback URL')),
                ('payment_mode_only', models.CharField(blank=True, max_length=3, null=True, verbose_name='Payment Mode Only')),
                ('auth_mode', models.CharField(blank=True, choices=[('3D', 'Credit/Debit Card'), ('USRPWD', 'Wallet/Net Banking')], help_text='Required If PAYMENT_MODE_ONLY = YES, then For Credit/Debit card - 3D For Wallet, Net Banking – USRPWD', max_length=10, null=True, verbose_name='Auth Mode')),
                ('payment_type_id', models.CharField(blank=True, choices=[('CC', 'Credit Card'), ('DC', 'Debit Card'), ('NB', 'Net Banking'), ('UPI', 'UPI'), ('PPI', 'PayTM Wallet')], help_text='Required If PAYMENT_MODE_ONLY = Yes | CC/DC/NB/UPI/PPI/EMI', max_length=15, null=True, verbose_name='Payment Type ID')),
                ('bank_code', models.CharField(blank=True, help_text='Required If PAYMENT_MODE_ONLY = Yes PAYMENT_TYPE_ID = NB ', max_length=5, null=True, verbose_name='Bank Code')),
                ('mkey', models.CharField(max_length=32, validators=[drf_paytm.utils.validate_key], verbose_name='Merchant Key')),
                ('created_by', models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, to=settings.AUTH_USER_MODEL)),
            ],
            options={
                'verbose_name': 'Transaction Request',
                'verbose_name_plural': 'Transaction Requests',
            },
        ),
        migrations.CreateModel(
            name='TransactionResponse',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('mid', models.CharField(max_length=20, verbose_name='Merchant ID')),
                ('tid', models.CharField(blank=True, max_length=64, null=True, verbose_name='Transaction ID')),
                ('cid', models.CharField(blank=True, max_length=64, null=True, verbose_name='Customer ID')),
                ('oid', models.CharField(max_length=50, verbose_name='Order ID')),
                ('bnkid', models.TextField(blank=True, null=True, verbose_name='Bank Transaction ID')),
                ('amount', models.DecimalField(decimal_places=3, max_digits=15, verbose_name='Amount')),
                ('currency', models.CharField(default='INR', max_length=3, verbose_name='Currency')),
                ('status', models.CharField(choices=[('TXN_SUCCESS', 'Success'), ('TXN_FAILURE', 'Failed'), ('PENDING', 'Pending')], max_length=20, verbose_name='Status')),
                ('code', models.CharField(max_length=10, verbose_name='Response Code')),
                ('message', models.CharField(max_length=500, verbose_name='Response Message')),
                ('timestamp', models.DateTimeField(blank=True, null=True, verbose_name='Transaction Date Time')),
                ('gateway', models.CharField(blank=True, max_length=15, null=True, verbose_name='Gateway')),
                ('bank', models.CharField(blank=True, max_length=500, null=True, verbose_name='Bank Name')),
                ('mode', models.CharField(blank=True, choices=[('CC', 'Credit Card'), ('DC', 'Debit Card'), ('NB', 'Net Banking'), ('UPI', 'UPI'), ('PPI', 'PayTM Wallet')], max_length=15, null=True, verbose_name='Mode of Payment')),
                ('checksum', models.CharField(max_length=108, verbose_name='Checksum Hash')),
                ('bin_number', models.CharField(blank=True, max_length=6, null=True, verbose_name='Starting 6 Digit Number of Card')),
                ('card_last_num', models.CharField(blank=True, max_length=4, null=True, verbose_name='Last 4 digit of Card')),
                ('raw_response', models.TextField(verbose_name='Raw Response')),
                ('t_request', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.PROTECT, to='drf_paytm.TransactionRequest', verbose_name='Transaction Request')),
            ],
            options={
                'verbose_name': 'Transaction Response',
                'verbose_name_plural': 'Transaction Responses',
            },
        ),
    ]
