function pay_node_pay_transaction_create in Pay 7
Same name and namespace in other branches
- 6 modules/pay_node/pay_node.module \pay_node_pay_transaction_create()
Implements hook_pay_transaction_create().
File
- modules/pay_node/ pay_node.module, line 225 
Code
function pay_node_pay_transaction_create(&$transaction, $values = array()) {
  if (isset($values['pay_node_nid']) && ($nid = $values['pay_node_nid'])) {
    // Verify that this node actually has a pay form and is the correct one.
    if (!($pay_form = pay_node_form_load($nid))) {
      return;
    }
    if ($pay_form->pfid != $transaction->pfid) {
      return;
    }
    // Store a relationship between the transaction and the node it came from.
    $record = array(
      'nid' => $nid,
      'pxid' => $transaction->pxid,
    );
    drupal_write_record('pay_transaction_node', $record);
  }
}