This is Client for memberpro API, provides you with simple and easy to use interface
composer require feldsam-inc/memberpro_api_client
require("vendor/autoload.php");
use MemberproApi\Memberpro_Api;
$endpoint = 'http://10.10.10.10:10/example.asmx';
$api = new Memberpro_Api($endpoint);
You can use the getPriceList like that:
$priceList = $api->getPriceList();
Which returns available items for sale and their ID, name, price, and vat
You will create an Order. it will automatically generates it's ID and space for items.
$email = "example@example.com";
$order = $api->createNewOrder($email);
$item = [
'id_item' => 100,
'name' => "test",
'code_vat'=> 0, //vat code 0-standard vat, 1-lowered vat, 2-without vat || 0 - 21%, 1 - 15%, 0 - 0%
'count' => 1,
'price_with_vat_per_each' => 100,
];
$rowID = $order->addItem($item);
Return the ID of item's row. ID can be used for editing, deleting items (not included yet).
$vouchers = $order->orderFinish();
It will mark Order as paid. return the vouchers, but you can get the vouchers anytime with using getVouchers method.
$voucher = $order->getVouchers();
CreateNewOrder: Creates and returns new Order object.
getPriceList: Get available items for sale.
addItem: Add item to the Order and returns it's row id (ID_RADEK).
orderFinish: Finish the order and return vouchers.
getVouchers: Return Vouchers.