etchfoda / tap-gosell
1.0.1
2021-05-04 16:33 UTC
Requires
- php: ^7.3|^8.0
- ext-json: *
- guzzlehttp/guzzle: ^7.0.1
Requires (Dev)
- php-coveralls/php-coveralls: v2.4.3
- phpunit/phpunit: ^5.7
- squizlabs/php_codesniffer: 3.6.0
README
GoSell PHP SDK
Official bindings to GoSell API.
Note: Detailed REST API request and response schema can be found at API Documentation
Requirements
This library supports PHP 5.6 and later.
Installation
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');
Manual Installation
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');
Getting Started
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