@@ -45,14 +45,14 @@ public function update(string $id, mixed $params): mixed
4545 {
4646 $ carrierAccount = self ::retrieve ($ id );
4747 $ carrierAccountType = $ carrierAccount ['type ' ];
48- if (in_array ($ carrierAccountType , Constants::UPS_ACCOUNT_TYPES_WITH_CUSTOM_WORKFLOWS , true )) {
49- $ updateUrl = 'upsOauthRegistration ' ;
48+ if (in_array ($ carrierAccountType , Constants::UPS_OAUTH_ACCOUNT_TYPES , true )) {
49+ $ className = 'UpsOauthRegistration ' ;
5050 $ params = [self ::selectTopLayerKey ($ carrierAccountType ) => $ params ];
5151 } else {
52- $ updateUrl = 'carrierAccount ' ;
52+ $ className = 'CarrierAccount ' ;
5353 $ params = [self ::selectTopLayerKey ($ carrierAccountType ) => $ params ];
5454 }
55- return self ::updateResource ($ updateUrl , $ id , $ params );
55+ return self ::updateResource ($ className , $ id , $ params );
5656 }
5757
5858 /**
@@ -111,7 +111,7 @@ private function selectCarrierAccountCreationEndpoint(string $carrierAccountType
111111 {
112112 if (in_array ($ carrierAccountType , Constants::CARRIER_ACCOUNT_TYPES_WITH_CUSTOM_WORKFLOWS , true )) {
113113 return '/carrier_accounts/register ' ;
114- } else if (in_array ($ carrierAccountType , Constants::UPS_ACCOUNT_TYPES_WITH_CUSTOM_WORKFLOWS , true )) {
114+ } else if (in_array ($ carrierAccountType , Constants::UPS_OAUTH_ACCOUNT_TYPES , true )) {
115115 return '/ups_oauth_registrations ' ;
116116 }
117117
@@ -126,7 +126,7 @@ private function selectCarrierAccountCreationEndpoint(string $carrierAccountType
126126 */
127127 private function selectTopLayerKey (string $ carrierAccountType ): string
128128 {
129- return in_array ($ carrierAccountType , Constants::UPS_ACCOUNT_TYPES_WITH_CUSTOM_WORKFLOWS , true )
129+ return in_array ($ carrierAccountType , Constants::UPS_OAUTH_ACCOUNT_TYPES , true )
130130 ? 'ups_oauth_registrations '
131131 : 'carrier_account ' ;
132132 }
0 commit comments