Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 18 additions & 0 deletions includes/admin/class-wc-rest-stripe-settings-controller.php
Original file line number Diff line number Diff line change
Expand Up @@ -293,9 +293,27 @@ public function update_settings( WP_REST_Request $request ) {
$this->update_is_debug_log_enabled( $request );
$this->update_oc_settings( $request );

$this->maybe_onboard_with_transact();

return new WP_REST_Response( [], 200 );
}

/**
* Maybe onboard with the Transact Platform.
*
* @return void
*/
public function maybe_onboard_with_transact() {
wc_get_logger()->info( 'maybe_onboard_with_transact' );
// Do not run if Stripe is not enabled.
if ( 'yes' !== $this->gateway->enabled ) {
return;
}

$transact_account_manager = WC_Stripe_Transact_Account_Manager::get_instance( $this->gateway );
$transact_account_manager->do_onboarding();
}

/**
* Returns the payment method IDs to enable.
*
Expand Down
Loading
Loading