Skip to content

Commit

Permalink
Remove unnecessary creation of tokens
Browse files Browse the repository at this point in the history
  • Loading branch information
a-danae committed Jul 10, 2024
1 parent 8e6f31f commit 6fb14b5
Showing 1 changed file with 4 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -254,17 +254,11 @@ function ( $id ) {
}
);

$ids_to_migrate = $this->get_subs_ids_to_migrate();
$subscription_id = $ids_to_migrate[0];
$subscription = new WC_Subscription( $subscription_id );
$customer_id = $subscription->get_user_id();

// Create the legacy token associated with the subscription.
$ids_to_migrate = $this->get_subs_ids_to_migrate();
$subscription_id = $ids_to_migrate[0];
$subscription = new WC_Subscription( $subscription_id );
$customer_id = $subscription->get_user_id();
$original_source_id = $subscription->get_meta( self::SOURCE_ID_META_KEY );
$original_token = WC_Helper_Token::create_sepa_token( $original_source_id, $customer_id, $this->legacy_sepa_gateway_id );

// Create the updated token we expect the subscription to be updated with.
$updated_token = WC_Helper_Token::create_sepa_token( $original_source_id, $customer_id, $this->updated_sepa_gateway_id );

$this->logger_mock
->expects( $this->at( 0 ) )
Expand Down

0 comments on commit 6fb14b5

Please sign in to comment.