HEX
Server: Apache
System: Linux WWW 6.1.0-40-amd64 #1 SMP PREEMPT_DYNAMIC Debian 6.1.153-1 (2025-09-20) x86_64
User: web11 (1011)
PHP: 8.2.29
Disabled: NONE
Upload Files
File: /var/www/biblioteka/wp-content/plugins/form-maker/admin/models/FMPaypalInfo.php
<?php

/**
 * Class FMModelPaypal_info
 */
class FMModelPaypal_info extends FMAdminModel {
  /**
   * Get form session.
   *
   * @param int $id
   *
   * @return object $row
   */
  public function get_form_session( $id = 0 ) {
    global $wpdb;
    $row = $wpdb->get_row($wpdb->prepare('SELECT * FROM ' . $wpdb->prefix . 'formmaker_sessions WHERE group_id=%d', $id));
    $stripe_transaction = $this->get_stripe_transaction_id($id);
    if ( !empty($stripe_transaction) ) {
      $row->transaction_id = $stripe_transaction->transaction_id;
    }

    return $row;
  }

  /**
   * Get stripe transaction id.
   *
   * @param int $id
   *
   * @return array|object|void|null
   */
  public function get_stripe_transaction_id( $id = 0 ) {
    global $wpdb;
    $row = $wpdb->get_row($wpdb->prepare('SELECT element_value AS transaction_id FROM ' . $wpdb->prefix . 'formmaker_submits WHERE element_label = %s AND group_id=%d', 'stripeToken', $id));

    return $row;
  }
}