@param array|JsonSerializable|BankAccount $data
@param string $bankAccountId

@throws UnprocessableEntityException The input data does not valid

@return BankAccount
496016
public function create($data, $bankAccountId = null)
    {
        if (isset($bankAccountId)) {
            return $this->client()->put($data, 'bank-accounts/{bankAccountId}', ['bankAccountId' => $bankAccountId]);
        }

        return $this->client()->post($data, 'bank-accounts');
    }
1363082
public static function get(
        int $bunqmeFundraiserResultId,
        int $noteAttachmentBunqMeFundraiserResultId,
        int $monetaryAccountId = null,
        array $customHeaders = []
    ): BunqResponseNoteAttachmentBunqMeFundraiserResult {
        $apiClient = new ApiClient(static::getApiContext());
        $responseRaw = $apiClient->get(
            vsprintf(
                self::ENDPOINT_URL_READ,
                [
                    static::determineUserId(),
                    static::determineMonetaryAccountId($monetaryAccountId),
                    $bunqmeFundraiserResultId,
                    $noteAttachmentBunqMeFundraiserResultId,
                ]
            ),
            [],
            $customHeaders
        );

        return BunqResponseNoteAttachmentBunqMeFundraiserResult::castFromBunqResponse(
            static::fromJson($responseRaw, self::OBJECT_TYPE_GET)
        );
    }
1330437
public static function create(
        Amount $amountRequested,
        string $issuer,
        int $monetaryAccountId = null,
        array $customHeaders = []
    ): BunqResponseInt {
        $apiClient = new ApiClient(static::getApiContext());
        $responseRaw = $apiClient->post(
            vsprintf(
                self::ENDPOINT_URL_CREATE,
                [static::determineUserId(), static::determineMonetaryAccountId($monetaryAccountId)]
            ),
            [
                self::FIELD_AMOUNT_REQUESTED => $amountRequested,
                self::FIELD_ISSUER => $issuer,
            ],
            $customHeaders
        );

        return BunqResponseInt::castFromBunqResponse(
            static::processForId($responseRaw)
        );
    }
1070464
private function validateArray($sourceAccountId = [])
    {
        if (!is_array($sourceAccountId)) {
            throw new BcaHttpException('Data harus array.');
        }
        if (empty($sourceAccountId)) {
            throw new BcaHttpException('AccountNumber tidak boleh kosong.');
        } else {
            $max = sizeof($sourceAccountId);
            if ($max > 20) {
                throw new BcaHttpException('Maksimal Account Number ' . 20);
            }
        }

        return true;
    }
600449
public static function bankAppId($bankApp)
    {
        if ($bankApp == 'swedbank_företag')
            throw new UserException('Bank type "swedbank_företag" is no longer valid. Please "swedbank_foretag" instead.', 1);

        elseif (!isset(self::$appData[$bankApp]))
            throw new UserException('Bank type does not exists, use one of the following: '.implode(', ', array_keys(self::$appData)), 2);

        return self::$appData[$bankApp];
    }
1323700
public function bankAccountCheck(PayoneBankAccountCheckTransfer $bankAccountCheckTransfer)
    {
        /** @var \SprykerEco\Zed\Payone\Business\Payment\MethodMapper\DirectDebit $paymentMethodMapper */
        $paymentMethodMapper = $this->getRegisteredPaymentMethodMapper(PayoneApiConstants::PAYMENT_METHOD_ONLINE_BANK_TRANSFER);
        $requestContainer = $paymentMethodMapper->mapBankAccountCheck($bankAccountCheckTransfer);
        $this->setStandardParameter($requestContainer);

        $rawResponse = $this->executionAdapter->sendRequest($requestContainer);
        $responseContainer = new BankAccountCheckResponseContainer($rawResponse);

        $bankAccountCheckTransfer->setErrorCode($responseContainer->getErrorcode());
        $bankAccountCheckTransfer->setCustomerErrorMessage($responseContainer->getCustomermessage());
        $bankAccountCheckTransfer->setStatus($responseContainer->getStatus());
        $bankAccountCheckTransfer->setInternalErrorMessage($responseContainer->getErrormessage());

        return $bankAccountCheckTransfer;
    }
1329475
public function bankAccountEdit($username, $password, $id, array $fields)
    {
        return $this->performRequest(
            self::METHOD_POST,
            sprintf('/api/reseller/v%d/bankaccount-edit', self::API_VERSION),
            ["username" => $username, "password" => $password, "id" => $id] + $fields
        );
    }
210324
public function createUser($data) {
        $response=CodeBank_ClientAPI::responseBase();
        
        try {
            if(Member::get()->filter('Email', Convert::raw2sql($data->username))->count()>0) {
                $response['status']='EROR';
                $response['message']=_t('CodeBankAPI.EMAIL_EXISTS', '_An account with that email already exists');
                
                return $response;
            }
            
            
            //Create and write member
            $member=new Member();
            $member->FirstName=(!empty($data->firstname) ? $data->firstname:$data->username);
            $member->Surname=(!empty($data->surname) ? $data->surname:null);
            $member->Email=$data->username;
            $member->Password=$data->Password;
            $member->UseHeartbeat=0;
            
            if(!$member->validate()) {
                $response['status']='EROR';
                $response['message']=_t('CodeBankAPI.PASSWORD_NOT_VALID', '_Password is not valid');
                
                return $response;
            }
            
            $member->write();
            
            
            $response['status']='HELO';
            $response['message']="User added successfully";
        }catch (Exception $e) {
            $response['status']='EROR';
            $response['message']=_t('CodeBankAPI.SERVER_ERROR', '_Server error has occured, please try again later');
        }
        
        return $response;
    }
27064
public function getTransactionById($wallet_uuid, $txid, $address_uuid)
    {
        $parameters = [
            'uuid' => $address_uuid,
        ];
        return $this->newAPIRequest('GET', $wallet_uuid . '/address/transaction/' . $txid, $parameters);
    }
277766
public function sendData($data)
    {
        $response = $this->gocardless->customerBankAccounts()->create($data);

        return $this->response = new BankAccountResponse($this, $response);
    }
463054
public function checkBankAccount(PayonePaymentOnlinetransferTransfer $data, ExecutionContextInterface $context)
    {
        $quoteTransfer = $context->getRoot()->getData();
        if ($quoteTransfer->getPayment()->getPaymentSelection() != $this->getPropertyPath()) {
            return;
        }

        $bankAccountCheckTransfer = new PayoneBankAccountCheckTransfer();
        $bankAccountCheckTransfer->setBankCountry($data->getBankcountry());
        $bankAccountCheckTransfer->setBankAccount($data->getBankaccount());
        $bankAccountCheckTransfer->setBankCode($data->getBankcode());
        $bankAccountCheckTransfer->setBankBranchCode($data->getBankbranchcode());
        $bankAccountCheckTransfer->setBankCheckDigit($data->getBankcheckdigit());
        $bankAccountCheckTransfer->setIban($data->getIban());
        $bankAccountCheckTransfer->setBic($data->getBic());

        $response = $this->getClient()->bankAccountCheck($bankAccountCheckTransfer);
        if ($response->getStatus() == 'ERROR' || $response->getStatus() == 'INVALID') {
            $context->addViolation($response->getCustomerErrorMessage());
        }
    }
315725
public function setTransfersToBankAccount($amount, $bankAccountId)
    {
        $this->data->amount = $amount;
        $this->data->transferInstrument->method = self::METHOD;
        $this->data->transferInstrument->bankAccount->id = $bankAccountId;

        return $this;
    }
653661
public function tokenize($id, array $data = [])
    {
        $assoc = $this->getConfig('associationAlias');

        $tokenData = [
            'foreign_alias' => $this->_table->getAlias(),
            'foreign_table' => $this->_table->getTable(),
            'foreign_key' => $id,
            'foreign_data' => $data,
        ];
        $tokenData = array_filter($tokenData);
        if (!isset($tokenData['foreign_data'])) {
            $tokenData['foreign_data'] = [];
        }

        $table = $this->_table->$assoc;
        $token = $table->newEntity($tokenData);

        if (!$table->save($token)) {
            throw new \RuntimeException();
        }

        return $token;
    }
100638
public function isValidBank($bankID)
    {
        try {
            $this->initialized = true;
            $this->bank = $this->backend->getBank($bankID);
            return true;
            
        } catch (BankNotFoundException $e) {
            $this->bank = null;
            return false;
            
        }
    }
490076
public function getCredentialObject($accountId = null)
    {
        if ($accountId == null && array_key_exists($this->defaultAccountName, $this->credentialHashmap)) {
            $credObj = $this->credentialHashmap[$this->defaultAccountName];
        } elseif (array_key_exists($accountId, $this->credentialHashmap)) {
            $credObj = $this->credentialHashmap[$accountId];
        }

        if (empty($credObj)) {
            throw new InvalidCredentialException("Credential not found for " . ($accountId ? $accountId : " default user") .
                ". Please make sure your configuration/APIContext has credential information");
        }
        return $credObj;
    }
1135077
public function byCostCenterByAccountIdAndByOrganization($costCenterId, $accountId, $organizationId, $databaseConnectionName = null)
  {
    if(empty($databaseConnectionName))
    {
      $databaseConnectionName = $this->databaseConnectionName;
    }

    return $this->Apportionment->setConnection($databaseConnectionName)
      ->where('account_id', '=', $accountId)
      ->where('percentage', '=', 100)
      ->where('organization_id', '=', $organizationId)
      ->where(
        function($query) use ($costCenterId)
        {
          $query->orWhere('cost_center_id', '=', $costCenterId);
          $query->orWhereNull('cost_center_id');
        }
      )
      ->get();
  }
1343973
public function sendData($data)
    {
        $response = $this->gocardless->customerBankAccounts()->disable($this->getBankAccountReference());

        return $this->response = new BankAccountResponse($this, $response);
    }