From cbca7491f5da31592c14e0a0f81b291e38051383 Mon Sep 17 00:00:00 2001 From: David Remer Date: Tue, 30 Jun 2020 11:03:57 +0300 Subject: [PATCH] add specific data for api to gateway --- modules.local/ppcp-wc-gateway/extensions.php | 23 +++++++++++++++++++- 1 file changed, 22 insertions(+), 1 deletion(-) diff --git a/modules.local/ppcp-wc-gateway/extensions.php b/modules.local/ppcp-wc-gateway/extensions.php index 2f9c27145..753da79fd 100644 --- a/modules.local/ppcp-wc-gateway/extensions.php +++ b/modules.local/ppcp-wc-gateway/extensions.php @@ -5,5 +5,26 @@ declare(strict_types=1); namespace Inpsyde\PayPalCommerce\WcGateway; return [ - + + 'api.merchant_email' => function ($container) : string { + $settings = $container->get('wcgateway.settings'); + return $settings->has('merchant_email') ? (string) $settings->get('merchant_email') : ''; + }, + 'api.merchant_id' => function ($container) : string { + $settings = $container->get('wcgateway.settings'); + return $settings->has('merchant_id') ? (string) $settings->get('merchant_id') : ''; + }, + 'api.partner_merchant_id' => static function () : string { + // ToDo: Replace with the real merchant id of platform + return 'KQ8FCM66JFGDL'; + }, + 'api.key' => function ($container) : string { + $settings = $container->get('wcgateway.settings'); + $key = $settings->has('client_id') ? (string) $settings->get('client_id') : ''; + return $key; + }, + 'api.secret' => function ($container) : string { + $settings = $container->get('wcgateway.settings'); + return $settings->has('client_secret') ? (string) $settings->get('client_secret') : ''; + }, ];