Download the PHP package mitloshuk/moneycare without Composer
On this page you can find all versions of the php package mitloshuk/moneycare. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Please rate this library. Is it a good library?
Informations about the package moneycare
MoneyCare API library
About package
PHP library for MoneyCare API www.moneycare.su. MoneyCare is the leading credit platform for PIC lending in stores. More than 15 solutions from banks and MFIs in 2 minutes
How to start
- Install package via
composer require mitloshuk/moneycare
command or add"mitloshuk/moneycare": "^1.0"
to yourcomposer.json
- Init
MoneyCare/MoneyCare
via your DI or use$moneyCare = new \MoneyCare\MoneyCare($username, $password);
where$username
and$password
are your auth data to MoneyCare API
How to create order
- Create Order model like
$order = new \MoneyCare\Models\OrderCreation();
- Create Good model like
$good = new \MoneyCare\Models\Good();
- Add price and another optional parameters to Good model
$good->setPrice(100)->setTitle('Good Title');
. You can use any parameter from docs withset
prefix like->setBrand('This is my brand')
. - For predefined parameter
goodType
can use dictionaryGoodTypesDictionary
, for example\MoneyCare\Dictionaries\GoodTypesDictionary::PRODUCT
- Add required Good and point id to your Order model
$order->addGood($good)->setPointId('point');
. You can use any parameter from docs withset
prefix like->setGenerateForm(true)
. - Execute sending of order model with
$response = $moneyCare->createOrder($order);
- Check response
$response->getIsAccepted()
or get form url with$response->getFormUrl()
if you requested it on previous step - For predefined parameters
creditTypes
,formMode
andcreditStatus
you can useCreditTypesDictionary
,FormModesDictionary
andCreditTypesDictionary
dictionaries.
So ready example code of creating order will look like
How to update order
- Get
order id
of existing order via$orderId = $response->getOrderId();
of previous response - Create new Order model like
$newOrderData = new \MoneyCare\Models\OrderUpdating();
- Create one more Good model like
$good2 = new \MoneyCare\Models\Good();
- Add price and another optional parameters to Good model
$good2->setPrice(100)->setTitle('Good Title');
. - Add that Good to your new Order model
$newOrderData->addGood($good)
. - Execute sending of order model with
$moneyCare->updateOrder($orderId, $newOrderData);
- There are no response from request, but you can get info with
details request
Ready code of updating previous example order will look like
How to get order details
- Get
order id
of existing order via$orderId = $response->getOrderId();
of previous response - Execute request like
$response = $moneyCare->orderDetails($orderId);
- Response will contain all parameters from doc, they will accessible via their names with
get
prefix
Ready code of getting details
How to change order status
- Get
order id
of existing order via$orderId = $response->getOrderId();
of previous response - Execute request like
$moneyCare->updateStatus($orderId, OrderStatusesDictionary::DELIVERY);
- Second method argument is
orderStatus
and it predefined, so you can takeOrderStatusesDictionary
for simpler usage - There are no response from request, but you can get info with
details request
Ready code of getting details
All versions of moneycare with dependencies
PHP Build Version
Package Version
The package mitloshuk/moneycare contains the following files
Loading the files please wait ....