Skip to content

Commit

Permalink
shuffle logic in loading function to check of `RCP_Payment_Gateway_St…
Browse files Browse the repository at this point in the history
…ripe_Elements` class
  • Loading branch information
mcfarlan committed Oct 4, 2017
1 parent 2e63892 commit b9308bc
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions rcp-stripe-elements.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
*/
function rcp_elements_register_stripe_elements_gateway( $gateways ) {
// Exit early if the stripe_elements gateway or class already exist
if ( isset( $gateways['stripe_elements'] ) || class_exists( 'RCP_Payment_Gateway_Stripe_Elements' ) ) {
if ( isset( $gateways['stripe_elements'] ) ) {
return $gateways;
}

Expand All @@ -37,8 +37,10 @@ function rcp_elements_register_stripe_elements_gateway( $gateways ) {
);

// Include RCP Stripe Elements Gateway
$path = trailingslashit( plugin_dir_path( __FILE__ ) );
require_once $path . 'class-rcp-payment-gateway-stripe-elements.php';
if ( ! class_exists( 'RCP_Payment_Gateway_Stripe_Elements' ) ) {
$path = trailingslashit( plugin_dir_path( __FILE__ ) );
require_once $path . 'class-rcp-payment-gateway-stripe-elements.php';
}

return $gateways;
}
Expand Down

0 comments on commit b9308bc

Please sign in to comment.