rarepixel-studio / webservice Goto Github PK
View Code? Open in Web Editor NEWOpilo web service client.
Opilo web service client.
سلام خسته نباشید
در قبال فراخوانی آدرس:
http://bpanel.opilo.com/ws/api/v2/inbox?username=UUU&password=PPP&min_id=0
مقدار زیر برگردانده شده است:
{"messages":[{"id":5471xx,"from":"09122xxxxx","to":"30006xxx","text":"Hello","received_at":"2016-11-08 13:51:06"}]}
در فایل src\V2\Bin\Parser.php
سطر 86 مشکل وجود دارد:
برای درج id از id خود array استفاده شده که مقدار معتبری نیست و بر اساس نسخه های مختلف php مقادیر متفاوتی خواهد داشت و مقدار آن با id برگردانده شده متفاوت است.
بنابراین لازم است در این سطر پارامتر $id به صورت زیر تغییر کند:
$item['id']
با سلام و خسته نباشید
چنتا مشکل هست
1-
use OpiloClient\Configs\Account;
use OpiloClient\Configs\ConnectionConfig;
use OpiloClient\V2\HttpClient;
...
$config = new ConnectionConfig('http://bpanel.opilo.com');
$account = new Account('YOUR_WEBSERVICE_USERNAME'), 'YOUR_WEBSERVICE_PASSWORD');
$client = new HttpClient($config, $account);
اکانت رو اشتباه فکر کنم نوشتین
این طوری باید باشه
Account('YOUR_WEBSERVICE_USERNAME', 'YOUR_WEBSERVICE_PASSWORD');
2-
تو کنترل پنل های معمولی نمیشه از این کومپوسر استفاده کرد
اگه میشه لطفا راه حلشو بگین
3-
نیاز به کومپوسر
Guzzle
هست اونو چجوری باید نصب کرد
تو هاست های معمولی که معولا همشون هم اشتراکی ان چجوری باید این پکیج ها رو نصب و استفاده کرد لطفا به ما که تازه کاریم یه لطفی بکنید یه مثال های کوچولو بزنید تا بتونیم استفاده کنیم
با تشکر
با سلام و خسته نباشید بلاخره بعد از مدت ها تونستم وب سرویس نسخه دو رو راه اندازی کنم
چنتا مشکل دیدم که امیدوارم حلشون کنید
1-
ما اینجا برای ارسال نتیجه رو توی متغیری به اسم
$responses
می ریزیم
use OpiloClient\Request\OutgoingSMS;
...
$message = new OutgoingSMS('3000***', '0912******', 'Hello World!');
$responses = $client->sendSMS($message);
بعد برای
parse
کردن از متغیر
$response
استفاده می کنیم که یدونه اس کم داره
use OpiloClient\Response\SMSId;
use OpiloClient\Response\SendError;
...
for ($i = 0; $i < count($response); $i++) {
if ($response[$i] instanceof SMSId) {
//store $response[$i]->id as the id of $messages[$i] in your database and schedule for checking status if needed
} else //$response[$i] instanceof SendError {
//It could be that you run out of credit, the line number is invalid, or the receiver number is invalid.
//To find out more examine $response[$i]->error and compare it against constants in SendError class
}
}
2-
برای بدست اوردن ای دی پیامی که ارسال شده ما دو تا راه داریم یکی استفاده از
متغییر ای دی که تو کلاس
OpiloClient\Response\SMSId
می تونیم پیداش کنیم
ولی نمی تونیم ازش استفاده کنیم ارور می ده چون
protected
یا باید پابلیک باشه یا پریویت که بشه چاپش کرد مقدارشو
و تابع
getsmsid
هم باید مشکلش برطرف شه
3-
برای چاپ خطا هم باز همین مشکل رو داریم
$response[$i]->error
اینم باز محافظت شدست و اجازه چاپ نمی ده
تو قسمت راهنمایی نوشتید که میشه استفاده کرد ولی خب نمی شه
4-من چون تازه کار بودم برای نصب کمپوسر خیلی اذیت شدم
و خیلی جاها مجبور بودم ساعت ها وقت بزارم
اگه مشکلی ندارید حاضرم کل اموزش رو در قالب یک فایل پی دی اف یا
اچ تی ام ال در بیارم که همه استفاده کنن
شما هم برای دانلود توی سایت بزارید
با تشکر
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.