-
Notifications
You must be signed in to change notification settings - Fork 69
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add Affiliate for WooCommerce support on WooPay (#7291)
- Loading branch information
1 parent
5426408
commit cbcb806
Showing
5 changed files
with
71 additions
and
16 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
Significance: patch | ||
Type: fix | ||
|
||
Add Affiliate for WooCommerce support on WooPay. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -155,7 +155,7 @@ public function test_get_user_id_from_cart_token_with_verified_user_store_api_to | |
$this->assertEquals( WooPay_Session::get_user_id_from_cart_token(), $verified_user->ID ); | ||
} | ||
|
||
public function test_remove_order_customer_id_on_requests_with_verified_email_with_verified_user_store_api_token_without_adapted_extensions() { | ||
public function test_woopay_order_payment_status_changed_with_verified_user_store_api_token_without_adapted_extensions() { | ||
$verified_user = self::factory()->user->create_and_get(); | ||
|
||
$woopay_store_api_token = WooPay_Store_Api_Token::init(); | ||
|
@@ -167,14 +167,14 @@ public function test_remove_order_customer_id_on_requests_with_verified_email_wi | |
$order = \WC_Helper_Order::create_order( $verified_user->ID ); | ||
$order->set_billing_email( $verified_user->user_email ); | ||
$order->save(); | ||
WooPay_Session::remove_order_customer_id_on_requests_with_verified_email( $order->get_Id() ); | ||
WooPay_Session::woopay_order_payment_status_changed( $order->get_Id() ); | ||
|
||
$updated_order = wc_get_order( $order->get_id() ); | ||
$this->assertEmpty( $updated_order->get_meta( 'woopay_merchant_customer_id' ) ); | ||
$this->assertEquals( $updated_order->get_customer_id(), $verified_user->ID ); | ||
} | ||
|
||
public function test_remove_order_customer_id_on_requests_with_verified_email_with_verified_user_store_api_token_with_non_matching_order_billing_email() { | ||
public function test_woopay_order_payment_status_changed_with_verified_user_store_api_token_with_non_matching_order_billing_email() { | ||
$verified_user = self::factory()->user->create_and_get(); | ||
|
||
$woopay_store_api_token = WooPay_Store_Api_Token::init(); | ||
|
@@ -188,14 +188,14 @@ public function test_remove_order_customer_id_on_requests_with_verified_email_wi | |
$order = \WC_Helper_Order::create_order( $verified_user->ID ); | ||
$order->set_billing_email( '[email protected]' ); | ||
$order->save(); | ||
WooPay_Session::remove_order_customer_id_on_requests_with_verified_email( $order->get_id() ); | ||
WooPay_Session::woopay_order_payment_status_changed( $order->get_id() ); | ||
|
||
$updated_order = wc_get_order( $order->get_id() ); | ||
$this->assertEmpty( $updated_order->get_meta( 'woopay_merchant_customer_id' ) ); | ||
$this->assertEquals( $updated_order->get_customer_id(), $verified_user->ID ); | ||
} | ||
|
||
public function test_remove_order_customer_id_on_requests_with_verified_email_with_verified_user_store_api_token() { | ||
public function test_woopay_order_payment_status_changed_with_verified_user_store_api_token() { | ||
$verified_user = self::factory()->user->create_and_get(); | ||
|
||
$woopay_store_api_token = WooPay_Store_Api_Token::init(); | ||
|
@@ -209,7 +209,7 @@ public function test_remove_order_customer_id_on_requests_with_verified_email_wi | |
$order = \WC_Helper_Order::create_order( $verified_user->ID ); | ||
$order->set_billing_email( $verified_user->user_email ); | ||
$order->save(); | ||
WooPay_Session::remove_order_customer_id_on_requests_with_verified_email( $order->get_id() ); | ||
WooPay_Session::woopay_order_payment_status_changed( $order->get_id() ); | ||
|
||
$updated_order = wc_get_order( $order->get_id() ); | ||
$this->assertEquals( $updated_order->get_meta( 'woopay_merchant_customer_id' ), $verified_user->ID ); | ||
|