Skip to content

Instantly share code, notes, and snippets.

@sidharrell
sidharrell / gist:7087307
Last active December 26, 2015 03:39
for laggy paypal ipn messaging, set attendee payment status to "Pending"
// replaces line 24 of gateways/paypal/paypal_ipn.php
if (empty($_POST['ipn_track_id']) && ($_POST['payment_status'] == 'Completed' || $_POST['payment_status'] == 'Pending')) {
$payment_data['txn_details'] = serialize($_POST);
$payment_data['txn_id'] = $_POST['txn_id'];
$payment_data['payment_status'] = 'Pending';
} elseif ($myPaypal->validateIpn()) {
// replaces line 12 on gateways/paypal/init.php, to add the second line in
add_filter('filter_hook_espresso_transactions_get_payment_data', 'espresso_process_paypal');
add_filter('filter_hook_espresso_thank_you_get_payment_data', 'espresso_process_paypal');
@joshfeck
joshfeck / remove_paypal.php
Created September 30, 2013 19:24
This will make it so that the PayPal button does not display when registering for a specific event. In this example, the event ID is 74. You'll need to swap in your event ID that you don't want the PayPal button to appear for.
<?php
function htrappfae_remove_paypal_from_event($payment_data) {
extract( $payment_data );
if ( $event_id==74 ) { //check to see if this is the event with the ID of #74
remove_action( 'action_hook_espresso_display_offsite_payment_gateway', 'espresso_display_paypal' );
}
}
add_action ( 'action_hook_espresso_display_offsite_payment_gateway', 'htrappfae_remove_paypal_from_event', 9 );