No momento, esta página não está disponível em português
Get started
Set up your Adyen account and make a test payment.
This page guides you through setting up an Adyen account, making an API request for your first test payment, and installing one of our server-side libraries.
Get started with Adyen by creating a free test account. Your test account gives you access to the test Customer Area, which is a unified dashboard where you can manage your Adyen integration across regions and currencies.
When you sign up, you get:
One company account, YourCompany: This represents your core business entity with us.
One merchant account, YourCompanyECOM: This is where your transactions are processed, and where you receive the payout of funds. If needed for your business, you can create additional merchant accounts.
A test account lets you try out Adyen's integrations, but does not guarantee that you will be able to process live payments.
Based on your country of business, we enable some popular payment methods for your account. You can enable more payment methods at any time.
Go to Developers > API credentials, and select the API credential username for your integration, for example ws@Company.[YourCompanyAccount].
Under Server settings > Authentication select the API key tab.
Select Generate API key.
Select the copy icon and store your API key securely in your system.
Select Save changes.
Step 3: Make a test payment
To verify that your account is working correctly, let's make a test credit card payment for 10 EUR (1000 in minor units):
In the code below, replace YOUR_API_KEY with your API key, and YourCompanyECOM with the name of your merchant account. Make sure that you don't change the values of the encrypted fields — the request only works with the specific values below.
Copy the resulting code into your command line, and run the command.
Make a test payment with encrypted card details
curl https://checkout-test.adyen.com/v70/payments \
-H 'x-api-key: {hint:Your API key from your Customer Area.}YOUR_API_KEY{/hint}' \
-H 'content-type: application/json' \
-d '{
"merchantAccount": "{hint:Name of your merchant account.}YOUR_MERCHANT_ACCOUNT{/hint}",
"reference": "My first Adyen test payment",
"amount": {
"value": {hint:10 euros in minor units}1000{/hint},
"currency": "EUR"
},
"paymentMethod": {
"type": "scheme",
"encryptedCardNumber": "test_4111111111111111",
"encryptedExpiryMonth": "test_03",
"encryptedExpiryYear": "test_2030",
"encryptedSecurityCode": "test_737"
}
}'
If your account is set up correctly, you receive a response containing:
resultCode: Authorised
You have just made a successful test credit card payment of 10 EUR!
The transaction will also show up in your Customer Area, under Transactions > Payments.
Step 4: Install a library
We provide server-side API libraries in several languages. Because the libraries are connected to managed package systems (Composer, Gradle, Maven, npm, NuGet, PyPi, RubyGems) they are easy to include in your project. Installing a library is not required, but will save you development time, because a library:
Uses an API version that is up to date.
Has generated models to help you construct requests.
Sends the request to Adyen using its built-in HTTP client, so you don't have to create your own.
Set up the client as a singleton resource that you use for the API requests to Adyen and make a test payment request. For example, to make a test credit card payment for 10 EUR (1000 in minor units):
Make a test payment request using the API library
require 'adyen'
# Set up the client.
adyen = Adyen::Client.new
adyen.api_key = "YOUR_API_KEY"
adyen.env = :test
# Make a test POST /payments request.
response = adyen.checkout.payments({
:paymentMethod => {
:type => "scheme",
:encryptedCardNumber => "test_4111111111111111",
:encryptedExpiryMonth => "test_03",
:encryptedExpiryYear => "test_2030",
:encryptedSecurityCode => "test_737"
},
:amount => {
:currency => 'EUR',
:value => 1000
},
:reference => "YOUR_ORDER_REFERENCE",
:returnUrl => "https://your-company.com/checkout?shopperOrder=12xy..",
:merchantAccount => 'YOUR_MERCHANT_ACCOUNT'
})
You can find the latest version on GitHub. Alternatively, you can download the release on GitHub.
Using the library
Set up the client as a singleton resource that you use for the API requests to Adyen and make a test payment request. For example, to make a test credit card payment for 10 EUR (1000 in minor units):
Make a test payment request using the API library
// Set up the client.
Client client = new Client("YOUR_API_KEY", Environment.TEST);
// Make a test POST /payments request.
Checkout checkout = new Checkout(client);
PaymentsRequest paymentsRequest = new PaymentsRequest();
paymentsRequest.setMerchantAccount("YOUR_MERCHANT_ACCOUNT");
String encryptedCardNumber = "test_4111111111111111";
String encryptedExpiryMonth = "test_03";
String encryptedExpiryYear = "test_2030";
String encryptedSecurityCode = "test_737";
paymentsRequest.addEncryptedCardData(encryptedCardNumber,encryptedExpiryMonth, encryptedExpiryYear, encryptedSecurityCode);
Amount amount = new Amount();
amount.setCurrency("EUR");
amount.setValue(1000L);
paymentsRequest.setAmount(amount);
paymentsRequest.setReference("YOUR_ORDER_REFERENCE");
paymentsRequest.setReturnUrl("https://your-company.com/checkout?shopperOrder=12xy..");
PaymentsResponse paymentsResponse = checkout.payments(paymentsRequest);
Set up the client as a singleton resource that you use for the API requests to Adyen and make a test payment request. For example, to make a test credit card payment for 10 EUR (1000 in minor units):
Make a test payment request using the API library
// Set up the client.
$client = new \Adyen\Client();
$client->setEnvironment(\Adyen\Environment::TEST);
$client->setXApiKey("YOUR_API_KEY");
// Make a test POST /payments request.
$service = new \Adyen\Service\Checkout($client);
$params = array(
"paymentMethod" => array(
"type" => "scheme",
"encryptedCardNumber" => "test_4111111111111111",
"encryptedExpiryMonth" => "test_03",
"encryptedExpiryYear" => "test_2030",
"encryptedSecurityCode" => "test_737"
),
"amount" => array(
"currency" => "EUR",
"value" => 1000
),
"reference" => "YOUR_ORDER_REFERENCE",
"returnUrl" => "https://your-company.com/checkout?shopperOrder=12xy..",
"merchantAccount" => "YOUR_MERCHANT_ACCOUNT"
);
$result = $service->payments($params);
Set up the client as a singleton resource that you use for the API requests to Adyen and make a test payment request. For example, to make a test credit card payment for 10 EUR (1000 in minor units):
Make a test payment request using the API library
import Adyen
# Set up the client.
ady = Adyen.Adyen()
ady.payment.client.platform = "test"
ady.payment.client.xapikey = "YOUR_API_KEY"
# Make a test POST /payments request.
result = ady.checkout.payments({
'paymentMethod': {
'type': 'scheme',
'encryptedCardNumber': 'test_4111111111111111',
'encryptedExpiryMonth': 'test_03',
'encryptedExpiryYear': 'test_2030',
'encryptedSecurityCode': 'test_737'
},
'amount': {
'value': 1000,
'currency': 'EUR'
},
'reference': 'YOUR_ORDER_REFERENCE',
'returnUrl': 'https://your-company.com/checkout?shopperOrder=12xy..',
'merchantAccount': 'YOUR_MERCHANT_ACCOUNT'
})
Set up the client as a singleton resource that you use for the API requests to Adyen and make a test payment request. For example, to make a test credit card payment for 10 EUR (1000 in minor units):
Make a test payment request using the API library
// Set up the client.
var client = new Client ("YOUR_API_KEY", Adyen.Model.Enum.Environment.Test);
var checkout = new Checkout(client);
var details = new Adyen.Model.Checkout.DefaultPaymentMethodDetails{
Type = "scheme",
EncryptedCardNumber = "test_4111111111111111",
EncryptedExpiryMonth = "test_03",
EncryptedExpiryYear = "test_2030",
EncryptedSecurityCode = "test_737"
};
var amount = new Adyen.Model.Checkout.Amount("EUR", 1000);
var paymentsRequest = new Adyen.Model.Checkout.PaymentRequest
{
PaymentMethod = details,
Amount = amount,
Reference = "YOUR_ORDER_REFERENCE",
ReturnUrl = @"https://your-company.com/checkout?shopperOrder=12xy.."
};
var paymentsResponse = checkout.Payments(paymentsRequest);
Set up the client as a singleton resource that you use for the API requests to Adyen and make a test payment request. For example, to make a test credit card payment for 10 EUR (1000 in minor units):
Make a test payment request using the API library
const {Client, Config, CheckoutAPI} = require('@adyen/api-library');
// Set up the client.
const config = new Config();
config.apiKey = 'YOUR_API_KEY';
config.merchantAccount = 'YOUR_MERCHANT_ACCOUNT';
const client = new Client({ config });
client.setEnvironment("TEST");
// Make a test POST /payments request.
const checkout = new CheckoutAPI(client);
checkout.payments({
merchantAccount: config.merchantAccount,
paymentMethod: {
type: 'scheme',
encryptedCardNumber: "test_4111111111111111",
encryptedExpiryMonth: "test_03",
encryptedExpiryYear: "test_2030",
encryptedSecurityCode: "test_737"
},
amount: { currency: "EUR", value: 1000, },
reference: "YOUR_ORDER_NUMBER",
returnUrl: "https://your-company.com/checkout?shopperOrder=12xy.."
}).then(res => res);
Set up the client as a singleton resource that you use for the API requests to Adyen and make a test payment request. For example, to make a test credit card payment for 10 EUR (1000 in minor units):