You are here

function uc_paypal_schema in Ubercart 8.4

Same name and namespace in other branches
  1. 6.2 payment/uc_paypal/uc_paypal.install \uc_paypal_schema()
  2. 7.3 payment/uc_paypal/uc_paypal.install \uc_paypal_schema()

Implements hook_schema().

File

payment/uc_paypal/uc_paypal.install, line 11
Install, update and uninstall functions for the uc_paypal module.

Code

function uc_paypal_schema() {
  $schema = [];
  $schema['uc_payment_paypal_ipn'] = [
    'description' => 'Logs PayPal Instant Payment Notifications.',
    'fields' => [
      'order_id' => [
        'description' => 'The order ID.',
        'type' => 'int',
        'unsigned' => TRUE,
        'not null' => TRUE,
        'default' => 0,
      ],
      'txn_id' => [
        'description' => 'The transaction ID from PayPal.',
        'type' => 'varchar',
        'length' => 255,
        'not null' => TRUE,
        'default' => '',
      ],
      'txn_type' => [
        'description' => 'The transaction type from PayPal.',
        'type' => 'varchar',
        'length' => 255,
        'not null' => TRUE,
        'default' => '',
      ],
      'mc_gross' => [
        'description' => 'The payment amount from PayPal.',
        'type' => 'varchar',
        'length' => 255,
        'not null' => TRUE,
        'default' => '',
      ],
      'status' => [
        'description' => 'The IPN status from PayPal.',
        'type' => 'varchar',
        'length' => 255,
        'not null' => TRUE,
        'default' => '',
      ],
      'receiver_email' => [
        'description' => 'The e-mail address of the PayPal account.',
        'type' => 'varchar',
        'length' => 255,
        'not null' => TRUE,
        'default' => '',
      ],
      'payer_email' => [
        'description' => 'The e-mail address of the buyer.',
        'type' => 'varchar',
        'length' => 255,
        'not null' => TRUE,
        'default' => '',
      ],
      'received' => [
        'description' => 'The IPN receipt timestamp.',
        'type' => 'int',
        'unsigned' => TRUE,
        'not null' => TRUE,
        'default' => 0,
      ],
    ],
    'indexes' => [
      'order_id' => [
        'order_id',
      ],
    ],
    'foreign keys' => [
      'uc_orders' => [
        'table' => 'uc_orders',
        'columns' => [
          'order_id' => 'order_id',
        ],
      ],
    ],
  ];
  return $schema;
}