Skip to content

Commit

Permalink
Merge branch 'bug/gateway-configuration' into v1.1.2
Browse files Browse the repository at this point in the history
  • Loading branch information
apetrovici committed Sep 16, 2021
2 parents 36d2353 + 51b5aff commit a984382
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/Gateways/GpApiGateway.php
Original file line number Diff line number Diff line change
Expand Up @@ -227,8 +227,8 @@ public function woocommerce_globalpayments_gpapi_settings( $settings ) {
echo '<div id="message" class="notice notice-error is-dismissible"><p><strong>' . __( 'Please provide Live Credentials. Gateway not enabled.' ) . '</strong></p></div>';
});
$settings['enabled'] = 'no';
return $settings;
}
return $settings;
}
if ( empty( $settings['sandbox_app_id'] ) || empty( $settings['sandbox_app_key'] ) ) {
add_action( 'admin_notices', function() {
Expand Down
5 changes: 4 additions & 1 deletion src/Gateways/TransitGateway.php
Original file line number Diff line number Diff line change
Expand Up @@ -234,10 +234,13 @@ public function process_admin_options() {
$settings = get_option( $option_name );

$prefix = ( wc_string_to_bool( $settings['is_production'] ) ) ? '' : 'sandbox_';
if ( empty( $settings[$prefix . 'transaction_key'] ) && ! empty( $settings[$prefix . 'user_id'] ) && ! empty( $settings[$prefix . 'password'] ) ) {
if ( ! empty( $settings[$prefix . 'user_id'] ) && ! empty( $settings[$prefix . 'password'] ) ) {
try {

$this->configure_merchant_settings();
$settings[$prefix . 'transaction_key'] = $this->create_transaction_key();
} catch ( \Exception $e ) {
$settings[$prefix . 'transaction_key'] = '';
add_action( 'admin_notices', function() {
echo '<div id="message" class="notice notice-error is-dismissible"><p><strong>' . __( 'Invalid MultiPass User ID or Password. Please try again.' ) . '</strong></p></div>';
});
Expand Down

0 comments on commit a984382

Please sign in to comment.