This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
class Driver | |
{ | |
function __construct() | |
{ | |
try { | |
$DB_host = "localhost"; | |
$DB_user = "username"; | |
$DB_pass = "password"; | |
$DB_name = "DatabaseName"; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//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; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?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(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
class Driver | |
{ | |
function __construct() | |
{ | |
try { | |
$DB_host = "localhost"; | |
$DB_user = "username"; | |
$DB_pass = "password"; |