Skip to content

Instantly share code, notes, and snippets.

View Kathure's full-sized avatar
🐢
Turtles all the way down

Kathure Kathure

🐢
Turtles all the way down
View GitHub Profile
@Kathure
Kathure / Driver.php
Created June 6, 2019 08:40
This Driver class is for saving User information from a USSD request
<?php
class Driver
{
function __construct()
{
try {
$DB_host = "localhost";
$DB_user = "username";
$DB_pass = "password";
$DB_name = "DatabaseName";
@Kathure
Kathure / VoiceIt.java
Created July 6, 2018 09:43
Voice It gateway Class
import org.apache.http.HttpEntity;
import org.apache.http.auth.AuthScope;
import org.apache.http.auth.UsernamePasswordCredentials;
import org.apache.http.client.CredentialsProvider;
import org.apache.http.client.HttpClient;
import org.apache.http.client.methods.HttpDelete;
import org.apache.http.client.methods.HttpGet;
import org.apache.http.client.methods.HttpPost;
import org.apache.http.client.methods.HttpPut;
import org.apache.http.entity.ContentType;
@Kathure
Kathure / VoiceApp.java
Last active July 12, 2020 20:52
Building a voice biometric
//Import the various libraries you will use.
import com.africastalking.*;
import com.africastalking.payment.recipient.Consumer;
import com.africastalking.payment.response.B2CResponse;
import com.africastalking.payment.response.CheckoutResponse;
import com.africastalking.voice.CallResponse;
import com.africastalking.voice.action.*;
import com.google.gson.Gson;
import java.io.IOException;
<?php
//connect to the db in order to store the user responses
require_once "vendor/autoload.php";
include 'Driver.php';
$driver = new Driver();
use AfricasTalking\SDK\AfricasTalking;
$username = "sandbox";
$apiKey = "your africa's Talking API Key";
$AT = new AfricasTalking($username, $apiKey);
$payments = $AT->payments();
<?php
class Driver
{
function __construct()
{
try {
$DB_host = "localhost";
$DB_user = "username";
$DB_pass = "password";