Skip to content

Commit f7721ce

Browse files
committed
Delete previous order to initiate new order.
1 parent 1a3b4a1 commit f7721ce

2 files changed

Lines changed: 441 additions & 0 deletions

File tree

class.pmprogateway_paystack.php

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -735,6 +735,13 @@ function cancel(&$order) {
735735
global $wpdb;
736736
$wpdb->query("DELETE FROM $wpdb->pmpro_membership_orders WHERE id = '" . $order->id . "'");
737737
}
738+
function delete(&$order) {
739+
740+
//no matter what happens below, we're going to cancel the order in our system
741+
$order->updateStatus("cancelled");
742+
global $wpdb;
743+
$wpdb->query("DELETE FROM $wpdb->pmpro_membership_orders WHERE id = '" . $order->id . "'");
744+
}
738745
}
739746
}
740747
}

0 commit comments

Comments
 (0)