You are here

function uc_paypal_schema in Ubercart 6.2

Same name and namespace in other branches
  1. 8.4 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 33
Installation file for PayPal, primarily for the logging of IPNs.

Code

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