teleconcept / ivr-client
Teleconcept IVR 支付客户端
dev-master
2020-09-15 13:32 UTC
Requires
- php: >7.1
- ext-json: *
- guzzlehttp/guzzle: ^6.3
Requires (Dev)
- phpunit/phpunit: ^8
This package is not auto-updated.
Last update: 2024-09-20 05:34:18 UTC
README
创建并检查每分钟支付
//Start creation
$client = new \Teleconcept\Ivr\Client\Client('https://ivr-api.teleconcept.nl');
$request = new \Teleconcept\Ivr\Client\Request\Create\CreatePerMinutePayment($client);
$request
->setCountry('NLD')
->setIpAddress('192.168.0.1')
->setAdult(false)
->setReportUrl('https://private-607035-responsetesting.apiary-mock.com/report')
->setTariff('90')
->setDuration(120)
->setAuthorization('40924ec10f3aaed662fe62aac', 154135);
$response = $request->send();
echo $response->reference(); //string uuidv4
echo $response->payline(); //number to call
echo $response->pincode(); //pincode to enter
//Start check
$client = new \Teleconcept\Ivr\Client\Client('https://ivr-api.teleconcept.nl');
$checkRequest = new \Teleconcept\Ivr\Client\Request\Check\CheckPerMinutePayment($client);
$checkRequest
->setAuthorization('40924ec10f3aaed662fe62aac', 154135)
->setTransactionReference('ae3f8e04-c9d1-431f-a879-f8d1b067e1da');
$response = $checkRequest->send();
echo $response->status(); //string representation of the status of the call
创建并检查每通通话支付
$client = new \Teleconcept\Ivr\Client\Client('https://ivr-api.teleconcept.nl');
$request = new \Teleconcept\Ivr\Client\Request\Create\CreatePerCallPayment($client);
$request
->setCountry('NLD')
->setIpAddress('192.168.0.1')
->setAdult(false)
->setReportUrl('https://private-607035-responsetesting.apiary-mock.com/report')
->setTariff('90')
->setAuthorization('40924ec10f3aaed662fe62aac', 154135);
$response = $request->send();
echo $response->reference(); //string uuidv4
echo $response->payline(); //number to call
echo $response->pincode(); //pincode to enter
//Start check
$client = new \Teleconcept\Ivr\Client\Client('https://ivr-api.teleconcept.nl');
$checkRequest = new \Teleconcept\Ivr\Client\Request\Check\CheckPerCallPayment($client);
$checkRequest
->setAuthorization('40924ec10f3aaed662fe62aac', 154135)
->setTransactionReference('ae3f8e04-c9d1-431f-a879-f8d1b067e1da');
$response = $checkRequest->send();
echo $response->status(); //string representation of the status of the call
创建并检查按使用量支付
$client = new \Teleconcept\Ivr\Client\Client('https://ivr-api.teleconcept.nl');
$request = new \Teleconcept\Ivr\Client\Request\Create\CreatePerUsagePayment($client);
$request
->setCountry('NLD')
->setIpAddress('192.168.0.1')
->setAdult(false)
->setReportUrl('https://private-607035-responsetesting.apiary-mock.com/report')
->setTariff('90')
->setAuthorization('40924ec10f3aaed662fe62aac', 154135);
$response = $request->send();
echo $response->reference(); //string uuidv4
echo $response->payline(); //number to call
echo $response->pincode(); //pincode to enter
//Start check
$client = new \Teleconcept\Ivr\Client\Client('https://ivr-api.teleconcept.nl');
$checkRequest = new \Teleconcept\Ivr\Client\Request\Check\CheckPerUsagePayment($client);
$checkRequest
->setAuthorization('40924ec10f3aaed662fe62aac', 154135)
->setTransactionReference('ae3f8e04-c9d1-431f-a879-f8d1b067e1da');
$response = $checkRequest->send();
echo $response->status(); //string representation of the status of the call
消费 PIN 码输出支付
$client = new \Teleconcept\Ivr\Client\Client('https://ivr-api.teleconcept.nl');
$consumeRequest = new \Teleconcept\Ivr\Client\Request\Pincode\ConsumeRequest($client);
$consumeRequest
->setAuthorization('40924ec10f3aaed662fe62aac', 154135)
->setPincode('123456');
$response = $consumeRequest->send();
echo $response->reference(); //uuid string of the payment you found