Create a new BankAccount.

@param  mixed
@return Json Array
771970
public function create($params = array())
    {
        $arr = array(
            "bank_name" => $params["bank_name"],
            "branch_name" => $params["branch_name"],
            "bank_account_type" => $params["bank_account_type"],
            "number" => $params["number"],
            "name" => $params["name"]
        );
        $rawResponse = $this->client->request('post', 'api/bank_accounts', $arr);
        return $rawResponse;
    }
846941
public static AccountTotals createAccountTotals(String rawJSON) throws TwitterException {
        try {
            return new AccountTotalsJSONImpl(new JSONObject(rawJSON));
        } catch (JSONException e) {
            throw new TwitterException(e);
        }
    }
1027183
def bank_account
      response = JSON.parse(@client.get("users/#{send(:id)}/bank_accounts").body)
      Promisepay::BankAccount.new(@client, response['bank_accounts'])
    rescue Promisepay::UnprocessableEntity
      nil
    end
858468
public function getAccount()
    {
        $response = $this->rest->get(
            static::ACCOUNT_PATH
        );

        $this->checkResponse($response);

        return new Account($response);
    }
880781
public function create()
    {
        $instance = self::createCurrency($this);
        $this->setId($instance->getId());
        return $instance;
    }
469299
protected function createCurrencyFromJson($json) {
    $currency_data = json_decode($json);

    $currency = new Currency();
    $currency->setCurrencyCode($currency_data->ISO4217Code);
    if (isset($currency_data->ISO4217Number)) {
      $currency->setCurrencyNumber($currency_data->ISO4217Number);
    }
    if (isset($currency_data->alternativeSigns)) {
      $currency->setAlternativeSigns($currency_data->alternativeSigns);
    }
    $currency->setLabel($currency_data->title);
    if (isset($currency_data->roundingStep)) {
      $currency->setRoundingStep($currency_data->roundingStep);
    }
    if (isset($currency_data->sign)) {
      $currency->setSign($currency_data->sign);
    }
    if (isset($currency_data->subunits)) {
      $currency->setSubunits($currency_data->subunits);
    }

    $usages_data = $currency_data->usage;
    $usages = [];
    foreach ($currency_data as $property => $value) {
      $this->$property = $value;
    }
    foreach ($usages_data as $usage_data) {
      $usage = new Usage();
      if (isset($usage_data->ISO8601From)) {
        $usage->setStart($usage_data->ISO8601From);
      }
      if (isset($usage_data->ISO8601To)) {
        $usage->setEnd($usage_data->ISO8601To);
      }
      if (isset($usage_data->ISO3166Code)) {
        $usage->setCountryCode($usage_data->ISO3166Code);
      }
      $usages[] = $usage;
    }
    $currency->setUsages($usages);

    return $currency;
  }
1260103
public function createSetOfAccounts()
    {
        if ($this->getRootAccount())
        {
            throw new \Exception('Profile already has a set of accounts');
        }

        $account = new \HarvestCloud\CoreBundle\Entity\RootAccount('Root Account for '.$this->getName());
        $account->setProfile($this);

        $this->setRootAccount($account);

        // Assets
        $asset    = new \HarvestCloud\CoreBundle\Entity\AssetAccount('Assets');
        $ar       = new \HarvestCloud\CoreBundle\Entity\AssetAccount('Accounts Receivable');
        $current  = new \HarvestCloud\CoreBundle\Entity\AssetAccount('Current Assets');
        $arPrePay = new \HarvestCloud\CoreBundle\Entity\AssetAccount('AR Pre-Payments');
        $cash     = new \HarvestCloud\CoreBundle\Entity\AssetAccount('Cash');
        $bank     = new \HarvestCloud\CoreBundle\Entity\AssetAccount('Bank');
        $payPal   = new \HarvestCloud\CoreBundle\Entity\AssetAccount('PayPal');

        $this->setAccountsReceivableAccount($ar);
        $this->setPayPalAccount($payPal);
        $this->setArPrePaymentAccount($arPrePay);

        $account->addAccount($asset);
        $asset->addAccount($ar);
        $ar->addAccount($arPrePay);
        $asset->addAccount($current);
        $current->addAccount($bank);
        $current->addAccount($cash);
        $current->addAccount($payPal);

        // Liability
        $liability = new \HarvestCloud\CoreBundle\Entity\LiabilityAccount('Liabilities');
        $ap        = new \HarvestCloud\CoreBundle\Entity\LiabilityAccount('Accounts Payable');
        $apPrePay  = new \HarvestCloud\CoreBundle\Entity\LiabilityAccount('AP Pre-Payment');

        $this->setAccountsPayableAccount($ap);
        $this->setApPrePaymentAccount($apPrePay);

        $account->addAccount($liability);
        $liability->addAccount($ap);
        $ap->addAccount($apPrePay);

        // Income
        $income = new \HarvestCloud\CoreBundle\Entity\IncomeAccount('Income');
        $sales  = new \HarvestCloud\CoreBundle\Entity\IncomeAccount('Sales');

        $this->setSalesAccount($sales);

        $account->addAccount($income);
        $income->addAccount($sales);

        // Expenses
        $expenses        = new \HarvestCloud\CoreBundle\Entity\ExpenseAccount('Expenses');
        $purchases       = new \HarvestCloud\CoreBundle\Entity\ExpenseAccount('Purchases');
        $costOfGoodsSold = new \HarvestCloud\CoreBundle\Entity\ExpenseAccount('Cost of Goods Sold');

        $this->setExpenseAccount($expenses);
        $this->setPurchasesAccount($purchases);
        $this->setCostOfGoodsSoldAccount($costOfGoodsSold);

        $account->addAccount($expenses);
        $expenses->addAccount($purchases);
        $expenses->addAccount($costOfGoodsSold);

        return $account;
    }
1350004
public static function NewBill($data)
	{
		$bill = new Bill;
		$merchantData = Headers::GetMerchant();
		$bill->merchant_id = $merchantData['login'];
		$bill->bill_id = $data['bill_id'];
		$bill->user = $data['user'];
		$bill->amount = $data['amount'];
		$bill->ccy = $data['ccy'];
		$bill->comment = isset($data['comment']) ? $data['comment'] : null;
		$bill->lifetime = isset($data['lifetime']) ? $data['lifetime'] : 0;
		$bill->pay_source = isset($data['pay_source']) ? $data['pay_source'] : null;
		$bill->prv_name = isset($data['prv_name']) ? $data['prv_name'] : null;
		$bill->status = Bill::C_STATUS_WAITING;
		$bill->save();

		return $bill;

	}
226076
public function createAction()
    {
        $this->checkAuth($this->resources, $this->modules, AccessManager::CREATE);

        $baseForm = $this->getCreationForm();

        $con = Propel::getConnection();
        $con->beginTransaction();

        try {
            $form = $this->validateForm($baseForm);
            $data = $form->getData();

            $event = $this->getCreationEvent($data);

            $dispatcher = $this->getDispatcher();
            foreach ($this->createEvents as $eventName) {
                $dispatcher->dispatch($eventName, $event);
            }

            $this->afterCreateEvents($event, $data);

            $con->commit();
        } catch (HttpException $e) {
            $con->rollBack();

            return new JsonResponse(["error" => $e->getMessage()], $e->getStatusCode());
        } catch (\Exception $e) {
            $con->rollBack();

            return new JsonResponse(["error" => $e->getMessage()], 500);
        }

        $obj = $this->extractObjectFromEvent($event);
        $id = $this->extractIdFromObject($obj);

        return new JsonResponse(
            $this->getLoopResults(
                array_merge(
                    $this->getRequest()->query->all(),
                    [$this->idParameterName => $id]
                )
            ),
            201
        );
    }
663380
function createAccount() {

  var acct = {
    givenName: 'Jean-Luc',
    surname: 'Picard',
    username: unique('jlpicard'),
    email: accountEmail,
    password: 'Changeme1!'
  };

  return application.createAccount(acct, function(err, createdAccount) {
    if (err) throw err;
    account = createdAccount;
    console.log('Created account:');
    console.log(account);
    return updateAccount(); //next quickstart step
  });
}
1264277
public static function create(array $json)
    {
        $pushStatResponse = new PushStatResponse();
        $pushStatResponse->setStatusCode($json['status_code']);
        $pushStatResponse->setStatusMessage($json['status_message']);

        return $pushStatResponse;
    }
915910
public static function createFromJsonResponse($jsonString)
    {
        $data = json_decode($jsonString, true);

        $operations = [];

        foreach ($data as $name => $operationData) {
            // Ensuring that the required fields exist.
            $operationData = array_merge(['required' => [], 'properties' => []], $operationData);
            $operations[] = new Operation($name, $operationData['properties'], $operationData['required']);
        }

        return new self($operations);
    }
778804
public function create()
    {
        $request = $this->initApiRequest($this->account->getSignUpApiToken());
        $request->setPath(ApiRequest::PATH_SIGN_UP);
        $request->setReplaceParams(array('{lang}' => $this->account->getLanguageCode()));
        $response = $request->post($this->account);
        $this->checkResponse($request, $response);

        $account = new Account($this->account->getPlatform() . '-' . $this->account->getName());
        $account->setTokens(Token::parseTokens(
            $response->getJsonResult(true),
            '',
            '_token'
        ));
        return $account;
    }
1226629
public function createRefund($parameters = [])
    {
        $response = $this->client->post('transactions/refunds', [
            'json' => $parameters,
        ]);
        return json_decode($response->getBody())->refund;
    }
845912
public static function RawSignedModelFromJson($json)
    {
        $body = json_decode($json, true);
        $signatures = $body['signatures'];

        $rawSignatures = [];
        foreach ($signatures as $signature) {
            $signatureSnapshot = null;
            if (array_key_exists('snapshot', $signature)) {
                $signatureSnapshot = $signature['snapshot'];
            }

            $rawSignatures[] = new RawSignature(
                $signature['signer'], base64_decode($signature['signature']), base64_decode($signatureSnapshot)
            );
        }


        return new RawSignedModel(base64_decode($body['content_snapshot']), $rawSignatures);
    }
716820
public function create()
    {
        $instance = self::createPaymentTransaction($this);
        $this->setId($instance->getId());
        return $instance;
    }
672977
protected function generateJsonWebToken()
    {
        $exp = new \DateTime('+1 hours');
        $iat = new \DateTime();

        $jwtHeader = base64_encode(json_encode(array('alg' => 'RS256', 'typ' => 'JWT')));

        $jwtClaimSet = base64_encode(
            json_encode(
                array(
                    'iss'   => $this->clientId,
                    'scope' => self::SCOPE,
                    'aud'   => $this->url,
                    'exp'   => $exp->getTimestamp(),
                    'iat'   => $iat->getTimestamp(),
                )
            )
        );

        $jwtSignature = base64_encode($this->generateSignature($jwtHeader.'.'.$jwtClaimSet));

        return sprintf('%s.%s.%s', $jwtHeader, $jwtClaimSet, $jwtSignature);
    }