@@ -34,7 +34,8 @@ class PayPalConfigController extends AdminController
34
34
/**
35
35
* @var string Current class template name.
36
36
*/
37
- protected $ _sThisTemplate = 'oscpaypalconfig.tpl ' ; // phpcs:ignore PSR2.Classes.PropertyDeclaration
37
+ // phpcs:ignore PSR2.Classes.PropertyDeclaration
38
+ protected $ _sThisTemplate = 'oscpaypalconfig.tpl ' ;
38
39
39
40
/**
40
41
* @return string
@@ -110,17 +111,12 @@ private function buildSignUpLink(
110
111
$ localeCode = $ lang ->getLanguageAbbr () . '- ' . $ countryCode ;
111
112
112
113
$ partnerLogoUrl = Registry::getConfig ()->getOutUrl (null , true ) . 'admin/img/loginlogo.png ' ;
113
- $ returnToPartnerUrl = $ config ->getAdminUrlForJSCalls () .
114
- 'cl=oscpaypalconfig&fnc=returnFromSignup ' .
115
- '&isSandbox= ' . ($ isSandbox ? '1 ' : '0 ' )
116
- ;
117
114
118
115
$ params = [
119
116
'partnerClientId ' => $ partnerClientId ,
120
117
'partnerId ' => $ partnerId ,
121
118
'partnerLogoUrl ' => $ partnerLogoUrl ,
122
- 'returnToPartnerUrl ' => $ returnToPartnerUrl ,
123
- 'product ' => 'ppcp ' ,
119
+ 'product ' => 'PPCP ' ,
124
120
'secondaryProducts ' => 'payment_methods ' ,
125
121
'capabilities ' => 'PAY_UPON_INVOICE ' ,
126
122
'integrationType ' => 'FO ' ,
@@ -163,10 +159,9 @@ public function createNonce(): string
163
159
public function save ()
164
160
{
165
161
$ confArr = Registry::getRequest ()->getRequestEscapedParameter ('conf ' );
166
- $ shopId = Registry::getConfig ()->getShopId ();
167
162
168
163
$ confArr = $ this ->handleSpecialFields ($ confArr );
169
- $ this ->saveConfig ($ confArr, $ shopId );
164
+ $ this ->saveConfig ($ confArr );
170
165
$ this ->checkEligibility ();
171
166
parent ::save ();
172
167
}
@@ -175,9 +170,8 @@ public function save()
175
170
* Saves configuration values
176
171
*
177
172
* @param array $conf
178
- * @param int $shopId
179
173
*/
180
- protected function saveConfig (array $ conf, int $ shopId )
174
+ protected function saveConfig (array $ conf )
181
175
{
182
176
foreach ($ conf as $ confName => $ value ) {
183
177
$ this ->getServiceFromContainer (ModuleSettings::class)->save ($ confName , $ value );
@@ -347,32 +341,12 @@ public function autoConfigurationFromCallback()
347
341
$ logger ->error ($ exception ->getMessage (), [$ exception ]);
348
342
}
349
343
350
- $ result = [];
351
- header ('Content-Type: application/json; charset=UTF-8 ' );
352
- Registry::getUtils ()->showMessageAndExit (json_encode ($ result ));
353
- }
354
-
355
- public function returnFromSignup ()
356
- {
357
- $ config = new Config ();
358
- $ request = Registry::getRequest ();
359
- if (
360
- ('true ' === (string )$ request ->getRequestParameter ('permissionsGranted ' )) &&
361
- ('true ' === (string )$ request ->getRequestParameter ('consentStatus ' ))
362
- ) {
363
- /** @var ModuleSettings $moduleSettings */
364
- $ moduleSettings = $ this ->getServiceFromContainer (ModuleSettings::class);
365
- $ isSandbox = (string )$ request ->getRequestParameter ('isSandbox ' );
366
- $ isSandbox = $ isSandbox === '1 ' ;
367
- $ moduleSettings ->saveMerchantId ($ request ->getRequestParameter ('merchantIdInPayPal ' ), $ isSandbox );
368
- }
369
-
370
344
$ this ->autoConfiguration ();
371
345
$ this ->registerWebhooks ();
372
346
373
- $ url = $ config -> getAdminUrlForJSCalls () . ' cl=oscpaypalconfig ' ;
374
-
375
- Registry::getUtils ()->redirect ( $ url , false , 302 );
347
+ $ result = [] ;
348
+ header ( ' Content-Type: application/json; charset=UTF-8 ' );
349
+ Registry::getUtils ()->showMessageAndExit ( json_encode ( $ result ) );
376
350
}
377
351
378
352
/**
0 commit comments