|
@@ 301-309 (lines=9) @@
|
| 298 |
|
} |
| 299 |
|
|
| 300 |
|
// Verify payment recipient. |
| 301 |
|
if ( strcasecmp( $business_email, trim( give_get_option( 'paypal_email' ) ) ) !== 0 ) { |
| 302 |
|
|
| 303 |
|
give_record_gateway_error( |
| 304 |
|
__( 'IPN Error', 'give' ), sprintf( /* translators: %s: Paypal IPN response */ |
| 305 |
|
__( 'Invalid business email in IPN response. IPN data: %s', 'give' ), json_encode( $data ) |
| 306 |
|
), $payment_id |
| 307 |
|
); |
| 308 |
|
give_update_payment_status( $payment_id, 'failed' ); |
| 309 |
|
give_insert_payment_note( $payment_id, __( 'Payment failed due to invalid PayPal business email.', 'give' ) ); |
| 310 |
|
|
| 311 |
|
return; |
| 312 |
|
} |
|
@@ 344-352 (lines=9) @@
|
| 341 |
|
$payment_amount = give_donation_amount( $payment_id ); |
| 342 |
|
|
| 343 |
|
// Check that the donation PP and local db amounts match. |
| 344 |
|
if ( number_format( (float) $paypal_amount, 2 ) < number_format( (float) $payment_amount, 2 ) ) { |
| 345 |
|
// The prices don't match |
| 346 |
|
give_record_gateway_error( |
| 347 |
|
__( 'IPN Error', 'give' ), sprintf( /* translators: %s: Paypal IPN response */ |
| 348 |
|
__( 'Invalid payment amount in IPN response. IPN data: %s', 'give' ), json_encode( $data ) |
| 349 |
|
), $payment_id |
| 350 |
|
); |
| 351 |
|
give_update_payment_status( $payment_id, 'failed' ); |
| 352 |
|
give_insert_payment_note( $payment_id, __( 'Payment failed due to invalid amount in PayPal IPN.', 'give' ) ); |
| 353 |
|
|
| 354 |
|
return; |
| 355 |
|
} |