diff --git a/.github/workflows/staging-build-and-deploy.yml b/.github/workflows/staging-build-and-deploy.yml index 0512586eac..c20a770035 100644 --- a/.github/workflows/staging-build-and-deploy.yml +++ b/.github/workflows/staging-build-and-deploy.yml @@ -3,7 +3,7 @@ name: Staging Build and Deploy on: push: branches: - - dev + - ecommerce-backend jobs: build: runs-on: ubuntu-latest @@ -23,6 +23,17 @@ jobs: - name: Install Composer run: sudo apt-get update && sudo apt-get install -y composer + - name: Install Composer Dependencies in Paypal Directory + run: composer install --no-dev --working-dir=./ecommerce/PaymentGateways/Paypal + + - name: Clone tutor-droip repository + run: | + if [ ! -d "tutor-droip" ]; then + git clone https://github.com/jshossen/tutor-droip.git tutor-droip + fi + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + - name: Extract version number id: get_version run: | @@ -56,4 +67,4 @@ jobs: ssh shewa@45.79.123.135 << 'EOF' rm -rf /var/www/html/subdomains/tutor-lms/wp-content/plugins/tutor unzip -o /var/www/html/subdomains/tutor-lms/wp-content/plugins/tutor-${{ env.VERSION_NUMBER }}.zip -d /var/www/html/subdomains/tutor-lms/wp-content/plugins - EOF \ No newline at end of file + EOF diff --git a/ecommerce/Ecommerce.php b/ecommerce/Ecommerce.php index 28af3025de..28ab6e64e4 100644 --- a/ecommerce/Ecommerce.php +++ b/ecommerce/Ecommerce.php @@ -152,10 +152,6 @@ public static function get_payment_gateway_object( string $gateway ) { */ public static function payment_gateways_with_ref( $gateway = null ) { $arr = array( - 'stripe' => array( - 'gateway_class' => StripeGateway::class, - 'config_class' => StripeConfig::class, - ), 'paypal' => array( 'gateway_class' => PaypalGateway::class, 'config_class' => PaypalConfig::class, diff --git a/ecommerce/PaymentGateways/Configs/StripeConfig.php b/ecommerce/PaymentGateways/Configs/StripeConfig.php deleted file mode 100644 index 2f622794c4..0000000000 --- a/ecommerce/PaymentGateways/Configs/StripeConfig.php +++ /dev/null @@ -1,96 +0,0 @@ -get_option( self::ENV_KEY, 'test' ); - } - - /** - * Retrieves the secret key for the Stripe payment gateway. - * - * @since 3.0.0 - * - * @return string The secret key. - */ - public function getSecretKey(): string { - return tutor_utils()->get_option( self::SECRET_KEY ); - } - - /** - * Retrieves the public key for the Stripe payment gateway. - * - * @since 3.0.0 - * - * @return string The public key. - */ - public function getPublicKey(): string { - return tutor_utils()->get_option( self::PUBLIC_KEY ); - } - - /** - * Retrieves the webhook key for the Stripe payment gateway. - * - * @since 3.0.0 - * - * @return string The public key. - */ - public function getWebhookSecretKey(): string { - return tutor_utils()->get_option( self::WEBHOOK_SIGNATURE_KEY ); - } - -} diff --git a/ecommerce/Settings.php b/ecommerce/Settings.php index 650c7f3544..33ff6a8db7 100644 --- a/ecommerce/Settings.php +++ b/ecommerce/Settings.php @@ -208,9 +208,10 @@ public static function add_ecommerce_settings( $fields ) { ), ); + $arr = apply_filters( 'tutor_after_ecommerce_settings', $arr ); $fields['monetization']['submenu'] = $arr; - return apply_filters( 'tutor_after_ecommerce_settings', $fields ); + return $fields; } /** @@ -414,7 +415,7 @@ function( $method ) use ( $method_id ) { * * @since 3.0.0 * - * @param array $settings Tutor settings. + * @param array $settings Ecommerce payment settings. * * @return array */ @@ -426,7 +427,7 @@ public static function add_payment_gateway_settings( $settings ): array { 'fields' => array(), ); - array_push( $settings['monetization']['submenu']['ecommerce_payment']['blocks'], $payment_gateway ); + array_push( $settings['ecommerce_payment']['blocks'], $payment_gateway ); foreach ( self::get_default_automate_payment_gateways() as $key => $gateway ) { @@ -446,7 +447,6 @@ public static function add_payment_gateway_settings( $settings ): array { 'label_title' => '', 'default' => 'off', /* translators: %s: gateway name */ - 'desc' => sprintf( __( 'Enable %s payment', 'tutor' ), $gateway['label'] ), 'toggle_fields' => implode( ',', array_keys( self::$config_keys_method() ) ), ), ); @@ -457,7 +457,7 @@ public static function add_payment_gateway_settings( $settings ): array { $new_gateway['fields'] = $fields; // Append new gateways inside ecommerce payment. - $settings['monetization']['submenu']['ecommerce_payment']['blocks'][] = $new_gateway; + $settings['ecommerce_payment']['blocks'][] = $new_gateway; } $settings = apply_filters( 'tutor_ecommerce_payment_settings', $settings ); @@ -467,7 +467,7 @@ public static function add_payment_gateway_settings( $settings ): array { 'action' => 'add_more_automate_payment_gateway', ); - array_push( $settings['monetization']['submenu']['ecommerce_payment']['blocks'], $add_more_gateway ); + array_push( $settings['ecommerce_payment']['blocks'], $add_more_gateway ); // Manual Payments. $manual_gateways = array( @@ -477,12 +477,12 @@ public static function add_payment_gateway_settings( $settings ): array { 'fields' => array(), ); - array_push( $settings['monetization']['submenu']['ecommerce_payment']['blocks'], $manual_gateways ); + array_push( $settings['ecommerce_payment']['blocks'], $manual_gateways ); $manual_gateways = self::get_manual_payment_setting_fields(); foreach ( $manual_gateways as $gateway ) { - array_push( $settings['monetization']['submenu']['ecommerce_payment']['blocks'], $gateway ); + array_push( $settings['ecommerce_payment']['blocks'], $gateway ); } $add_btn = array( @@ -490,7 +490,7 @@ public static function add_payment_gateway_settings( $settings ): array { 'action' => 'add_manual_payment_btn', ); - array_push( $settings['monetization']['submenu']['ecommerce_payment']['blocks'], $add_btn ); + array_push( $settings['ecommerce_payment']['blocks'], $add_btn ); return $settings; } @@ -595,23 +595,6 @@ public static function get_paypal_config_keys() { ); } - /** - * Get stripe config keys - * - * @since 3.0.0 - * - * @return array - */ - public static function get_stripe_config_keys() { - return array( - 'stripe_environment' => 'environment', - 'stripe_secret_key' => 'password', - 'stripe_public_key' => 'password', - 'stripe_webhook_signature_key' => 'password', - 'stripe_webhook_url' => 'webhook_url', - ); - } - /** * Get payment environments *