Official bindings to GoSell API.
Note: Detailed REST API request and response schema can be found at API Documentation
This library supports PHP 5.6 and later.
The recommended way to install GoSell PHP SDK is through Composer:
composer require etchfoda/tap-gosell
To use the bindings, use Composer's autoload:
require_once('vendor/autoload.php');
If you do not wish to use Composer, you can download the latest release. Then, to use the bindings, include the vendor.php file.
require_once('/pathto/Tap-Payments/gosell-sdk-php/vendor/autoload.php');
use TapPayments\GoSell;
//set yout secret key here
GoSell::setPrivateKey("sk_test_XKokBfNWv6FIYuTMg5sLPjhJ");
$charge = GoSell\Charges::create(
[
"amount"=> 1,
"currency"=> "SAR",
"threeDSecure"=> true,
"save_card"=> false,
"description"=> "Test Description",
"statement_descriptor"=> "Sample",
"metadata"=> [
"udf1"=> "test 1",
"udf2"=> "test 2"
],
"reference"=> [
"transaction"=> "txn_0001",
"order"=> "ord_0001"
],
"receipt"=> [
"email"=> false,
"sms"=> true
],
"customer"=> [
"first_name"=> "test",
"middle_name"=> "test",
"last_name"=> "test",
"email"=> "test@test.com",
"phone"=> [
"country_code"=> "965",
"number"=> "50000000"
]
],
"source"=> [
"id"=> "src_all"
],
"post"=> [
"url"=> "http://your_website.com/post_url"
],
"redirect"=> [
"url"=> "http://your_website.com/redirect_url"
]
]
);
echo '<pre>';
var_dump($charge); //will give charge response as PHP object