Skip to content

Commit

Permalink
Merge pull request #363 from krokedil/develop-ajax-order
Browse files Browse the repository at this point in the history
Prevent further order processing once processed once
  • Loading branch information
MichaelBengtsson committed Nov 21, 2023
2 parents 4984fbf + 932a524 commit 5ee605b
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions classes/class-kp-ajax.php
Expand Up @@ -55,6 +55,12 @@ public static function kp_wc_place_order() {
}

$order = wc_get_order( $order_id );

// Prevent further processing if the order has already been processed once.
if ( ! empty( $order->get_date_paid() ) ) {
wp_send_json_success( $order->get_checkout_order_received_url() );
}

$recurring_token = false;

if ( KP_Subscription::order_has_subscription( $order ) ) {
Expand Down

0 comments on commit 5ee605b

Please sign in to comment.