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 | |
// Setup Start object | |
require_once('./lib/Start.php'); | |
Start::setApiKey("test_sec_k_e06df93760b388375e1f6"); | |
// Get the customer ID (usually from your Database) | |
$customer_id = "cus_abc123def456ghi789"; | |
// Charge the customer (can be done many times, over a period of time) | |
Start_Charge::create(array( |
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 | |
$token = $_POST['startToken']; // from Beautiful.js | |
require_once('./lib/Start.php'); | |
Start::setApiKey("test_sec_k_e06df93760b388375e1f6"); | |
Start_Customer::create(array( | |
"name" => "Abdullah Ahmed", | |
"email" => "abdullah@msn.com", | |
"card" => $token, |
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
AFHTTPRequestOperationManager *manager = [AFHTTPRequestOperationManager manager]; | |
manager.responseSerializer = [AFJSONResponseSerializer serializer]; | |
manager.responseSerializer.acceptableContentTypes = [NSSet setWithObject:@"text/json"]; | |
NSDictionary *params = @{@"amount":@"1000", | |
@"currency":@"aed", | |
@"email":@"ahmed@example.com",@"card[name]":@"Abdullah Ahmed", | |
@"card[number]":@"4242424242424242", | |
@"card[exp_month]":@"11", | |
@"card[exp_year]":@"2016", | |
@"card[cvc]":@"123", |
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
# From https://whitepayments.com/docs/api/#create-a-new-charge | |
<?php | |
require_once('./lib/White.php'); | |
White::setApiKey("test_sec_k_886a1e89b2c0abce479bf"); # Your secret API key | |
White_Charge::create(array( | |
"amount" => 1000, // 10.00 | |
"currency" => "aed", | |
"card" => "tok_38951a48cd3859d2dcf62957e1c9", # The token from White.js |
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
// White doesn't provide a C# wrapper library (yet), but you can still easily | |
// create charges by sending requests directly to the API. Here's how. | |
using RestSharp; | |
var client = new RestClient(); | |
client.BaseUrl = "https://api.start.payfort.com/"; | |
client.Authenticator = new HttpBasicAuthenticator("your_secret_api_key_here", ""); | |
var request = new RestRequest("charges", Method.POST); // send a POST request | |
request.AddParameter("currency", "AED"); |
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 | |
# Step 1: Create a customer from the card details | |
require_once("vendor/autoload.php"); | |
White::setApiKey("test_sec_k_886a1e89b2c0abce479bf"); // Secret key | |
$customer = White_Customer::create(array( | |
'name' => "John Doe", | |
'description' => "Amember customer", | |
'email' => "john.doe@example.com", | |
'card' => array( |
NewerOlder