You are here

function paypal_payment_ipn_schema in PayPal for Payment 7

Implements hook_schema().

See also

PayPalPaymentIPN

File

paypal_payment_ipn/paypal_payment_ipn.install, line 13
Contains installation and uninstallation functions.

Code

function paypal_payment_ipn_schema() {
  $schema['paypal_payment_ipn'] = array(
    'description' => 'Stores processed IPNs.',
    'fields' => array(
      'psiid' => array(
        'description' => 'The payment status item ID this row refers to.',
        'type' => 'int',
        'unsigned' => TRUE,
        'not null' => TRUE,
      ),
      'pid' => array(
        'description' => 'The PID of the Payment this IPN is for.',
        'type' => 'int',
        'unsigned' => TRUE,
        'not null' => TRUE,
        'default' => 0,
      ),
      'txn_id' => array(
        'description' => 'The PayPal transaction ID.',
        'type' => 'varchar',
        'length' => 255,
        'not null' => TRUE,
        'default' => '',
      ),
    ),
    'primary key' => array(
      'psiid',
    ),
    'indexes' => array(
      'txn_id' => array(
        'txn_id',
      ),
    ),
    'foreign keys' => array(
      'pid' => array(
        'table' => 'payment',
        'columns' => array(
          'pid' => 'pid',
        ),
      ),
      'psiid' => array(
        'table' => 'payment_status_item',
        'columns' => array(
          'psiid' => 'psiid',
        ),
      ),
    ),
  );
  return $schema;
}