mirror of
https://github.com/woocommerce/woocommerce-paypal-payments.git
synced 2025-09-01 07:02:48 +08:00
✨ Update REST endpoint to store new attributes
This commit is contained in:
parent
e2b2660264
commit
7592938487
1 changed files with 10 additions and 2 deletions
|
@ -97,8 +97,10 @@ class OnboardingRestEndpoint extends RestEndpoint {
|
|||
|
||||
$get_param = fn( $key ) => wc_clean( wp_unslash( $request->get_param( $key ) ) );
|
||||
|
||||
$raw_step = $get_param( 'step' );
|
||||
$raw_completed = $get_param( 'completed' );
|
||||
$raw_step = $get_param( 'step' );
|
||||
$raw_completed = $get_param( 'completed' );
|
||||
$raw_use_sandbox = $get_param( 'useSandbox' );
|
||||
$raw_use_manual_connection = $get_param( 'useManualConnection' );
|
||||
|
||||
if ( is_numeric( $raw_step ) ) {
|
||||
$details['step'] = intval( $raw_step );
|
||||
|
@ -106,6 +108,12 @@ class OnboardingRestEndpoint extends RestEndpoint {
|
|||
if ( null !== $raw_completed ) {
|
||||
$details['completed'] = (bool) $raw_completed;
|
||||
}
|
||||
if ( null !== $raw_use_sandbox ) {
|
||||
$details['useSandbox'] = (bool) $raw_use_sandbox;
|
||||
}
|
||||
if ( null !== $raw_use_manual_connection ) {
|
||||
$details['useManualConnection'] = (bool) $raw_use_manual_connection;
|
||||
}
|
||||
|
||||
$this->profile->save_data( $details );
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue