|
@@ 289-297 (lines=9) @@
|
| 286 |
|
} |
| 287 |
|
|
| 288 |
|
// Verify payment recipient. |
| 289 |
|
if ( strcasecmp( $business_email, trim( give_get_option( 'paypal_email' ) ) ) !== 0 ) { |
| 290 |
|
|
| 291 |
|
give_record_gateway_error( __( 'IPN Error', 'give' ), sprintf( /* translators: %s: Paypal IPN response */ |
| 292 |
|
__( 'Invalid business email in IPN response. IPN data: %s', 'give' ), json_encode( $data ) ), $payment_id ); |
| 293 |
|
give_update_payment_status( $payment_id, 'failed' ); |
| 294 |
|
give_insert_payment_note( $payment_id, __( 'Payment failed due to invalid PayPal business email.', 'give' ) ); |
| 295 |
|
|
| 296 |
|
return; |
| 297 |
|
} |
| 298 |
|
|
| 299 |
|
// Verify payment currency. |
| 300 |
|
if ( $currency_code !== strtolower( $payment_meta['currency'] ) ) { |
|
@@ 326-334 (lines=9) @@
|
| 323 |
|
$payment_amount = give_donation_amount( $payment_id ); |
| 324 |
|
|
| 325 |
|
// Check that the donation PP and local db amounts match. |
| 326 |
|
if ( number_format( (float) $paypal_amount, 2 ) < number_format( (float) $payment_amount, 2 ) ) { |
| 327 |
|
// The prices don't match |
| 328 |
|
give_record_gateway_error( __( 'IPN Error', 'give' ), sprintf( /* translators: %s: Paypal IPN response */ |
| 329 |
|
__( 'Invalid payment amount in IPN response. IPN data: %s', 'give' ), json_encode( $data ) ), $payment_id ); |
| 330 |
|
give_update_payment_status( $payment_id, 'failed' ); |
| 331 |
|
give_insert_payment_note( $payment_id, __( 'Payment failed due to invalid amount in PayPal IPN.', 'give' ) ); |
| 332 |
|
|
| 333 |
|
return; |
| 334 |
|
} |
| 335 |
|
|
| 336 |
|
// Process completed donations. |
| 337 |
|
if ( 'completed' === $payment_status || give_is_test_mode() ) { |