PHPackages                             uru/digital-river-models - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. uru/digital-river-models

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

uru/digital-river-models
========================

Models for Digital River/ MyCommerce integrations

1.1.4(1y ago)16.0kMITPHPPHP &gt;=8.1

Since May 27Pushed 1y ago1 watchersCompare

[ Source](https://github.com/Uru-ruru/digital-river-models)[ Packagist](https://packagist.org/packages/uru/digital-river-models)[ Docs](https://github.com/Uru-ruru/digital-river-models)[ RSS](/packages/uru-digital-river-models/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (10)Dependencies (2)Versions (12)Used By (0)

[![Latest Stable Version](https://camo.githubusercontent.com/63c0f3fff0970d94dc5697209b317c0d5ff0207d2a13e5a2c7b00fe71e512404/68747470733a2f2f706f7365722e707567782e6f72672f7572752f6469676974616c2d72697665722d6d6f64656c732f76)](//packagist.org/packages/uru/digital-river-models)[![Total Downloads](https://camo.githubusercontent.com/4c84405b86e00be9020ec6177756631185f170293200dabe4e48ac8a65f0862d/68747470733a2f2f706f7365722e707567782e6f72672f7572752f6469676974616c2d72697665722d6d6f64656c732f646f776e6c6f616473)](//packagist.org/packages/uru/digital-river-models)[![Latest Unstable Version](https://camo.githubusercontent.com/c4dae56a71128589fd15ba655df1f8dbe47daf28a9378662c791904d91144674/68747470733a2f2f706f7365722e707567782e6f72672f7572752f6469676974616c2d72697665722d6d6f64656c732f762f756e737461626c65)](//packagist.org/packages/uru/digital-river-models)[![License](https://camo.githubusercontent.com/245327e70d78bea7e236e2c4eb2c3151763c1ec6e86c859f69c668149daf9160/68747470733a2f2f706f7365722e707567782e6f72672f7572752f6469676974616c2d72697665722d6d6f64656c732f6c6963656e7365)](//packagist.org/packages/uru/digital-river-models)

Models for Digital River/ MyCommerce integrations
=================================================

[](#models-for-digital-river-mycommerce-integrations)

Описание API -

Установка
---------

[](#установка)

`composer require uru/digital-river-models`

Использование
-------------

[](#использование)

Модель для добавления или обновление продукта:

```
        $data = new Product();
        $data->setVendorId($vendorId);
        $data->setProductCode($productCode);
        $data->setName($fullName);
        $data->setProductType((new ProductTypeEnum(ProductTypeEnum::NMP)));
        $data->setStatus((new ProductStatusEnum(ProductStatusEnum::NSE)));
        $data->setDefaultCurrency(self::DEFAULT_CURRENCY);

        $priceScale = new PriceScale();
        $priceScale->setQuantityFrom(1);

        $price = new Price();
        $price->setCurrency(self::DEFAULT_CURRENCY);
        $price->setPrice($price);

        $priceScale->setPrices([$price]);
        $data->setPriceScale([$priceScale]);

        $productDescriptions = new ProductDescriptions();
        $productDescriptions->setLanguage('en');
        $productDescriptions->setDisplayName($fullName);
        $productDescriptions->setShortDescription($description);
        $productDescriptions->setFullDescription($fullDescription);

        $data->setDescriptions([$productDescriptions]);

        $exportRegulation = new ExportRegulations();
        $exportRegulation->setECCN((new ECCNIdEnum(ECCNIdEnum::EAR99)));
        $exportRegulation->setCountryOfOrigin('ru');
        if (!$licenseIsRequire) {
            $exportRegulation->setLicenseException((new LicenseExceptionsEnum(LicenseExceptionsEnum::NLR)));
        }
        $data->setExportRegulations($exportRegulation);

        $deliveryItems = new ProductDelivery();
        $deliveryItems->setDeliveryType((new DeliveryTypeEnum(DeliveryTypeEnum::EL5_KEY_INL)));
        $deliveryItems->setLicenseKeyDefinition((new LicenseKey($url)));

        $data->setProductDelivery([$deliveryItems]);

        // output to curl
        echo json_encode($data);
```

Модель корзины

```
        $data = new Cart();
        $items = [];

        foreach ($basket as $basketItem) {

        $item = new CartItem();
        $item->setProductId($product_id);
        $item->setQuantity((int)$basketItem->getQuantity());
        $item->setVendorId((int)$basketItem->vendor_id);
        $item->addAdditionals(["name" => static::ADDITIONAL_BASKET_ITEM_FIELD, "value" => $basketItem->getId(), "hidden" => true]);
        // optional dinamic price
        $dyn_price = $basketItem->getPrice() . self::DEFAULT_CURRENCY . ",N";
        $item->setDynPrice($dyn_price, $dyn_price_pass);

        $items[] = $item;
        }

        $data->setItems($items);

        $address = new Address();
        $address->setFirstName($user['NAME']);
        $address->setLastName($user['LAST_NAME']);
        $address->setCompany($user->getCompanyName());
        $address->setAddress($user->getBillingAddressFull());
        $address->setPostalCode($user->getBillingAddressCode());
        $address->setCity($user->getBillingAddressCity());
        $address->setEmail($user->getEmail());
        $address->setCountry($user->countryCode());

        $data->setBillingAddress($address);

        $address->setCountry($user->countryCode());
        $address->setAddress($user->getDeliveryAddressFull());
        $address->setPostalCode($user->getDeliveryAddressCode());
        $address->setCity($user->getDeliveryAddressCity());

        $data->setShippingAddress($address);

        $dr_shopper_id = $user->findDigitalRiverShopperId();
        if ($dr_shopper_id) {
            $data->setShopperId($dr_shopper_id);
        }

        $data->setDisplayCurrency(self::DEFAULT_CURRENCY);
        $data->setProtect('all');
        $data->setFinalPageUrl($url);

        // output to curl
        echo json_encode($data);
```

Модель для создание подписок в продукте

```
        ...
        $subscription = new Subscription();
        $subscription->setIntervalId(new IntervalIdEnum(IntervalIdEnum::YEA));

        $priceScale = new PriceScale();
        $priceScale->setQuantityFrom(1);

        $price = new Price();
        $price->setCurrency(self::DEFAULT_CURRENCY);
        $price->setPrice($price);

        $priceScale->setPrices([$price]);
        $subscription->setRenewalPriceScale([$priceScale]);

        $data->setSubscription($subscription);
        ...
```

###  Health Score

36

—

LowBetter than 82% of packages

Maintenance32

Infrequent updates — may be unmaintained

Popularity23

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity67

Established project with proven stability

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~112 days

Recently: every ~28 days

Total

11

Last Release

691d ago

Major Versions

0.0.1 → 1.0.02021-05-27

PHP version history (3 changes)0.0.1PHP ^7.4

1.0.4PHP &gt;=7.4

1.1.0PHP &gt;=8.1

### Community

Maintainers

![](https://www.gravatar.com/avatar/e794aee3f0708e0de3a85ba64d9222c200f609c61e6960ee130469377288c0ca?d=identicon)[Uru-ruru](/maintainers/Uru-ruru)

---

Top Contributors

[![Uru-ruru](https://avatars.githubusercontent.com/u/24267535?v=4)](https://github.com/Uru-ruru "Uru-ruru (18 commits)")

---

Tags

digitalrivermycommerce

###  Code Quality

TestsPHPUnit

Code StylePHP CS Fixer

### Embed Badge

![Health badge](/badges/uru-digital-river-models/health.svg)

```
[![Health](https://phpackages.com/badges/uru-digital-river-models/health.svg)](https://phpackages.com/packages/uru-digital-river-models)
```

###  Alternatives

[afragen/git-updater-lite

A simple class to integrate with Git Updater for standalone plugin/theme updates.

201.7k](/packages/afragen-git-updater-lite)[aluguest/ical-easy-reader

An easy to understood class, loads a "ics" format string and returns an array with the traditional iCal fields.

122.7k](/packages/aluguest-ical-easy-reader)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
