wpsc_update_payment_gateway_settings

Located in: ajax-and-init.php

Functions that call this hook: wpsc_gateway_settings()
Arguments Accepted: none
Version Introduced: 3.8

Description: This hook is triggered after WP-e-Commerce updates the gateway settings.

Code in context:
[php firstline=”1179″ highlight=”1214″]
//change the gateway settings
function wpsc_gateway_settings() {
//To update options
if ( isset( $_POST[‘wpsc_options’] ) ) {
foreach ( $_POST[‘wpsc_options’] as $key => $value ) {
if ( $value != get_option( $key ) ) {
update_option( $key, $value );
}
}
unset( $_POST[‘wpsc_options’] );
}

if ( isset( $_POST[‘user_defined_name’] ) && is_array( $_POST[‘user_defined_name’] ) ) {
$payment_gateway_names = get_option( ‘payment_gateway_names’ );

if ( !is_array( $payment_gateway_names ) ) {
$payment_gateway_names = array( );
}
$payment_gateway_names = array_merge( $payment_gateway_names, (array)$_POST[‘user_defined_name’] );
update_option( ‘payment_gateway_names’, $payment_gateway_names );
}
$custom_gateways = get_option( ‘custom_gateway_options’ );

$nzshpcrt_gateways = nzshpcrt_get_gateways();
foreach ( $nzshpcrt_gateways as $gateway ) {
if ( in_array( $gateway[‘internalname’], $custom_gateways ) ) {
if ( isset( $gateway[‘submit_function’] ) ) {
call_user_func_array( $gateway[‘submit_function’], array( ) );
$changes_made = true;
}
}
}
if ( (isset( $_POST[‘payment_gw’] ) && $_POST[‘payment_gw’] != null ) ) {
update_option( ‘payment_gateway’, $_POST[‘payment_gw’] );
}

do_action( ‘wpsc_update_payment_gateway_settings’ );
}

}
[/php]