Optional configuration
Learn how to activate additional features for your checkout page.
Additional configuration is a useful way to capture extra information about your customers, and you can set up whichever fields best meet the needs of your implementation.
For example, a lot of merchants operate online stores and send things to their customers, so the shipping address is one of the most commonly-used optional fields. A billing address is required even more frequently, in cases where a transaction does not involve physical items.
The following examples include the other most common optional configurable payment fields. See the API reference for the full list of configurable fields.
-
Integrate Apple Pay and Google Pay wallets in addition to card payments.
-
Collect billing address, shipping details, and customer email
Use your checkout page to capture useful information about your customer.
-
Show your success page to customers.
-
Show detailed information about the order and taxes
Set up the information that you want to show to customers.
-
Add information about your company
Customize the checkout page title.
Add payment methods

By default, the checkout page supports only card payments. To enable Apple Pay and Google Pay wallets, pass "Card","Wallet" in paymentMethods, for example:
- cURL
- PowerShell
- Python
- C#
- PHP
# The sandbox API key passed in 'authorization' is public.
# Don't submit any personally identifiable information in any requests made with this key.
# Sign in to developer.dojo.tech to create your own private sandbox key and use that instead
# for secure testing.
curl -v --request POST \
--url https://api.dojo.tech/payment-intents \
--header 'Content-Type: application/json' \
--header 'Authorization: Basic sk_sandbox_c8oLGaI__msxsXbpBDpdtwJEz_eIhfQoKHmedqgZPCdBx59zpKZLSk8OPLT0cZolbeuYJSBvzDVVsYvtpo5RkQ' \
--header 'Version: 2024-02-05' \
--data '{
"amount": {
"value": 1000,
"currencyCode": "GBP"
},
"reference": "Order-0001",
"paymentMethods": [
"Card",
"Wallet"
]
}'
# The sandbox API key passed in '$publicSandboxKey' is public.
# Don't submit any personally identifiable information in any requests made with this key.
# Sign in to developer.dojo.tech to create your own private sandbox key and use that instead
# for secure testing.
$publicSandboxKey = "sk_sandbox_c8oLGaI__msxsXbpBDpdtwJEz_eIhfQoKHmedqgZPCdBx59zpKZLSk8OPLT0cZolbeuYJSBvzDVVsYvtpo5RkQ"
Invoke-WebRequest `
-Uri 'https://api.dojo.tech/payment-intents' `
-Method POST `
-Headers @{
"Version" = "2024-02-05"
"Authorization" = "Basic $publicSandboxKey"
} `
-ContentType 'application/json' `
-Body '{
"amount": {
"value": 1000,
"currencyCode": "GBP"
},
"reference": "Order-0001",
"paymentMethods": [
"Card",
"Wallet"
]
}'
# The sandbox API key passed in 'authorization' is public.
# Don't submit any personally identifiable information in any requests made with this key.
# Sign in to developer.dojo.tech to create your own private sandbox key and use that instead
# for secure testing.
import http.client
import json
conn = http.client.HTTPSConnection("api.dojo.tech")
payload = json.dumps({
"amount": {
"value": 1000,
"currencyCode": "GBP"
},
"reference": "Order 245",
"paymentMethods": ["Card","Wallet"]
})
headers = {
'Content-Type': "application/json",
'Version': "2024-02-05",
'Authorization': "Basic sk_sandbox_c8oLGaI__msxsXbpBDpdtwJEz_eIhfQoKHmedqgZPCdBx59zpKZLSk8OPLT0cZolbeuYJSBvzDVVsYvtpo5RkQ" # <-- Change to your secret key
}
conn.request("POST", "/payment-intents", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
conn.close()
// The sandbox API key passed in 'ApiKeyClientAuthorization' is public.
// Don't submit any personally identifiable information in any requests made with this key.
// Sign in to developer.dojo.tech to create your own private sandbox key and use that instead
// for secure testing.
var paymentIntentsClient = new PaymentIntentsClient(new HttpClient(), new ApiKeyClientAuthorization("sk_sandbox_c8oLGaI__msxsXbpBDpdtwJEz_eIhfQoKHmedqgZPCdBx59zpKZLSk8OPLT0cZolbeuYJSBvzDVVsYvtpo5RkQ"));
var result = await paymentIntentsClient.CreatePaymentIntentAsync(new CreatePaymentIntentRequest
{
Amount = new()
{
Value = 1000,
CurrencyCode = "GBP"
},
PaymentMethods = new List<PaymentMethod>() { PaymentMethod.Card , PaymentMethod.Wallet},
Reference = "Order-0001"
});
<?php
// The sandbox API key used in this example is public.
// Don't submit any personally identifiable information in any requests made with this key.
// Sign in to developer.dojo.tech to create your own private sandbox key and use that instead
// for secure testing.
namespace Test;
require_once "vendor/autoload.php";
use Dojo_PHP\ApiFactory;
use Dojo_PHP\Model\CreatePaymentIntentRequest;
use Dojo_PHP\Model\Money;
use Dojo_PHP\Model\PaymentMethod;
$apiKey = "sk_sandbox_c8oLGaI__msxsXbpBDpdtwJEz_eIhfQoKHmedqgZPCdBx59zpKZLSk8OPLT0cZolbeuYJSBvzDVVsYvtpo5RkQ";
$apiPaymentIntent = ApiFactory::createPaymentIntentApi($apiKey);
$req = new CreatePaymentIntentRequest();
$req->setDescription("Demo payment intent");
$req->setReference("Order - 1");
$money = new Money();
$money->setValue(1000);
$money->setCurrencyCode("GBP");
$req->setAmount($money);
$req->setPaymentMethods([PaymentMethod::CARD, PaymentMethod::WALLET]);
$pi = $apiPaymentIntent->paymentIntentsCreatePaymentIntent(\Dojo_PHP\API_VERSION, $req);
You must verify your domain for Apple Pay.
Collect billing address, shipping details, and customer email

You can add a form to collect billing address, shipping details, and the customer email to the checkout page, by
passing collectionRequired: true in config.billingAddress, config.shippingDetails, and config.customerEmail:
- cURL
- PowerShell
- Python
- C#
- PHP
# The sandbox API key passed in 'authorization' is public.
# Don't submit any personally identifiable information in any requests made with this key.
# Sign in to developer.dojo.tech to create your own private sandbox key and use that instead
# for secure testing.
curl -v --request POST \
--url https://api.dojo.tech/payment-intents \
--header 'Content-Type: application/json' \
--header 'Authorization: Basic sk_sandbox_c8oLGaI__msxsXbpBDpdtwJEz_eIhfQoKHmedqgZPCdBx59zpKZLSk8OPLT0cZolbeuYJSBvzDVVsYvtpo5RkQ' \
--header 'Version: 2024-02-05' \
--data '{
"amount": {
"value": 1000,
"currencyCode": "GBP"
},
"reference": "Order-0001",
"config": {
"customerEmail": {
"collectionRequired": true
},
"billingAddress": {
"collectionRequired": true
},
"shippingDetails": {
"collectionRequired": true
}
}
}'
# The sandbox API key passed in '$publicSandboxKey' is public.
# Don't submit any personally identifiable information in any requests made with this key.
# Sign in to developer.dojo.tech to create your own private sandbox key and use that instead
# for secure testing.
$publicSandboxKey = "sk_sandbox_c8oLGaI__msxsXbpBDpdtwJEz_eIhfQoKHmedqgZPCdBx59zpKZLSk8OPLT0cZolbeuYJSBvzDVVsYvtpo5RkQ"
Invoke-WebRequest `
-Uri 'https://api.dojo.tech/payment-intents' `
-Method POST `
-Headers @{
"Version" = "2024-02-05"
"Authorization" = "Basic $publicSandboxKey"
} `
-ContentType 'application/json' `
-Body '{
"amount": {
"value": 1000,
"currencyCode": "GBP"
},
"reference": "Order-0001",
"config": {
"customerEmail": {
"collectionRequired": true
},
"billingAddress": {
"collectionRequired": true
},
"shippingDetails": {
"collectionRequired": true
}
}
}'
# The sandbox API key passed in 'authorization' is public.
# Don't submit any personally identifiable information in any requests made with this key.
# Sign in to developer.dojo.tech to create your own private sandbox key and use that instead
# for secure testing.
import http.client
import json
conn = http.client.HTTPSConnection("api.dojo.tech")
payload = json.dumps({
"amount": {
"value": 1000,
"currencyCode": "GBP"
},
"reference": "Order 245",
"config": {
"billingAddress": {
"collectionRequired": True
},
"shippingDetails": {
"collectionRequired": True
},
"customerEmail": {
"collectionRequired": True
}
}
})
headers = {
'Content-Type': "application/json",
'Version': "2024-02-05",
'Authorization': "Basic sk_sandbox_c8oLGaI__msxsXbpBDpdtwJEz_eIhfQoKHmedqgZPCdBx59zpKZLSk8OPLT0cZolbeuYJSBvzDVVsYvtpo5RkQ" # <-- Change to your secret key
}
conn.request("POST", "/payment-intents", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
conn.close()
// The sandbox API key passed in 'ApiKeyClientAuthorization' is public.
// Don't submit any personally identifiable information in any requests made with this key.
// Sign in to developer.dojo.tech to create your own private sandbox key and use that instead
// for secure testing.
var paymentIntentsClient = new PaymentIntentsClient(new HttpClient(), new ApiKeyClientAuthorization("sk_sandbox_c8oLGaI__msxsXbpBDpdtwJEz_eIhfQoKHmedqgZPCdBx59zpKZLSk8OPLT0cZolbeuYJSBvzDVVsYvtpo5RkQ"));
var result = await paymentIntentsClient.CreatePaymentIntentAsync(new CreatePaymentIntentRequest
{
Amount = new()
{
Value = 1000,
CurrencyCode = "GBP"
},
Config = new()
{
BillingAddress = new() {CollectionRequired = true},
ShippingDetails = new() {CollectionRequired = true},
CustomerEmail = new() {CollectionRequired = true}
},
PaymentMethods = new List<PaymentMethod>() { PaymentMethod.Card , PaymentMethod.Wallet},
Reference = "Order-0001"
});
<?php
// The sandbox API key used in this example is public.
// Don't submit any personally identifiable information in any requests made with this key.
// Sign in to developer.dojo.tech to create your own private sandbox key and use that instead
// for secure testing.
namespace Test;
require_once "vendor/autoload.php";
use Dojo_PHP\ApiFactory;
use Dojo_PHP\Model\CreatePaymentIntentRequest;
use Dojo_PHP\Model\Money;
use Dojo_PHP\Model\CreatePaymentIntentRequestConfig;
use Dojo_PHP\Model\PaymentIntentConfigRequestCustomerEmail;
use Dojo_PHP\Model\PaymentIntentConfigRequestBillingAddress;
use Dojo_PHP\Model\PaymentIntentConfigRequestShippingDetails;
$apiKey = "sk_sandbox_c8oLGaI__msxsXbpBDpdtwJEz_eIhfQoKHmedqgZPCdBx59zpKZLSk8OPLT0cZolbeuYJSBvzDVVsYvtpo5RkQ";
$apiPaymentIntent = ApiFactory::createPaymentIntentApi($apiKey);
$req = new CreatePaymentIntentRequest();
$req->setDescription("Demo payment intent");
$req->setReference("Order - 1");
$money = new Money();
$money->setValue(1000);
$money->setCurrencyCode("GBP");
$req->setAmount($money);
$config = new CreatePaymentIntentRequestConfig();
$emailRequired = new PaymentIntentConfigRequestCustomerEmail();
$emailRequired->setCollectionRequired(true);
$billingAddressRequired = new PaymentIntentConfigRequestBillingAddress();
$billingAddressRequired->setCollectionRequired(true);
$shippingAddressRequired = new PaymentIntentConfigRequestShippingDetails();
$shippingAddressRequired->setCollectionRequired(true);
$config->setCustomerEmail($emailRequired);
$config->setBillingAddress($billingAddressRequired);
$config->setShippingDetails($shippingAddressRequired);
$req->setConfig($config);
$pi = $apiPaymentIntent->paymentIntentsCreatePaymentIntent(\Dojo_PHP\API_VERSION, $req);
Redirect to your success page
After your customer submits payment information on the checkout page, Dojo processes the payment and redirects the customer to the
success page. You can, alternately, redirect the customer to another page of your choice after payment, by passing the URL in
config.redirectUrl:
- cURL
- PowerShell
- Python
- C#
- PHP
# The sandbox API key passed in 'authorization' is public.
# Don't submit any personally identifiable information in any requests made with this key.
# Sign in to developer.dojo.tech to create your own private sandbox key and use that instead
# for secure testing.
curl -v --request POST \
--url https://api.dojo.tech/payment-intents \
--header 'Content-Type: application/json' \
--header 'Authorization: Basic sk_sandbox_c8oLGaI__msxsXbpBDpdtwJEz_eIhfQoKHmedqgZPCdBx59zpKZLSk8OPLT0cZolbeuYJSBvzDVVsYvtpo5RkQ' \
--header 'Version: 2024-02-05' \
--data '{
"amount": {
"value": 1000,
"currencyCode": "GBP"
},
"reference": "Order-0001",
"config": {
"redirectUrl": "http://mymerchantsite.com/checkout/success_pay"
}
}'
# The sandbox API key passed in '$publicSandboxKey' is public.
# Don't submit any personally identifiable information in any requests made with this key.
# Sign in to developer.dojo.tech to create your own private sandbox key and use that instead
# for secure testing.
$publicSandboxKey = "sk_sandbox_c8oLGaI__msxsXbpBDpdtwJEz_eIhfQoKHmedqgZPCdBx59zpKZLSk8OPLT0cZolbeuYJSBvzDVVsYvtpo5RkQ"
Invoke-WebRequest `
-Uri 'https://api.dojo.tech/payment-intents' `
-Method POST `
-Headers @{ "Version" = "2024-02-05"; "Authorization" = "Basic $publicSandboxKey" } `
-ContentType 'application/json' `
-Body '{
"amount": {
"value": 1000,
"currencyCode": "GBP"
},
"reference": "Order-0001",
"config": {
"redirectUrl": "http://mymerchantsite.com/checkout/success_pay"
}
}'
# The sandbox API key passed in 'authorization' is public.
# Don't submit any personally identifiable information in any requests made with this key.
# Sign in to developer.dojo.tech to create your own private sandbox key and use that instead
# for secure testing.
import http.client
import json
conn = http.client.HTTPSConnection("api.dojo.tech")
payload = json.dumps({
"amount": {
"value": 1000,
"currencyCode": "GBP"
},
"reference": "Order 245",
"config": {
"redirectUrl": "http://mymerchantsite.com/checkout/success_pay",
}
})
headers = {
'Content-Type': "application/json",
'Version': "2024-02-05",
'Authorization': "Basic sk_sandbox_c8oLGaI__msxsXbpBDpdtwJEz_eIhfQoKHmedqgZPCdBx59zpKZLSk8OPLT0cZolbeuYJSBvzDVVsYvtpo5RkQ" # <-- Change to your secret key
}
conn.request("POST", "/payment-intents", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
conn.close()
// The sandbox API key passed in 'ApiKeyClientAuthorization' is public.
// Don't submit any personally identifiable information in any requests made with this key.
// Sign in to developer.dojo.tech to create your own private sandbox key and use that instead
// for secure testing.
var paymentIntentsClient = new PaymentIntentsClient(new HttpClient(), new ApiKeyClientAuthorization("sk_sandbox_c8oLGaI__msxsXbpBDpdtwJEz_eIhfQoKHmedqgZPCdBx59zpKZLSk8OPLT0cZolbeuYJSBvzDVVsYvtpo5RkQ"));
var result = await paymentIntentsClient.CreatePaymentIntentAsync(new CreatePaymentIntentRequest
{
Amount = new()
{
Value = 1000,
CurrencyCode = "GBP"
},
Config = new()
{
RedirectUrl = new Uri("http://mymerchantsite.com/checkout/success_pay"),
},
Reference = "Order-0001"
});
<?php
// The sandbox API key used in this example is public.
// Don't submit any personally identifiable information in any requests made with this key.
// Sign in to developer.dojo.tech to create your own private sandbox key and use that instead
// for secure testing.
namespace Test;
require_once "vendor/autoload.php";
use Dojo_PHP\ApiFactory;
use Dojo_PHP\Model\CreatePaymentIntentRequest;
use Dojo_PHP\Model\Money;
use Dojo_PHP\Model\CreatePaymentIntentRequestConfig;
$apiKey = "sk_sandbox_c8oLGaI__msxsXbpBDpdtwJEz_eIhfQoKHmedqgZPCdBx59zpKZLSk8OPLT0cZolbeuYJSBvzDVVsYvtpo5RkQ";
$apiPaymentIntent = ApiFactory::createPaymentIntentApi($apiKey);
$req = new CreatePaymentIntentRequest();
$req->setDescription("Demo payment intent");
$req->setReference("Order - 1");
$money = new Money();
$money->setValue(1000);
$money->setCurrencyCode("GBP");
$req->setAmount($money);
$config = new CreatePaymentIntentRequestConfig();
$config->setRedirectUrl("http://mymerchantsite.com/checkout/success_pay");
$req->setConfig($config);
$pi = $apiPaymentIntent->paymentIntentsCreatePaymentIntent(\Dojo_PHP\API_VERSION, $req);
Show detailed information about the order and taxes

You can add information about each position in the order to the checkout page, to do it, pass this data to itemLines. Additionally, you can add information about any taxes or fees included in the order using taxLines. Item and tax amounts do not affect the payment intent amount.
To add total due to the checkout page, pass showTotal: true in config.details. This value will be the same as the payment intent amount.
- cURL
- PowerShell
- Python
- C#
- PHP
# The sandbox API key passed in 'authorization' is public.
# Don't submit any personally identifiable information in any requests made with this key.
# Sign in to developer.dojo.tech to create your own private sandbox key and use that instead
# for secure testing.
curl -v --request POST \
--url https://api.dojo.tech/payment-intents \
--header 'Content-Type: application/json' \
--header 'Authorization: Basic sk_sandbox_c8oLGaI__msxsXbpBDpdtwJEz_eIhfQoKHmedqgZPCdBx59zpKZLSk8OPLT0cZolbeuYJSBvzDVVsYvtpo5RkQ' \
--header 'Version: 2024-02-05' \
--data '{
"amount": {
"value": 1510,
"currencyCode": "GBP"
},
"reference": "Order-0001",
"itemLines": [
{
"id": "item 1",
"quantity": 4,
"caption": "Dog socks",
"amountTotal": {
"value": 400,
"currencyCode": "GBP"
}
},
{
"id": "item 5",
"quantity": 1,
"caption": "Dog bandana",
"amountTotal": {
"value": 600,
"currencyCode": "GBP"
}
}
],
"taxLines": [
{
"id": "vat",
"caption": "VAT",
"subCaption": "10%",
"amountTotal": {
"value": 10,
"currencyCode": "GBP"
}
},
{
"id": "delivery",
"caption": "Delivery",
"amountTotal": {
"value": 500,
"currencyCode": "GBP"
}
}
],
"config": {
"details": {
"showTotal": true
}
}
}'
# The sandbox API key passed in '$publicSandboxKey' is public.
# Don't submit any personally identifiable information in any requests made with this key.
# Sign in to developer.dojo.tech to create your own private sandbox key and use that instead
# for secure testing.
$publicSandboxKey = "sk_sandbox_c8oLGaI__msxsXbpBDpdtwJEz_eIhfQoKHmedqgZPCdBx59zpKZLSk8OPLT0cZolbeuYJSBvzDVVsYvtpo5RkQ"
Invoke-WebRequest `
-Uri 'https://api.dojo.tech/payment-intents' `
-Method POST `
-Headers @{ "Version" = "2024-02-05"; "Authorization" = "Basic $publicSandboxKey" } `
-ContentType 'application/json' `
-Body '{
"amount": {
"value": 1510,
"currencyCode": "GBP"
},
"reference": "Order-0001",
"itemLines": [
{
"id": "item 1",
"quantity": 4,
"caption": "Dog socks",
"amountTotal": {
"value": 400,
"currencyCode": "GBP"
}
},
{
"id": "item 5",
"quantity": 1,
"caption": "Dog bandana",
"amountTotal": {
"value": 600,
"currencyCode": "GBP"
}
}
],
"taxLines": [
{
"id": "vat",
"caption": "VAT",
"subCaption": "10%",
"amountTotal": {
"value": 10,
"currencyCode": "GBP"
}
},
{
"id": "delivery",
"caption": "Delivery",
"amountTotal": {
"value": 500,
"currencyCode": "GBP"
}
}
],
"config": {
"details": {
"showTotal": true
}
}
}'
# The sandbox API key passed in 'authorization' is public.
# Don't submit any personally identifiable information in any requests made with this key.
# Sign in to developer.dojo.tech to create your own private sandbox key and use that instead
# for secure testing.
import http.client
import json
conn = http.client.HTTPSConnection("api.dojo.tech")
payload = json.dumps({
"amount": {
"value": 1510,
"currencyCode": "GBP"
},
"reference": "Order 245",
"itemLines": [
{
"id": "item 1",
"quantity": 4,
"caption": "Dog socks",
"amountTotal": {
"value": 400,
"currencyCode": "GBP"
}
},
{
"id": "item 5",
"quantity": 1,
"caption": "Dog bandana",
"amountTotal": {
"value": 600,
"currencyCode": "GBP"
}
}
],
"taxLines": [
{
"id": "vat",
"caption": "VAT",
"subCaption": "10%",
"amountTotal": {
"value": 10,
"currencyCode": "GBP"
}
},
{
"id": "delivery",
"caption": "Delivery",
"amountTotal": {
"value": 500,
"currencyCode": "GBP"
}
}
],
"config": {
"details":
{
"showTotal": True
}
}
})
headers = {
'Content-Type': "application/json",
'Version': "2024-02-05",
'Authorization': "Basic sk_sandbox_c8oLGaI__msxsXbpBDpdtwJEz_eIhfQoKHmedqgZPCdBx59zpKZLSk8OPLT0cZolbeuYJSBvzDVVsYvtpo5RkQ" # <-- Change to your secret key
}
conn.request("POST", "/payment-intents", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
conn.close()
// The sandbox API key passed in 'ApiKeyClientAuthorization' is public.
// Don't submit any personally identifiable information in any requests made with this key.
// Sign in to developer.dojo.tech to create your own private sandbox key and use that instead
// for secure testing.
var paymentIntentsClient = new PaymentIntentsClient(new HttpClient(), new ApiKeyClientAuthorization("sk_sandbox_c8oLGaI__msxsXbpBDpdtwJEz_eIhfQoKHmedqgZPCdBx59zpKZLSk8OPLT0cZolbeuYJSBvzDVVsYvtpo5RkQ"));
var result = await paymentIntentsClient.CreatePaymentIntentAsync(new CreatePaymentIntentRequest
{
Amount = new()
{
Value = 1000,
CurrencyCode = "GBP"
},
ItemLines = new List<ItemLine>()
{
new() {AmountTotal = new() { Value=400, CurrencyCode="GBP" }, Caption = "Dog socks", Id="item 1", Quantity = 4},
new() {AmountTotal = new() { Value=600, CurrencyCode="GBP" }, Caption = "Dog bandana", Id="item 1", Quantity = 1}
},
Config = new()
{
Details = new()
{
ShowTotal = true
}
},
PaymentMethods = new List<PaymentMethod>() { PaymentMethod.Card , PaymentMethod.Wallet},
Reference = "Order-0001"
});
<?php
// The sandbox API key used in this example is public.
// Don't submit any personally identifiable information in any requests made with this key.
// Sign in to developer.dojo.tech to create your own private sandbox key and use that instead
// for secure testing.
namespace Test;
require_once "vendor/autoload.php";
use Dojo_PHP\ApiFactory;
use Dojo_PHP\Model\CreatePaymentIntentRequest;
use Dojo_PHP\Model\Money;
use Dojo_PHP\Model\CreatePaymentIntentRequestConfig;
use Dojo_PHP\Model\PaymentIntentConfigRequestDetails;
use Dojo_PHP\Model\ItemLine;
use Dojo_PHP\Model\TaxLine;
$apiKey = "sk_sandbox_c8oLGaI__msxsXbpBDpdtwJEz_eIhfQoKHmedqgZPCdBx59zpKZLSk8OPLT0cZolbeuYJSBvzDVVsYvtpo5RkQ";
$apiPaymentIntent = ApiFactory::createPaymentIntentApi($apiKey);
$req = new CreatePaymentIntentRequest();
$req->setDescription("Demo payment intent");
$req->setReference("Order - 1");
$money = new Money();
$money->setValue(1000);
$money->setCurrencyCode("GBP");
$req->setAmount($money);
$config = new CreatePaymentIntentRequestConfig();
$details = new PaymentIntentConfigRequestDetails();
$details->setShowTotal(true);
$config->setDetails($details);
$req->setConfig($config);
$itemLine1 = new ItemLine(
['id' => "item 1", 'quantity' => 4, 'caption' => "Dog socks", 'amount_total' => new Money(['value' => 400, 'currency_code' => "GBP"])]);
$itemLine2 = new ItemLine(
['id' => "item 5", 'quantity' => 1, 'caption' => "Dog bandana", 'amount_total' => new Money(['value' => 600, 'currency_code' => "GBP"])]);
$taxLine1 = new TaxLine(
['id' => "vat", 'caption' => "VAT", 'amount_total' => new Money(['value' => 10, 'currency_code' => "GBP"])]);
$taxLine2 = new TaxLine(
['id' => "delivery", 'caption' => "Delivery", 'amount_total' => new Money(['value' => 500, 'currency_code' => "GBP"])]);
$req->setItemLines([$itemLine1, $itemLine2]);
$req->setTaxLines([$taxLine1, $taxLine2]);
$pi = $apiPaymentIntent->paymentIntentsCreatePaymentIntent(\Dojo_PHP\API_VERSION, $req);
Add information about your company

You can customize the checkout page’s title, for example, by adding your company name.
To do this, pass a title in config.title. If you leave this parameter empty it will default to the trading name you provided to Dojo at sign-up.
- cURL
- PowerShell
- Python
- C#
- PHP
# The sandbox API key passed in 'authorization' is public.
# Don't submit any personally identifiable information in any requests made with this key.
# Sign in to developer.dojo.tech to create your own private sandbox key and use that instead
# for secure testing.
curl -v --request POST \
--url https://api.dojo.tech/payment-intents \
--header 'Content-Type: application/json' \
--header 'Authorization: Basic sk_sandbox_c8oLGaI__msxsXbpBDpdtwJEz_eIhfQoKHmedqgZPCdBx59zpKZLSk8OPLT0cZolbeuYJSBvzDVVsYvtpo5RkQ' \
--header 'Version: 2024-02-05' \
--data '{
"amount": {
"value": 1000,
"currencyCode": "GBP"
},
"reference": "Order-0001",
"config": {
"title": "The Company"
}
}'
# The sandbox API key passed in '$publicSandboxKey' is public.
# Don't submit any personally identifiable information in any requests made with this key.
# Sign in to developer.dojo.tech to create your own private sandbox key and use that instead
# for secure testing.
$publicSandboxKey = "sk_sandbox_c8oLGaI__msxsXbpBDpdtwJEz_eIhfQoKHmedqgZPCdBx59zpKZLSk8OPLT0cZolbeuYJSBvzDVVsYvtpo5RkQ"
Invoke-WebRequest `
-Uri 'https://api.dojo.tech/payment-intents' `
-Method POST `
-Headers @{
"Version" = "2024-02-05"
"Authorization" = "Basic $publicSandboxKey"
} `
-ContentType 'application/json' `
-Body '{
"amount": {
"value": 1000,
"currencyCode": "GBP"
},
"reference": "Order-0001",
"config": {
"title": "The Company"
}
}'
# The sandbox API key passed in 'authorization' is public.
# Don't submit any personally identifiable information in any requests made with this key.
# Sign in to developer.dojo.tech to create your own private sandbox key and use that instead
# for secure testing.
import http.client
import json
conn = http.client.HTTPSConnection("api.dojo.tech")
payload = json.dumps({
"amount": {
"value": 1000,
"currencyCode": "GBP"
},
"reference": "Order-0001",
"config": {
"title": "The Company",
}
})
headers = {
'Content-Type': "application/json",
'Version': "2024-02-05",
'Authorization': "Basic sk_sandbox_c8oLGaI__msxsXbpBDpdtwJEz_eIhfQoKHmedqgZPCdBx59zpKZLSk8OPLT0cZolbeuYJSBvzDVVsYvtpo5RkQ" # <-- Change to your secret key
}
conn.request("POST", "/payment-intents", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
conn.close()
// The sandbox API key passed in 'ApiKeyClientAuthorization' is public.
// Don't submit any personally identifiable information in any requests made with this key.
// Sign in to developer.dojo.tech to create your own private sandbox key and use that instead
// for secure testing.
var paymentIntentsClient = new PaymentIntentsClient(new HttpClient(), new ApiKeyClientAuthorization("sk_sandbox_c8oLGaI__msxsXbpBDpdtwJEz_eIhfQoKHmedqgZPCdBx59zpKZLSk8OPLT0cZolbeuYJSBvzDVVsYvtpo5RkQ"));
var result = await paymentIntentsClient.CreatePaymentIntentAsync(new CreatePaymentIntentRequest
{
Amount = new()
{
Value = 1000,
CurrencyCode = "GBP"
},
Config = new()
{
Title = "The Company"
},
Reference = "Order-0001"
});
<?php
// The sandbox API key used in this example is public.
// Don't submit any personally identifiable information in any requests made with this key.
// Sign in to developer.dojo.tech to create your own private sandbox key and use that instead
// for secure testing.
namespace Test;
require_once "vendor/autoload.php";
use Dojo_PHP\ApiFactory;
use Dojo_PHP\Model\CreatePaymentIntentRequest;
use Dojo_PHP\Model\Money;
use Dojo_PHP\Model\CreatePaymentIntentRequestConfig;
$apiKey = "sk_sandbox_c8oLGaI__msxsXbpBDpdtwJEz_eIhfQoKHmedqgZPCdBx59zpKZLSk8OPLT0cZolbeuYJSBvzDVVsYvtpo5RkQ";
$apiPaymentIntent = ApiFactory::createPaymentIntentApi($apiKey);
$req = new CreatePaymentIntentRequest();
$req->setDescription("Demo payment intent");
$req->setReference("Order - 1");
$money = new Money();
$money->setValue(1000);
$money->setCurrencyCode("GBP");
$req->setAmount($money);
$config = new CreatePaymentIntentRequestConfig();
$config->setTitle("The Company");
$req->setConfig($config);
$pi = $apiPaymentIntent->paymentIntentsCreatePaymentIntent(\Dojo_PHP\API_VERSION, $req);