|
@@ 535-544 (lines=10) @@
|
| 532 |
|
return $invoice->get_transaction_id(); |
| 533 |
|
} |
| 534 |
|
|
| 535 |
|
function wpinv_get_id_by_transaction_id( $key ) { |
| 536 |
|
global $wpdb; |
| 537 |
|
|
| 538 |
|
$invoice_id = $wpdb->get_var( $wpdb->prepare( "SELECT post_id FROM $wpdb->postmeta WHERE meta_key = '_wpinv_transaction_id' AND meta_value = %s LIMIT 1", $key ) ); |
| 539 |
|
|
| 540 |
|
if ( $invoice_id != NULL ) |
| 541 |
|
return $invoice_id; |
| 542 |
|
|
| 543 |
|
return 0; |
| 544 |
|
} |
| 545 |
|
|
| 546 |
|
function wpinv_get_invoice_meta( $invoice_id = 0, $meta_key = '_wpinv_payment_meta', $single = true ) { |
| 547 |
|
$invoice = new WPInv_Invoice( $invoice_id ); |
|
@@ 1906-1915 (lines=10) @@
|
| 1903 |
|
return $display; |
| 1904 |
|
} |
| 1905 |
|
|
| 1906 |
|
function wpinv_get_invoice_id_by_key( $key ) { |
| 1907 |
|
global $wpdb; |
| 1908 |
|
|
| 1909 |
|
$invoice_id = $wpdb->get_var( $wpdb->prepare( "SELECT post_id FROM $wpdb->postmeta WHERE meta_key = '_wpinv_key' AND meta_value = %s LIMIT 1", $key ) ); |
| 1910 |
|
|
| 1911 |
|
if ( $invoice_id != NULL ) |
| 1912 |
|
return $invoice_id; |
| 1913 |
|
|
| 1914 |
|
return 0; |
| 1915 |
|
} |
| 1916 |
|
|
| 1917 |
|
function wpinv_can_view_receipt( $invoice_key = '' ) { |
| 1918 |
|
$return = false; |