Skip to content

Commit

Permalink
Merge pull request #6 from yaser24276/master
Browse files Browse the repository at this point in the history
prevent order id duplication
  • Loading branch information
max2u committed Sep 2, 2018
2 parents aebf6f8 + 7de60a6 commit a78ccd0
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,12 @@ public function getSessionOrderId()
{
return WC()->session->get('order_awaiting_payment');
}

public function clearSessionCurrentOrder()
{
return WC()->session->__unset('order_awaiting_payment');
}


public function getOrderId()
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,7 @@ public function getPaymentRequestForm()
wc_add_notice( sprintf( __( 'Failed to process payment please try again later', 'error' )));
$actionUrl = get_site_url().'/index.php/checkout';
}
$this->pfOrder->clearSessionCurrentOrder();
$form = '<form style="display:none" name="frm_pointcheckout_payment" id="frm_pointcheckout_payment" method="GET" action="' . $actionUrl . '">';
$form .= '<input type="submit">';
return $form;
Expand Down

0 comments on commit a78ccd0

Please sign in to comment.