tappayments / gosell
Installs: 2 513
Dependents: 1
Suggesters: 0
Security: 0
Stars: 10
Watchers: 4
Forks: 16
Open Issues: 3
Requires
- php: >=5.6.0
- guzzlehttp/guzzle: ^6.5
Requires (Dev)
- php-coveralls/php-coveralls: ^2.2
- phpunit/phpunit: ^5.7
- squizlabs/php_codesniffer: 3.*
This package is not auto-updated.
Last update: 2024-11-14 04:10:40 UTC
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 tappayments/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"=> "KWD",
"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