Merge pull request #6382 from mgiulio/wc_get_order

Use wc_get_order in simplify-commerce
This commit is contained in:
Mike Jolley 2014-09-26 11:21:09 +03:00
commit 7427acd9f3
2 changed files with 3 additions and 3 deletions

View File

@ -40,7 +40,7 @@ class WC_Addons_Gateway_Simplify_Commerce extends WC_Gateway_Simplify_Commerce {
* @return array * @return array
*/ */
public function process_subscription( $order_id ) { public function process_subscription( $order_id ) {
$order = new WC_Order( $order_id ); $order = wc_get_order( $order_id );
$token = isset( $_POST['simplify_token'] ) ? wc_clean( $_POST['simplify_token'] ) : ''; $token = isset( $_POST['simplify_token'] ) ? wc_clean( $_POST['simplify_token'] ) : '';
try { try {
@ -118,7 +118,7 @@ class WC_Addons_Gateway_Simplify_Commerce extends WC_Gateway_Simplify_Commerce {
*/ */
public function process_pre_order( $order_id ) { public function process_pre_order( $order_id ) {
if ( WC_Pre_Orders_Order::order_requires_payment_tokenization( $order_id ) ) { if ( WC_Pre_Orders_Order::order_requires_payment_tokenization( $order_id ) ) {
$order = new WC_Order( $order_id ); $order = wc_get_order( $order_id );
$token = isset( $_POST['simplify_token'] ) ? wc_clean( $_POST['simplify_token'] ) : ''; $token = isset( $_POST['simplify_token'] ) ? wc_clean( $_POST['simplify_token'] ) : '';
try { try {

View File

@ -269,7 +269,7 @@ class WC_Gateway_Simplify_Commerce extends WC_Payment_Gateway {
* @param integer $order_id * @param integer $order_id
*/ */
public function process_payment( $order_id ) { public function process_payment( $order_id ) {
$order = new WC_Order( $order_id ); $order = wc_get_order( $order_id );
$token = isset( $_POST['simplify_token'] ) ? wc_clean( $_POST['simplify_token'] ) : ''; $token = isset( $_POST['simplify_token'] ) ? wc_clean( $_POST['simplify_token'] ) : '';
try { try {