mirror of
https://github.com/woocommerce/woocommerce-paypal-payments.git
synced 2025-08-30 05:00:51 +08:00
change credentials, endpoint urls, plugin url, js sdk date
This commit is contained in:
parent
04da406447
commit
2996bdbe8b
6 changed files with 32 additions and 19 deletions
|
@ -40,11 +40,8 @@ return array(
|
||||||
* @var Environment $env
|
* @var Environment $env
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/**
|
|
||||||
* ToDo: Add production platform client Id.
|
|
||||||
*/
|
|
||||||
return $env->current_environment_is( Environment::SANDBOX ) ?
|
return $env->current_environment_is( Environment::SANDBOX ) ?
|
||||||
'AQB97CzMsd58-It1vxbcDAGvMuXNCXRD9le_XUaMlHB_U7XsU9IiItBwGQOtZv9sEeD6xs2vlIrL4NiD' : '';
|
CONNECT_WOO_SANDBOX_CLIENT_ID : CONNECT_WOO_CLIENT_ID;
|
||||||
},
|
},
|
||||||
'button.smart-button' => static function ( $container ): SmartButtonInterface {
|
'button.smart-button' => static function ( $container ): SmartButtonInterface {
|
||||||
|
|
||||||
|
|
|
@ -155,7 +155,6 @@ const disconnect = (event) => {
|
||||||
element.value = '';
|
element.value = '';
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
|
|
||||||
document.querySelector('.woocommerce-save-button').click();
|
document.querySelector('.woocommerce-save-button').click();
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
@ -32,7 +32,6 @@ return array(
|
||||||
if ( $state->current_state() >= State::STATE_ONBOARDED ) {
|
if ( $state->current_state() >= State::STATE_ONBOARDED ) {
|
||||||
return PAYPAL_SANDBOX_API_URL;
|
return PAYPAL_SANDBOX_API_URL;
|
||||||
}
|
}
|
||||||
// ToDo: Real connect.woocommerce.com sandbox link.
|
|
||||||
return CONNECT_WOO_SANDBOX_URL;
|
return CONNECT_WOO_SANDBOX_URL;
|
||||||
},
|
},
|
||||||
'api.production-host' => static function ( $container ): string {
|
'api.production-host' => static function ( $container ): string {
|
||||||
|
@ -68,6 +67,12 @@ return array(
|
||||||
'api.paypal-host-sandbox' => static function( $container ) : string {
|
'api.paypal-host-sandbox' => static function( $container ) : string {
|
||||||
return PAYPAL_SANDBOX_API_URL;
|
return PAYPAL_SANDBOX_API_URL;
|
||||||
},
|
},
|
||||||
|
'api.partner_merchant_id-production' => static function( $container ) : string {
|
||||||
|
return CONNECT_WOO_MERCHANT_ID;
|
||||||
|
},
|
||||||
|
'api.partner_merchant_id-sandbox' => static function( $container ) : string {
|
||||||
|
return CONNECT_WOO_SANDBOX_MERCHANT_ID;
|
||||||
|
},
|
||||||
'api.paypal-host' => function( $container ) : string {
|
'api.paypal-host' => function( $container ) : string {
|
||||||
$environment = $container->get( 'onboarding.environment' );
|
$environment = $container->get( 'onboarding.environment' );
|
||||||
/**
|
/**
|
||||||
|
@ -140,7 +145,7 @@ return array(
|
||||||
$logger = $container->get( 'woocommerce.logger.woocommerce' );
|
$logger = $container->get( 'woocommerce.logger.woocommerce' );
|
||||||
return new LoginSeller(
|
return new LoginSeller(
|
||||||
$container->get( 'api.paypal-host-production' ),
|
$container->get( 'api.paypal-host-production' ),
|
||||||
$container->get( 'api.partner_merchant_id' ),
|
$container->get( 'api.partner_merchant_id-production' ),
|
||||||
$logger
|
$logger
|
||||||
);
|
);
|
||||||
},
|
},
|
||||||
|
@ -150,7 +155,7 @@ return array(
|
||||||
$logger = $container->get( 'woocommerce.logger.woocommerce' );
|
$logger = $container->get( 'woocommerce.logger.woocommerce' );
|
||||||
return new LoginSeller(
|
return new LoginSeller(
|
||||||
$container->get( 'api.paypal-host-sandbox' ),
|
$container->get( 'api.paypal-host-sandbox' ),
|
||||||
$container->get( 'api.partner_merchant_id' ),
|
$container->get( 'api.partner_merchant_id-sandbox' ),
|
||||||
$logger
|
$logger
|
||||||
);
|
);
|
||||||
},
|
},
|
||||||
|
@ -185,7 +190,7 @@ return array(
|
||||||
'api.endpoint.partner-referrals-production' => static function ( $container ) : PartnerReferrals {
|
'api.endpoint.partner-referrals-production' => static function ( $container ) : PartnerReferrals {
|
||||||
|
|
||||||
return new PartnerReferrals(
|
return new PartnerReferrals(
|
||||||
CONNECT_WOO_SANDBOX_URL,
|
CONNECT_WOO_URL,
|
||||||
new ConnectBearer(),
|
new ConnectBearer(),
|
||||||
$container->get( 'api.repository.partner-referrals-data' ),
|
$container->get( 'api.repository.partner-referrals-data' ),
|
||||||
$container->get( 'woocommerce.logger.woocommerce' )
|
$container->get( 'woocommerce.logger.woocommerce' )
|
||||||
|
|
|
@ -10,6 +10,7 @@ declare(strict_types=1);
|
||||||
namespace WooCommerce\PayPalCommerce\WcGateway;
|
namespace WooCommerce\PayPalCommerce\WcGateway;
|
||||||
|
|
||||||
use WooCommerce\PayPalCommerce\ApiClient\Endpoint\OrderEndpoint;
|
use WooCommerce\PayPalCommerce\ApiClient\Endpoint\OrderEndpoint;
|
||||||
|
use WooCommerce\PayPalCommerce\Onboarding\Environment;
|
||||||
use WooCommerce\PayPalCommerce\Session\SessionHandler;
|
use WooCommerce\PayPalCommerce\Session\SessionHandler;
|
||||||
use WooCommerce\PayPalCommerce\WcGateway\Settings\Settings;
|
use WooCommerce\PayPalCommerce\WcGateway\Settings\Settings;
|
||||||
use WooCommerce\WooCommerce\Logging\Logger\NullLogger;
|
use WooCommerce\WooCommerce\Logging\Logger\NullLogger;
|
||||||
|
@ -27,9 +28,16 @@ return array(
|
||||||
$settings = $container->get( 'wcgateway.settings' );
|
$settings = $container->get( 'wcgateway.settings' );
|
||||||
return $settings->has( 'merchant_id' ) ? (string) $settings->get( 'merchant_id' ) : '';
|
return $settings->has( 'merchant_id' ) ? (string) $settings->get( 'merchant_id' ) : '';
|
||||||
},
|
},
|
||||||
'api.partner_merchant_id' => static function (): string {
|
'api.partner_merchant_id' => static function ( $container ): string {
|
||||||
// @ToDo: Replace with the real merchant id of platform
|
$environment = $container->get( 'onboarding.environment' );
|
||||||
return 'KQ8FCM66JFGDL';
|
|
||||||
|
/**
|
||||||
|
* The environment.
|
||||||
|
*
|
||||||
|
* @var Environment $environment
|
||||||
|
*/
|
||||||
|
return $environment->current_environment_is( Environment::SANDBOX ) ?
|
||||||
|
(string) $container->get( 'api.partner_merchant_id-sandbox' ) : (string) $container->get( 'api.partner_merchant_id-production' );
|
||||||
},
|
},
|
||||||
'api.key' => static function ( $container ): string {
|
'api.key' => static function ( $container ): string {
|
||||||
$settings = $container->get( 'wcgateway.settings' );
|
$settings = $container->get( 'wcgateway.settings' );
|
||||||
|
|
|
@ -208,6 +208,7 @@ class SettingsListener {
|
||||||
private function maybe_register_webhooks( array $settings ) {
|
private function maybe_register_webhooks( array $settings ) {
|
||||||
|
|
||||||
if ( ! $this->settings->has( 'client_id' ) && $settings['client_id'] ) {
|
if ( ! $this->settings->has( 'client_id' ) && $settings['client_id'] ) {
|
||||||
|
$this->settings->set( 'products_dcc_enabled', null );
|
||||||
$this->webhook_registrar->register();
|
$this->webhook_registrar->register();
|
||||||
}
|
}
|
||||||
if ( $this->settings->has( 'client_id' ) && $this->settings->get( 'client_id' ) ) {
|
if ( $this->settings->has( 'client_id' ) && $this->settings->get( 'client_id' ) ) {
|
||||||
|
@ -217,6 +218,7 @@ class SettingsListener {
|
||||||
$settings['client_id'] !== $this->settings->get( 'client_id' )
|
$settings['client_id'] !== $this->settings->get( 'client_id' )
|
||||||
|| $settings['client_secret'] !== $current_secret
|
|| $settings['client_secret'] !== $current_secret
|
||||||
) {
|
) {
|
||||||
|
$this->settings->set( 'products_dcc_enabled', null );
|
||||||
$this->webhook_registrar->unregister();
|
$this->webhook_registrar->unregister();
|
||||||
$this->webhook_registrar->register();
|
$this->webhook_registrar->register();
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,11 +1,11 @@
|
||||||
<?php
|
<?php
|
||||||
/**
|
/**
|
||||||
* Plugin Name: WooCommerce PayPal Payments
|
* Plugin Name: WooCommerce PayPal Payments
|
||||||
* Plugin URI: TODO
|
* Plugin URI: https://woocommerce.com/products/woocommerce-paypal-payments/
|
||||||
* Description: PayPal's latest complete payments processing solution. Accept PayPal, PayPal Credit, credit/debit cards, alternative digital wallets local payment types and bank accounts. Turn on only PayPal options or process a full suite of payment methods. Enable global transaction with extensive currency and country coverage.
|
* Description: PayPal's latest complete payments processing solution. Accept PayPal, PayPal Credit, credit/debit cards, alternative digital wallets local payment types and bank accounts. Turn on only PayPal options or process a full suite of payment methods. Enable global transaction with extensive currency and country coverage.
|
||||||
* Version: dev-master
|
* Version: dev-master
|
||||||
* Author: WooCommerce
|
* Author: WooCommerce
|
||||||
* Author URI: https://inpsyde.com/
|
* Author URI: https://woocommerce.com/
|
||||||
* License: GPL-2.0
|
* License: GPL-2.0
|
||||||
* Text Domain: woocommerce-paypal-payments
|
* Text Domain: woocommerce-paypal-payments
|
||||||
*
|
*
|
||||||
|
@ -24,12 +24,14 @@ use Dhii\Modular\Module\ModuleInterface;
|
||||||
|
|
||||||
define( 'PAYPAL_API_URL', 'https://api.paypal.com' );
|
define( 'PAYPAL_API_URL', 'https://api.paypal.com' );
|
||||||
define( 'PAYPAL_SANDBOX_API_URL', 'https://api.sandbox.paypal.com' );
|
define( 'PAYPAL_SANDBOX_API_URL', 'https://api.sandbox.paypal.com' );
|
||||||
// @ToDo: Update date on releases.
|
define( 'PAYPAL_INTEGRATION_DATE', '2020-10-13' );
|
||||||
define( 'PAYPAL_INTEGRATION_DATE', gmdate( 'Y-m-d' ) );
|
|
||||||
|
|
||||||
// @ToDo: Real connect.woocommerce.com production link.
|
! defined( 'CONNECT_WOO_CLIENT_ID' ) && define( 'CONNECT_WOO_CLIENT_ID', 'AcCAsWta_JTL__OfpjspNyH7c1GGHH332fLwonA5CwX4Y10mhybRZmHLA0GdRbwKwjQIhpDQy0pluX_P' );
|
||||||
define( 'CONNECT_WOO_URL', 'http://connect-woo.wpcust.com/ppc' );
|
! defined( 'CONNECT_WOO_SANDBOX_CLIENT_ID' ) && define( 'CONNECT_WOO_SANDBOX_CLIENT_ID', 'AYmOHbt1VHg-OZ_oihPdzKEVbU3qg0qXonBcAztuzniQRaKE0w1Hr762cSFwd4n8wxOl-TCWohEa0XM_' );
|
||||||
define( 'CONNECT_WOO_SANDBOX_URL', 'http://connect-woo.wpcust.com/ppcsandbox' );
|
! defined( 'CONNECT_WOO_MERCHANT_ID' ) && define( 'CONNECT_WOO_MERCHANT_ID', 'K8SKZ36LQBWXJ' );
|
||||||
|
! defined( 'CONNECT_WOO_SANDBOX_MERCHANT_ID' ) && define( 'CONNECT_WOO_SANDBOX_MERCHANT_ID', 'MPMFHQTVMBZ6G' );
|
||||||
|
! defined( 'CONNECT_WOO_URL' ) && define( 'CONNECT_WOO_URL', 'https://connect.woocommerce.com/ppc' );
|
||||||
|
! defined( 'CONNECT_WOO_SANDBOX_URL' ) && define( 'CONNECT_WOO_SANDBOX_URL', 'https://connect.woocommerce.com/ppcsandbox' );
|
||||||
|
|
||||||
( function () {
|
( function () {
|
||||||
include __DIR__ . '/vendor/autoload.php';
|
include __DIR__ . '/vendor/autoload.php';
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue