@Rob-sortitoutsi "recurring_payment_suspended_due_to_max_failed_payment" started in August, I believe. We were also caught off guard as we were given no warning of this change, as we were given no warning with what this current thread is about (new subscription IDs). I can confirm also that the "old_subscr_id" only seems to be missing from this particular transaction type. I made a post here a few days ago panicking that it seemed to be gone entirely but I later confirmed it was just for this transaction type, although there were a few days in early November where there seemed to be some bugginess and there were other txn types with old_Subscr_id missing but only a few. Anyways, our Paypal integration is custom (I wrote it) and here is how I've mapped the new transaction types to the old ones, which we've had running since late August without issue (until the new "old_subscr_id" issue popped up recently, which I've also addressed in my code, which is also part of what's below). sanitize(), sub_get(), and sub_edit() are all internal functions but you can probably imagine what they do. This is PHP: # subscr_id - new txn_type value "recurring_payment_suspended_due_to_max_failed_payment", they send this instead of subscr_id, otherwise it's ALWAYS subscr_id. Thanks Paypal! $subscr_id = sanitize( ( $_POST['recurring_payment_id'] ? $_POST['recurring_payment_id'] : $_POST['subscr_id'] ), 'in' ); # old_subscr_id? Update our local subscr_id if it matches this. if( $_POST['old_subscr_id'] ) {
$old_subscr_id = sanitize( $_POST['old_subscr_id'], 'in' );
$sub = sub_get( array( "ext_subscription_id" => $old_subscr_id, "active" => 1 ));
if( $sub['id'] ) { # update subscription id
sub_edit( array( "id" => $sub['id'], 'ext_subscription_id' => $subscr_id ));
# update all old transactions with new subscr_id
$db['main']->query("update payments set ext_subscription_id='$subscr_id' where ext_subscription_id='$old_subscr_id'");
}
}
# Convert new "recurring billing" txn_type to old school subscription txn_type. $txn_type = sanitize( $_POST['txn_type'], 'in' );
if( in_array( $txn_type, array('recurring_payment_suspended_due_to_max_failed_payment', 'recurring_payment_suspended', 'recurring_payment_expired' ))) {
$txn_type = 'subscr_eot';
}
else if( $txn_type == 'recurring_payment_failed' ) {
$txn_type = 'subscr_failed';
}
else if( $txn_type == 'recurring_payment_profile_cancel' ) {
$txn_type = 'subscr_cancel';
}
else if( $txn_type == 'recurring_payment' ) {
$txn_type = 'subscr_payment';
}
else if( in_array( $txn_type, array('new_case', 'masspay', 'subscr_modify' ))) {
# ignore
exit;
}
... View more