calls doCredit web service

@param array $array
associative array containing doCredit parameters
968776
public function doCredit(array $array)
    {
        $this->formatRequest($array);
        $WSRequest = array(
            'payment'         => $this->payment($array['payment']),
            'card'            => $this->card($array['card']),
            'buyer'           => $this->buyer($array['buyer'], $array['shippingAddress'], $array['billingAddress']),
            'privateDataList' => $this->privateData,
            'order'           => $this->order($array['order']),
            'comment'         => $array['comment'],
            'subMerchant'     => $this->subMerchant($array['subMerchant'])
        );
        return $this->webServiceRequest($array, $WSRequest, self::DIRECT_API, 'doCredit');
    }
499447
private function newPageFromResult( $array ) {
		if ( array_key_exists( 'pageid', $array ) ) {
			$pageid = $array['pageid'];
			$revisions = $this->getRevisionsFromResult( $array );
		} else {
			$pageid = 0;
			$revisions = new Revisions();
		}

		return new Page(
			new PageIdentifier(
				new Title(
					$array['title'],
					$array['ns']
				),
				$pageid
			),
			$revisions
		);
	}
635938
protected function payment(array $array)
    {
        $payment = new Payment();
        if ($array) {
            foreach ($array as $k => $v) {
                if (array_key_exists($k, $payment) && (strlen($v))) {
                    $payment->$k = $v;
                }
            }
        }
        return new \SoapVar($payment, SOAP_ENC_OBJECT, self::SOAP_PAYMENT, self::PAYLINE_NAMESPACE);
    }
15521
public function withHeaders(array $array, int $code = null)
  {
    foreach($array as $field => $i) {
      array_push($this->headers, $field .': '. $i);
    }

    if ($code != null) {
      $this->code = $code;
      header('HTTP/1.1 '.$this->code);
      return $this->send();
    }

    return $this;
  }
902091
protected function doCreateObject(array $array)
    {
        $order = new Order(isset($array['attributes']) && is_array($array['attributes']) ? $array['attributes'] : $array);
        $relationShips = $array['relationships'] ?? [];
        if (isset($relationShips['orderItems']) || isset($relationShips['items'])) {
            $mapper = new OrderItemsMapper();
            foreach ($relationShips['orderItems'] ?? $relationShips['items'] as $item) {
                $order->items[$item['id']] = $mapper->createObject($item);
            }
        }
        if (isset($relationShips['paymentMethods'])) {
            $mapper = new PaymentMethodsMapper();
            foreach ($relationShips['paymentMethods'] as $item) {
                $order->paymentMethods[$item['id']] = $mapper->createObject($item['attributes']);
            }
        }

        // old structure
        if (isset($array['items'])) {
            $orderItemMapper = new OrderItemsMapper();
            $order->items    = array_map(function ($item) use ($orderItemMapper) {
                return $orderItemMapper->createObject($item);
            }, $array['items']);
        }

        return $order;
    }
667830
public function copyToArray(array &$array)
    {
        $array['start']      = $this->start;
        $array['end']        = $this->end;
        $array['totalCount'] = $this->totalCount;
        $array['services']   = LanguageUtility::convertArrayOfArrayCopyableToArray($this->services);
    }
787924
public function fillFromArray(array $array)
	{
		$array = $array + array(
			'recource' => null,
			'title' => null,
			'target' => null,
			'page_master_id' => null,
			'file_id' => null,
			'href' => null,
			'classname' => null,
		);

		$this->resource = $array['resource'];
		$this->title = $array['title'];
		$this->target = $array['target'];
		$this->pageId = $array['page_master_id'];
		$this->fileId = $array['file_id'];
		$this->href = $array['href'];
		$this->classname = $array['classname'];

		$this->pageLocalization = null;
	}
681434
protected function encodeObjectReferences(array &$array)
    {
        foreach ($array as &$value) {
            if (is_array($value)) {
                $this->encodeObjectReferences($value);
            }
            if (!is_object($value) || (is_object($value) && $value instanceof DependencyProxy)) {
                continue;
            }

            $propertyClassName = TypeHandling::getTypeForValue($value);

            if ($value instanceof \SplObjectStorage) {
                throw new \RuntimeException('SplObjectStorage in array properties is not supported', 1375196580);
            } elseif ($value instanceof \Doctrine\Common\Collections\Collection) {
                throw new \RuntimeException('Collection in array properties is not supported', 1375196581);
            } elseif ($value instanceof \ArrayObject) {
                throw new \RuntimeException('ArrayObject in array properties is not supported', 1375196582);
            } elseif ($this->persistenceManager->isNewObject($value) === false
                && (
                    $this->reflectionService->isClassAnnotatedWith($propertyClassName, Flow\Entity::class)
                    || $this->reflectionService->isClassAnnotatedWith($propertyClassName, Flow\ValueObject::class)
                    || $this->reflectionService->isClassAnnotatedWith($propertyClassName, \Doctrine\ORM\Mapping\Entity::class)
                )
            ) {
                $value = [
                    '__flow_object_type' => $propertyClassName,
                    '__identifier' => $this->persistenceManager->getIdentifierByObject($value)
                ];
            }
        }
    }
408059
public function edit($array)
	{
		$headers = array(
			'Content-Type' => "application/x-www-form-urlencoded"
		);

		$array['action'] = 'edit';
		$array['format'] = 'php';

		$apiResult = $this->session->post($this->api, $headers, $array);

		return unserialize($apiResult->body);
	}
668677
public function copyFromArray(array &$array)
    {
        // serviceName
        $this->setServiceName(
            LanguageUtility::getFromArray('serviceName', $array));

        // apiKey
        $this->setApiKey(
            LanguageUtility::getFromArray('apiKey', $array));

        // apiSecret
        $this->setApiSecret(
            LanguageUtility::getFromArray('apiSecret', $array));

        // issuer
        $this->setIssuer(
            LanguageUtility::getFromArray('issuer', $array));

        // authorizationEndpoint
        $this->setAuthorizationEndpoint(
            LanguageUtility::getFromArray('authorizationEndpoint', $array));

        // tokenEndpoint
        $this->setTokenEndpoint(
            LanguageUtility::getFromArray('tokenEndpoint', $array));

        // revocationEndpoint
        $this->setRevocationEndpoint(
            LanguageUtility::getFromArray('revocationEndpoint', $array));

        // supportedRevocationAuthMethods
        $supportedRevocationAuthMethods = LanguageUtility::getFromArray('supportedRevocationAuthMethods', $array);
        $this->setSupportedRevocationAuthMethods(
            LanguageUtility::convertArray(
                $supportedRevocationAuthMethods, '\Authlete\Types\ClientAuthMethod::valueOf'));

        // userInfoEndpoint
        $this->setUserInfoEndpoint(
            LanguageUtility::getFromArray('userInfoEndpoint', $array));

        // jwksUri
        $this->setJwksUri(
            LanguageUtility::getFromArray('jwksUri', $array));

        // jwks
        $this->setJwks(
            LanguageUtility::getFromArray('jwks', $array));

        // registrationEndpoint
        $this->setRegistrationEndpoint(
            LanguageUtility::getFromArray('registrationEndpoint', $array));

        // supportedScopes
        $supportedScopes = LanguageUtility::getFromArray('supportedScopes', $array);
        $this->setSupportedScopes(
            LanguageUtility::convertArrayToArrayOfArrayCopyable(
                $supportedScopes, __NAMESPACE__ . '\Scope'));

        // supportedResponseTypes
        $supportedResponseTypes = LanguageUtility::getFromArray('supportedResponseTypes', $array);
        $this->setSupportedResponseTypes(
            LanguageUtility::convertArray(
                $supportedResponseTypes, '\Authlete\Types\ResponseType::valueOf'));

        // supportedGrantTypes
        $supportedGrantTypes = LanguageUtility::getFromArray('supportedGrantTypes', $array);
        $this->setSupportedGrantTypes(
            LanguageUtility::convertArray(
                $supportedGrantTypes, '\Authlete\Types\GrantType::valueOf'));

        // supportedAcrs
        $this->setSupportedAcrs(
            LanguageUtility::getFromArray('supportedAcrs', $array));

        // supportedTokenAuthMethods
        $supportedTokenAuthMethods = LanguageUtility::getFromArray('supportedTokenAuthMethods', $array);
        $this->setSupportedTokenAuthMethods(
            LanguageUtility::convertArray(
                $supportedTokenAuthMethods, '\Authlete\Types\ClientAuthMethod::valueOf'));

        // supportedDisplays
        $supportedDisplays = LanguageUtility::getFromArray('supportedDisplays', $array);
        $this->setSupportedDisplays(
            LanguageUtility::convertArray(
                $supportedDisplays, '\Authlete\Types\Display::valueOf'));

        // supportedClaimTypes
        $supportedClaimTypes = LanguageUtility::getFromArray('supportedClaimTypes', $array);
        $this->setSupportedClaimTypes(
            LanguageUtility::convertArray(
                $supportedClaimTypes, '\Authlete\Types\ClaimType::valueOf'));

        // supportedClaims
        $this->setSupportedClaims(
            LanguageUtility::getFromArray('supportedClaims', $array));

        // serviceDocumentation
        $this->setServiceDocumentation(
            LanguageUtility::getFromArray('serviceDocumentation', $array));

        // supportedClaimLocales
        $this->setSupportedClaimLocales(
            LanguageUtility::getFromArray('supportedClaimLocales', $array));

        // supportedUiLocales
        $this->setSupportedUiLocales(
            LanguageUtility::getFromArray('supportedUiLocales', $array));

        // policyUri
        $this->setPolicyUri(
            LanguageUtility::getFromArray('policyUri', $array));

        // tosUri
        $this->setTosUri(
            LanguageUtility::getFromArray('tosUri', $array));

        // description
        $this->setDescription(
            LanguageUtility::getFromArray('description', $array));

        // accessTokenType
        $this->setAccessTokenType(
            LanguageUtility::getFromArray('accessTokenType', $array));

        // accessTokenDuration
        $this->setAccessTokenDuration(
            LanguageUtility::getFromArray('accessTokenDuration', $array));

        // refreshTokenDuration
        $this->setRefreshTokenDuration(
            LanguageUtility::getFromArray('refreshTokenDuration', $array));

        // idTokenDuration
        $this->setIdTokenDuration(
            LanguageUtility::getFromArray('idTokenDuration', $array));

        // authorizationResponseDuration
        $this->setAuthorizationResponseDuration(
            LanguageUtility::getFromArray('authorizationResponseDuration', $array));

        // authenticationCallbackEndpoint
        $this->setAuthenticationCallbackEndpoint(
            LanguageUtility::getFromArray('authenticationCallbackEndpoint', $array));

        // authenticationCallbackApiKey
        $this->setAuthenticationCallbackApiKey(
            LanguageUtility::getFromArray('authenticationCallbackApiKey', $array));

        // authenticationCallbackApiSecret
        $this->setAuthenticationCallbackApiSecret(
            LanguageUtility::getFromArray('authenticationCallbackApiSecret', $array));

        // supportedSnses
        $supportedSnses = LanguageUtility::getFromArray('supportedSnses', $array);
        $this->setSupportedSnses(
            LanguageUtility::convertArray(
                $supportedSnses, '\Authlete\Types\Sns::valueOf'));
    
        // snsCredentials
        $snsCredentials = LanguageUtility::getFromArray('snsCredentials', $array);
        $this->setSnsCredentials(
            LanguageUtility::convertArrayToArrayOfArrayCopyable(
                $snsCredentials, __NAMESPACE__ . '\SnsCredentials'));

        // createdAt
        $this->setCreatedAt(
            LanguageUtility::getFromArray('createdAt', $array));

        // modifiedAt
        $this->setModifiedAt(
            LanguageUtility::getFromArray('modifiedAt', $array));

        // developerAuthenticationCallbackEndpoint
        $this->setDeveloperAuthenticationCallbackEndpoint(
            LanguageUtility::getFromArray('developerAuthenticationCallbackEndpoint', $array));

        // developerAuthenticationCallbackApiKey
        $this->setDeveloperAuthenticationCallbackApiKey(
            LanguageUtility::getFromArray('developerAuthenticationCallbackApiKey', $array));

        // developerAuthenticationCallbackApiSecret
        $this->setDeveloperAuthenticationCallbackApiSecret(
            LanguageUtility::getFromArray('developerAuthenticationCallbackApiSecret', $array));

        // supportedDeveloperSnses
        $supportedDeveloperSnses = LanguageUtility::getFromArray('supportedDeveloperSnses', $array);
        $this->setSupportedDeveloperSnses(
            LanguageUtility::convertArray(
                $supportedDeveloperSnses, '\Authlete\Types\Sns::valueOf'));
    
        // developerSnsCredentials
        $developerSnsCredentials = LanguageUtility::getFromArray('developerSnsCredentials', $array);
        $this->setDeveloperSnsCredentials(
            LanguageUtility::convertArrayToArrayOfArrayCopyable(
                $developerSnsCredentials, __NAMESPACE__ . '\SnsCredentials'));

        // clientsPerDeveloper
        $this->setClientsPerDeveloper(
            LanguageUtility::orZero(
                LanguageUtility::getFromArray('clientsPerDeveloper', $array)));

        // directAuthorizationEndpointEnabled
        $this->setDirectAuthorizationEndpointEnabled(
            LanguageUtility::getFromArrayAsBoolean('directAuthorizationEndpointEnabled', $array));

        // directTokenEndpointEnabled
        $this->setDirectTokenEndpointEnabled(
            LanguageUtility::getFromArrayAsBoolean('directTokenEndpointEnabled', $array));

        // directRevocationEndpointEnabled
        $this->setDirectRevocationEndpointEnabled(
            LanguageUtility::getFromArrayAsBoolean('directRevocationEndpointEnabled', $array));

        // directUserInfoEndpointEnabled
        $this->setDirectUserInfoEndpointEnabled(
            LanguageUtility::getFromArrayAsBoolean('directUserInfoEndpointEnabled', $array));

        // directJwksEndpointEnabled
        $this->setDirectJwksEndpointEnabled(
            LanguageUtility::getFromArrayAsBoolean('directJwksEndpointEnabled', $array));

        // directIntrospectionEndpointEnabled
        $this->setDirectIntrospectionEndpointEnabled(
            LanguageUtility::getFromArrayAsBoolean('directIntrospectionEndpointEnabled', $array));

        // singleAccessTokenPerSubject
        $this->setSingleAccessTokenPerSubject(
            LanguageUtility::getFromArrayAsBoolean('singleAccessTokenPerSubject', $array));

        // pkceRequired
        $this->setPkceRequired(
            LanguageUtility::getFromArrayAsBoolean('pkceRequired', $array));

        // refreshTokenKept
        $this->setRefreshTokenKept(
            LanguageUtility::getFromArrayAsBoolean('refreshTokenKept', $array));

        // errorDescriptionOmitted
        $this->setErrorDescriptionOmitted(
            LanguageUtility::getFromArrayAsBoolean('errorDescriptionOmitted', $array));

        // errorUriOmitted
        $this->setErrorUriOmitted(
            LanguageUtility::getFromArrayAsBoolean('errorUriOmitted', $array));

        // clientIdAliasEnabled
        $this->setClientIdAliasEnabled(
            LanguageUtility::getFromArrayAsBoolean('clientIdAliasEnabled', $array));

        // supportedServiceProfiles
        $supportedServiceProfiles = LanguageUtility::getFromArray('supportedServiceProfiles', $array);
        $this->setSupportedServiceProfiles(
            LanguageUtility::convertArray(
                $supportedServiceProfiles, '\Authlete\Types\ServiceProfile::valueOf'));

        // tlsClientCertificateBoundAccessTokens
        $this->setTlsClientCertificateBoundAccessTokens(
            LanguageUtility::getFromArrayAsBoolean('tlsClientCertificateBoundAccessTokens', $array));

        // mutualTlsValidatePkiCertChain
        $this->setMutualTlsValidatePkiCertChain(
            LanguageUtility::getFromArrayAsBoolean('mutualTlsValidatePkiCertChain', $array));

        // introspectionEndpoint
        $this->setIntrospectionEndpoint(
            LanguageUtility::getFromArray('introspectionEndpoint', $array));

        // supportedIntrospectionAuthMethods
        $supportedIntrospectionAuthMethods = LanguageUtility::getFromArray('supportedIntrospectionAuthMethods', $array);
        $this->setSupportedIntrospectionAuthMethods(
            LanguageUtility::convertArray(
                $supportedIntrospectionAuthMethods, '\Authlete\Types\ClientAuthMethod::valueOf'));

        // trustedRootCertificates
        $this->setTrustedRootCertificates(
            LanguageUtility::getFromArray('trustedRootCertificates', $array));

        // authorizationSignatureKeyId
        $this->setAuthorizationSignatureKeyId(
            LanguageUtility::getFromArray('authorizationSignatureKeyId', $array));

        // idTokenSignatureKeyId
        $this->setIdTokenSignatureKeyId(
            LanguageUtility::getFromArray('idTokenSignatureKeyId', $array));

        // userInfoSignatureKeyId
        $this->setUserInfoSignatureKeyId(
            LanguageUtility::getFromArray('userInfoSignatureKeyId', $array));
    }
854392
protected function recursiveSetKeysToUnderScore(array &$array)
    {
        $newArray = [];
        foreach ($array as $key => &$value) {
            $underscoreKey = RecursiveFormatterHelper::camelCaseToUnderscore($key);
            $newArray[$underscoreKey] = $value;

            if (\is_array($value)) {
                $this->recursiveSetKeysToUnderScore($newArray[$underscoreKey]);
            }
        }
        $array = $newArray;
    }
487717
public function copyFromArray(array &$array)
    {
        parent::copyFromArray($array);

        // action
        $this->setAction(
            TokenCreateAction::valueOf(
                LanguageUtility::getFromArray('action', $array)));

        // grantType
        $this->setGrantType(
            GrantType::valueOf(
                LanguageUtility::getFromArray('grantType', $array)));

        // clientId
        $this->setClientId(
            LanguageUtility::getFromArray('clientId', $array));

        // subject
        $this->setSubject(
            LanguageUtility::getFromArray('subject', $array));

        // scopes
        $this->setScopes(
            LanguageUtility::getFromArray('scopes', $array));

        // accessToken
        $this->setAccessToken(
            LanguageUtility::getFromArray('accessToken', $array));

        // tokenType
        $this->setTokenType(
            LanguageUtility::getFromArray('tokenType', $array));

        // expiresIn
        $this->setExpiresIn(
            LanguageUtility::getFromArray('expiresIn', $array));

        // expiresAt
        $this->setExpiresAt(
            LanguageUtility::getFromArray('expiresAt', $array));

        // refreshToken
        $this->setRefreshToken(
            LanguageUtility::getFromArray('refreshToken', $array));

        // properties
        $properties = LanguageUtility::getFromArray('properties', $array);
        $this->setProperties(
            LanguageUtility::convertArrayToArrayOfArrayCopyable(
                $properties, __NAMESPACE__ . '\Property'));
    }
97736
protected function yamlArrayToModel($array)
    {
        $filePermissions = $array;
        $permissions = [];
        $index = 0;

        foreach ($filePermissions as $code=>$permission) {
            $permission['permission'] = $code;

            $permissions[] = $permission;
        }

        $this->permissions = $permissions;
    }
45196
public function setAttributes( $array )
	{
		if( is_a( $array, 'ADT_List_Dictionary' ) )
			$array	= $array->getAll();
		foreach( $array as $key => $value )
			$this->attributes->set( $key, $value );
	}
230016
protected function billingRecordForUpdate(array $array)
    {
        $billingRecordForUpdate = new BillingRecordForUpdate();
        if ($array) {
            foreach ($array as $k => $v) {
                if (array_key_exists($k, $billingRecordForUpdate) && (strlen($v))) {
                    $billingRecordForUpdate->$k = $v;
                }
            }
        }
        return new \SoapVar($billingRecordForUpdate, SOAP_ENC_OBJECT, self::SOAP_BILLING_RECORD_FOR_UPDATE, self::PAYLINE_NAMESPACE);
    }
1370676
private function _fromAssociativeArray(array $array)
    {
        foreach ($this->_fields as $fieldName => $field) {
            $fieldType = $field['FieldType'];   
            if (is_array($fieldType)) {
                if ($this->_isComplexType($fieldType[0])) {
                    if (array_key_exists($fieldName, $array)) { 
                        $elements = $array[$fieldName];
                        if (!$this->_isNumericArray($elements)) {
                            $elements =  array($elements);    
                        }
                        if (count ($elements) >= 1) {
                            // // require_once (dirname(__FILE__) . DIRECTORY_SEPARATOR . '..' . DIRECTORY_SEPARATOR . str_replace('_', DIRECTORY_SEPARATOR, $fieldType[0]) . ".php");

                            foreach ($elements as $element) {
                                $this->_fields[$fieldName]['FieldValue'][] = new $fieldType[0]($element);
                            }
                        }
                    } 
                } else {
                    if (array_key_exists($fieldName, $array)) {
                        $elements = $array[$fieldName];
                        if (!$this->_isNumericArray($elements)) {
                            $elements =  array($elements);    
                        }
                        if (count ($elements) >= 1) {
                            foreach ($elements as $element) {
                                $this->_fields[$fieldName]['FieldValue'][] = $element;
                            }
                        }  
                    }
                }
            } else {
                 if ($this->_isComplexType($fieldType)) {
                    if (array_key_exists($fieldName, $array)) {
                        // // require_once (dirname(__FILE__) . DIRECTORY_SEPARATOR . '..' . DIRECTORY_SEPARATOR . str_replace('_', DIRECTORY_SEPARATOR, $fieldType) . ".php");
                        $this->_fields[$fieldName]['FieldValue'] = new $fieldType($array[$fieldName]);
                    }   
                 } else {
                    if (array_key_exists($fieldName, $array)) {
                        $this->_fields[$fieldName]['FieldValue'] = $array[$fieldName];
                    }
                 }
            }
        }
    }
1113416
public static function arrayToKey(array $array): string {
        $result = "";
        \array_walk_recursive($array, function ($key, $value) use (&$result) {
            $result .= $key . $value;
        });
        return $result;
    }