Create a HiPay wallet.

Dispatch the event <b>before.wallet.create</b>
before sending the data to HiPay

@param array $shopData

@return AccountInfo the created account info
546675
protected function createWallet(array $shopData)
    {
        $userAccount = new UserAccount($shopData);

        $event = new CreateWallet(
            $userAccount
        );

        $this->dispatcher->dispatch(
            'before.wallet.create',
            $event
        );

        $walletInfo = $this->hipay->createFullUseraccountV2(
            $event->getUserAccount()
        );

        $this->dispatcher->dispatch(
            'after.wallet.create',
            $event
        );

        return $walletInfo;
    }
1026616
public static function create(array $callbackData): self
    {
        $payload = $callbackData['payload'] ?? null;
        $referral = isset($callbackData['referral']) ? Referral::create($callbackData['referral']) : null;

        return new self($callbackData['title'], $payload, $referral);
    }
983844
public function create()
    {
        $instance = self::createStoreCreditPayment($this);
        $this->setId($instance->getId());
        return $instance;
    }
1233336
public function create(array $data)
    {
        $map = [
            'create' => AuditCreateEvent::class,
            'update' => AuditUpdateEvent::class,
            'delete' => AuditDeleteEvent::class,
        ];

        if ($data['type'] !== 'delete') {
            $event = new $map[$data['type']](
                $data['transaction'],
                $data['primary_key'],
                $data['source'],
                $data['changed'],
                $data['original']
            );
        } else {
            $event = new $map[$data['type']](
                $data['transaction'],
                $data['primary_key'],
                $data['source']
            );
        }

        if (isset($data['parent_source'])) {
            $event->setParentSourceName($data['parent_source']);
        }

        $reflection = new ReflectionObject($event);
        $timestamp = $reflection->getProperty('timestamp');
        $timestamp->setAccessible(true);
        $timestamp->setValue($event, $data['@timestamp']);
        $event->setMetaInfo($data['meta']);

        return $event;
    }
777306
private function createPaymillMethod(array $data)
    {
        $paymentMethod = new PaymillMethod();
        $paymentMethod
            ->setApiToken($data['api_token'])
            ->setCreditCardNumber($data['credit_card_1'] . $data['credit_card_2'] . $data['credit_card_3'] . $data['credit_card_4'])
            ->setCreditCardOwner($data['credit_card_owner'])
            ->setCreditCardExpirationMonth($data['credit_card_expiration_month'])
            ->setCreditCardExpirationYear($data['credit_card_expiration_year'])
            ->setCreditCardSecurity($data['credit_card_security']);

        return $paymentMethod;
    }
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;

	}
837166
protected function getCreationEvent($formData)
    {
        $orderStatusCreateEvent = new OrderStatusCreateEvent();

        $orderStatusCreateEvent
            ->setLocale($formData['locale'])
            ->setTitle($formData['title'])
            ->setCode($formData['code'])
            ->setColor($formData['color'])
        ;

        return $orderStatusCreateEvent;
    }
477834
public function createChooseCardJsPackage($cardid = null, $cardtype = null, $shopid = null)
    {
        $data = array();
        $data['api_ticket'] = $this->getJsCardTicket();
        $data['app_id'] = $this->appid;
        $data['timestamp'] = time();
        $data['nonceStr'] = Tools::createNoncestr();
        !empty($cardid) && $data['cardId'] = $cardid;
        !empty($cardtype) && $data['cardType'] = $cardtype;
        !empty($shopid) && $data['shopId'] = $shopid;
        $data['cardSign'] = $this->getTicketSignature($data);
        $data['signType'] = 'SHA1';
        unset($data['api_ticket'], $data['app_id']);
        return $data;
    }
1243213
private function disableVendor($vendorData)
    {

        $vendor = $this->vendorManager->findByMiraklId($vendorData['shop_id']);
        $logVendor = $this->logVendorManager->findByMiraklId($vendorData['shop_id']);

        if ($vendor) {
            $this->logger->info(
                'Shop ' . $vendorData['shop_id'] . ' found in database',
                array('miraklId' => $vendorData['shop_id'], "action" => "Wallet creation")
            );
            if ($vendor->getEnabled() || $vendor->getEnabled() === null) {
                $vendor->setEnabled(false);
                $this->vendorManager->save($vendor);
                if ($logVendor !== null) {
                    $logVendor->setEnabled(false);
                    $this->logVendorManager->save($logVendor);
                }
                $this->logger->info(
                    'Shop ' . $vendorData['shop_id'] . ' disabled',
                    array('miraklId' => $vendorData['shop_id'], "action" => "Wallet creation")
                );
            } else {
                $this->logger->info(
                    'Shop ' . $vendorData['shop_id'] . ' already disabled',
                    array('miraklId' => $vendorData['shop_id'], "action" => "Wallet creation")
                );
            }
        }
    }
62256
public function addTransaction(TPkgShopPaymentTransactionData $transactionData)
    {
        $transactionData->checkRequirements();

        $sTransactionType = $transactionData->getType();
        $amount = $transactionData->getTotalValue();
        $oContext = $transactionData->getContext();
        $iSequenceNumber = $transactionData->getSequenceNumber();

        $oTransactionType = $this->getTransactionTypeObject($sTransactionType);

        if (null === $iSequenceNumber) {
            $iSequenceNumber = $this->getNextTransactionSequenceNumber();
        }
        if (self::TRANSACTION_TYPE_CREDIT == $sTransactionType || self::TRANSACTION_TYPE_PAYMENT_REVERSAL === $sTransactionType) {
            $amount = -1 * $amount;
        }
        $aData = array(
            'shop_order_id' => $this->order->id,
            'data_extranet_user_id' => (null !== $oContext->getExtranetUser()) ? ($oContext->getExtranetUser(
            )->id) : (''),
            'cms_user_id' => (null !== $oContext->getCmsUser()) ? ($oContext->getCmsUser()->id) : (''),
            'datecreated' => date('Y-m-d H:i:s'),
            'ip' => $oContext->getIp(),
            'amount' => $amount,
            'context' => $oContext->getContext(),
            'pkg_shop_payment_transaction_type_id' => $oTransactionType->id,
            'sequence_number' => $iSequenceNumber,
            'confirmed' => '0',
        );

        $oTransaction = TdbPkgShopPaymentTransaction::GetNewInstance($aData);

        $oTransaction->AllowEditByAll(true);
        $oTransaction->SaveFieldsFast($aData);
        $oTransaction->AllowEditByAll(false);

        // add items
        $aItems = $transactionData->getItems();
        /** @var TPkgShopPaymentTransactionItemData $oItem */
        $itemAmountMultiplier = 1;
        if (self::TRANSACTION_TYPE_CREDIT == $sTransactionType || self::TRANSACTION_TYPE_PAYMENT_REVERSAL === $sTransactionType) {
            $itemAmountMultiplier = -1;
        }

        foreach ($aItems as $oItem) {
            $aData = array(
                'pkg_shop_payment_transaction_id' => $oTransaction->id,
                'amount' => ($itemAmountMultiplier * $oItem->getAmount()),
                'value' => $oItem->getValue(),
                'shop_order_item_id' => $oItem->getOrderItemId(),
                'type' => $oItem->getType(),
            );
            $oTransactionPosition = TdbPkgShopPaymentTransactionPosition::GetNewInstance($aData);
            $oTransactionPosition->AllowEditByAll(true);
            $oTransactionPosition->SaveFieldsFast($aData);
        }

        if (true === $transactionData->getConfirmed()) {
            $this->confirmTransaction($iSequenceNumber, $transactionData->getConfirmedTimestamp());
        }

        return $oTransaction;
    }
810456
public function createAddressData($order, \ShopgateAddress $address, $customerId)
    {
        $addressData                         = $this->buildMagentoAddressArray($order, $address);
        $addressData['save_in_address_book'] =
            (int)($customerId && !$this->addressHelper->exists($customerId, $addressData));

        $addressData = array_merge($addressData, $this->getCustomFields($address));

        return $addressData;
    }
224547
public function update($itemData, $createIfAbsent = false)
    {
        $newData = $this->preUpdate($itemData, $createIfAbsent);
        $result = $this->dataStore->update($newData, $createIfAbsent);

        return $this->postUpdate($result, $newData, $createIfAbsent);
    }
987894
public function create(array $searchData): string
    {
        $searchData = Validator::validateData($this->table, $searchData, $this->user);

        // pre-save search
        return $this->preSave($searchData);
    }
774670
protected function prepareDataPayPalUser($payPalData)
    {
        $userData = array();

        $fullName = oxNew(\OxidEsales\PayPalModule\Core\FullName::class, $payPalData->getShipToName());

        $userData['oxfname'] = $fullName->getFirstName();
        $userData['oxlname'] = $fullName->getLastName();

        $street = $this->splitShipToStreetPayPalUser($payPalData->getShipToStreet());
        $userData['oxstreet'] = $street['street'];
        $userData['oxstreetnr'] = $street['streetnr'];

        $userData['oxcity'] = $payPalData->getShipToCity();

        $country = oxNew(\OxidEsales\Eshop\Application\Model\Country::class);
        $countryId = $country->getIdByCode($payPalData->getShipToCountryCode());
        $userData['oxcountryid'] = $countryId;

        $stateId = '';
        if ($payPalData->getShipToState()) {
            $state = oxNew(\OxidEsales\Eshop\Application\Model\State::class);
            $stateId = $state->getIdByCode($payPalData->getShipToState(), $countryId);
        }
        $userData['oxstateid'] = $stateId;

        $userData['oxzip'] = $payPalData->getShipToZip();
        $userData['oxfon'] = $payPalData->getShipToPhoneNumber();
        $userData['oxaddinfo'] = $payPalData->getShipToStreet2();
        $userData['oxsal'] = $payPalData->getSalutation();
        $userData['oxcompany'] = $payPalData->getBusiness();

        return $userData;
    }
1137242
public function createStorage($storageData)
    {
        if (!is_array($storageData)) {
            $errorMessage = 'Storage data needs to be array';
            throw new \InvalidArgumentException($errorMessage);
        }

        /* Should we check the required keys (storage, type) in the array? */

        return $this->create('/storage', $storageData);
    }
620138
public function create($data, $paypalAccountId = null)
    {
        if (isset($paypalAccountId)) {
            return $this->client()->put($data, 'paypal-accounts/{paypalAccountId}', ['paypalAccountId' => $paypalAccountId]);
        }

        return $this->client()->post($data, 'paypal-accounts');
    }
727138
public function createToken(array $tokenData, $userId = null)
    {
        $userId = $this->_checkUserId($userId);
        return $this->getTokenLibrary()->createToken($tokenData, $userId);
    }