mcheck / mcheck-php
MCheck SDK for PHP
1.0
2018-03-26 10:08 UTC
Requires
- php: >=5.3.2
This package is not auto-updated.
Last update: 2024-09-29 05:08:18 UTC
README
需求
为了使用此库,您需要安装 CURL 扩展或 HTTP_Request2
针对 CURL
php-curl
php-openssl
针对 HTTP_Request2
pear install HTTP_Request2-2.3.0
默认情况下,SDK 会首先检查 CURL 扩展,然后回退到 HTTP_Request2。您可以使用 MCheckRest 构造函数的第二个参数指定方法。
安装
SDK 可以使用 Composer 安装
composer require mcheck/mcheck-php
API 文档
MCheck API 基于 HTTP 方法,这使得将其集成到您的产品中变得容易。您可以使用任何编程语言的任何 HTTP 客户端与 API 交互。SDK 只是覆盖了在此处描述的 REST API。
SDK 基本用法
有关以下方法接受的全部属性,请查看文档。
//create an instance of `MCheckRest` use mcheck\MCheckRest; $api = new MCheckRest("secret key here"); //validate a number using "Missed sms method". (type can be : sms) $response = $api->RequestValidation(array("type" => "sms", "phone" => "+number_here")); //verify a pin for a certain request $response = $api->VerifyPin(array("id" => "request id here", "pin" => "5659")); //check validation status for a certain request $response = $api->ValidationStatus(array("id" => "request id here"));