think.studio/laravel-myriad-soap
最新稳定版本:1.4.0
Composer 安装命令:
composer require think.studio/laravel-myriad-soap
包简介
Unofficial web integration with Myriad 5.1
关键字:
README 文档
README
Unofficial web integration with Myriad 5.1
Installation
You can install the package via composer:
composer require think.studio/laravel-myriad-soap php artisan vendor:publish --provider="MyriadSoap\ServiceProvider" --tag="config"
Usage
Direct call via facade:
$result = MyriadSoap::SOAP_getContactCommunications(['Contact_ID' => 1234]);
/*
[
"ContactCommunication" => [
"123456;12;01234 567 890;Yes",
"123457;14;me@test.co.uk;No",
],
]
*/
By default, Myriad lists responses has unexpected string lists responses, that why will be useful helper:
MyriadSoap::SOAP_getContactCommunications_List(['Contact_ID' => 1234], 3, 'ContactCommunication' /* Optional, as appropriate key, app will try guess itself */);
Or convert response to collection:
MyriadSoap::SOAP_getContactCommunications_Collection(['Contact_ID' => 1234], [ 'ContactCommunication_ID' => fn($i) => (int) $i, 'DespatchType_ID' => fn($i) => (int) $i, 'ContactCommunication', 'PrimaryUse' => fn($i) => $i == 'Yes', ], 'ContactCommunication' /* Optional, as appropriate key, app will try guess itself */);
To fetch not strings lists use AssocCollection call:
MyriadSoap::SOAP_getOrderPackageTypes_AssocCollection([], [ 'OrderPackageType_ID' => fn($i) => (int) tap($i, fn() => throw_if(! is_numeric($i), UnexpectedTypeException::class)), 'OrderPackageType' => fn($i) => (string) $i, 'OrderPackageCategory', ], 'OrderPackageType' /* Optional, as appropriate key, app will try guess itself */);
Using feature sets that allow you to wrap your own business logic (each class should extends FunctionsSet)
use MyriadSoap\Endpoints\FunctionsSet;
class MyContactFunctions extends FunctionsSet {
public function getContactCommunications( int $customerNumber ) {
return $this->api->call(
'SOAP_getContactCommunications',
[
'Contact_ID' => $customerNumber,
]
);
}
}
$result = MyriadSoap::functionsSet(MyContactFunctions::class)->getContactCommunications(1234);
Credits
统计信息
- 总下载量: 27
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 1
- 依赖项目数: 2
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2023-07-11