@@ 57-72 (lines=16) @@ | ||
54 | // Record the pending payment |
|
55 | $payment = give_insert_payment( $payment_data ); |
|
56 | ||
57 | if ( $payment ) { |
|
58 | give_update_payment_status( $payment, 'publish' ); |
|
59 | give_send_to_success_page(); |
|
60 | } else { |
|
61 | give_record_gateway_error( |
|
62 | esc_html__( 'Payment Error', 'give' ), |
|
63 | sprintf( |
|
64 | /* translators: %s: payment data */ |
|
65 | esc_html__( 'The payment creation failed while processing a manual (free or test) donation. Payment data: %s', 'give' ), |
|
66 | json_encode( $payment_data ) |
|
67 | ), |
|
68 | $payment |
|
69 | ); |
|
70 | // If errors are present, send the user back to the donation page so they can be corrected |
|
71 | give_send_back_to_checkout( '?payment-mode=' . $purchase_data['post_data']['give-gateway'] ); |
|
72 | } |
|
73 | } |
|
74 | ||
75 | add_action( 'give_gateway_manual', 'give_manual_payment' ); |
@@ 300-308 (lines=9) @@ | ||
297 | } |
|
298 | ||
299 | // Verify payment currency. |
|
300 | if ( $currency_code !== strtolower( $payment_meta['currency'] ) ) { |
|
301 | ||
302 | give_record_gateway_error( __( 'IPN Error', 'give' ), sprintf( /* translators: %s: Paypal IPN response */ |
|
303 | __( 'Invalid currency in IPN response. IPN data: %s', 'give' ), json_encode( $data ) ), $payment_id ); |
|
304 | give_update_payment_status( $payment_id, 'failed' ); |
|
305 | give_insert_payment_note( $payment_id, __( 'Payment failed due to invalid currency in PayPal IPN.', 'give' ) ); |
|
306 | ||
307 | return; |
|
308 | } |
|
309 | ||
310 | // Process refunds & reversed. |
|
311 | if ( 'refunded' === $payment_status || 'reversed' === $payment_status ) { |