diff --git a/src/gateways/paypal.php b/src/gateways/paypal.php index cfc06616..d714cde4 100644 --- a/src/gateways/paypal.php +++ b/src/gateways/paypal.php @@ -105,17 +105,21 @@ function mt_paypal_ipn() { if ( ( $receiver && ( strtolower( $receiver_email ) != $receiver ) ) || $payment_currency != $options['mt_currency'] || false === $value_match ) { // Translators: Item Number of payment triggering error. if ( $price !== $value_match ) { + // Translators: price paid, price expected. $error_msg[] = sprintf( __( 'Price paid did not match the price expected: %1$s paid vs %2$s expected.', 'my-tickets' ), $price, $value_match ); } if ( strtolower( $receiver_email ) != $receiver ) { + // Translators: email provided by PayPal, email in My Tickets settings. $error_msg[] = sprintf( __( 'Receiver Email and PayPal Email did not match: %1$s vs %2$s. Please check that the email in your My Tickets settings matches the primary email in your PayPal account.', 'my-tickets' ), $receiver_email, $receiver ); } if ( $payment_currency != $options['mt_currency'] ) { + // Translators: currency received, currency expected. $error_msg[] = sprintf( __( 'Currency received did not match the currency expected: %1$s vs %2$s.', 'my-tickets' ), $payment_currency, $options['mt_currency'] ); } foreach ( $error_msg as $msg ) { $messages .= "\n\n" . $msg; } + // Translators: purchase ID. wp_mail( $options['mt_to'], __( 'Payment Conditions Error', 'my-tickets' ), sprintf( __( 'There were errors processing payment on purchase ID %s:', 'my-tickets' ), $item_number ) . $messages . "\n" . print_r( $data, 1 ) ); status_header( 200 ); // Why 200? Because that's the only way to stop PayPal. die; diff --git a/src/mt-cart.php b/src/mt-cart.php index 8b5df338..dfd54062 100644 --- a/src/mt-cart.php +++ b/src/mt-cart.php @@ -884,8 +884,8 @@ function mt_generate_cart_table( $cart, $format = 'cart' ) { } else { $hidden = ''; } - $total = $total + ( $price * $count ); - $custom = apply_filters( 'mt_show_in_cart_fields', '', $event_id ); + $total = $total + ( $price * $count ); + $custom = apply_filters( 'mt_show_in_cart_fields', '', $event_id ); // Translators: (number of tickets) at (price per ticket). $cart_message = sprintf( __( '%1$s at %2$s', 'my-tickets' ), "$count", $currency . apply_filters( 'mt_money_format', $price ) ); $output .= " diff --git a/src/mt-notifications.php b/src/mt-notifications.php index 312add47..83993dcf 100644 --- a/src/mt-notifications.php +++ b/src/mt-notifications.php @@ -133,16 +133,17 @@ function mt_format_purchase( $purchase, $format = false, $purchase_id = false ) $tickets_list = ''; foreach ( $tickets as $type => $ticket ) { if ( $ticket['count'] > 0 ) { - $price = $ticket['price']; - $type = apply_filters( 'mt_ticket_type_label', ucfirst( str_replace( '-', ' ', $type ) ) ); - $price = $price - $handling; - $discount = mt_calculate_discount( $price, $event_id, $purchase_id ); - $total = ( $discount !== $price ) ? $total + $discount * $ticket['count'] : $total + $price * $ticket['count']; - $display_app = ''; + $price = $ticket['price']; + $type = apply_filters( 'mt_ticket_type_label', ucfirst( str_replace( '-', ' ', $type ) ) ); + $price = $price - $handling; + $discount = mt_calculate_discount( $price, $event_id, $purchase_id ); + $total = ( $discount !== $price ) ? $total + $discount * $ticket['count'] : $total + $price * $ticket['count']; + $display_app = ''; // Match formats so comparison is valid. if ( sprintf( '%01.2f', $discount ) !== sprintf( '%01.2f', $price ) ) { // Translators: original ticket price, before discounts. - $discount = strip_tags( apply_filters( 'mt_money_format', $discount ) ); + $discount = strip_tags( apply_filters( 'mt_money_format', $discount ) ); + // Translators: discounted cost of ticket. $display_app = ' (' . sprintf( __( 'Discounted to %s', 'my-tickets' ), $discount ) . ')'; } $display_price = strip_tags( apply_filters( 'mt_money_format', $price ) ) . $display_app;