const pyncht = require('pyncht')('sk_test_pyn_9v3K…');
app.post('/pay', async (req, res) => {
// Amounts are in the smallest currency unit
const intent = await pyncht.paymentIntents.create({
amount: 2000,
currency: 'usd',
automatic_payment_methods: { enabled: true },
}, {
idempotencyKey: 'order_4f8b21',
});
res.json({ clientSecret: intent.client_secret });
});
import pyncht
pyncht.api_key = "sk_test_pyn_9v3K…"
# Amounts are in the smallest currency unit
intent = pyncht.PaymentIntent.create(
amount=2000,
currency="usd",
automatic_payment_methods={"enabled": True},
idempotency_key="order_4f8b21",
)
print(intent.client_secret)
require 'pyncht'
Pyncht.api_key = 'sk_test_pyn_9v3K…'
# Amounts are in the smallest currency unit
intent = Pyncht::PaymentIntent.create({
amount: 2000,
currency: 'usd',
automatic_payment_methods: { enabled: true },
}, {
idempotency_key: 'order_4f8b21',
})
puts intent.client_secret
$pyncht = new \Pyncht\PynchtClient('sk_test_pyn_9v3K…');
// Amounts are in the smallest currency unit
$intent = $pyncht->paymentIntents->create([
'amount' => 2000,
'currency' => 'usd',
'automatic_payment_methods' => ['enabled' => true],
], [
'idempotency_key' => 'order_4f8b21',
]);
echo $intent->client_secret;
pyncht.Key = "sk_test_pyn_9v3K…"
// Amounts are in the smallest currency unit
apm := &pyncht.PaymentIntentAutomaticPaymentMethodsParams{
Enabled: pyncht.Bool(true),
}
params := &pyncht.PaymentIntentParams{
Amount: pyncht.Int64(2000),
Currency: pyncht.String("usd"),
AutomaticPaymentMethods: apm,
}
params.SetIdempotencyKey("order_4f8b21")
pi, err := paymentintent.New(params)
Pyncht.apiKey = "sk_test_pyn_9v3K…";
// Amounts are in the smallest currency unit
var apm = AutomaticPaymentMethods.builder()
.setEnabled(true)
.build();
var params = PaymentIntentCreateParams.builder()
.setAmount(2000L)
.setCurrency("usd")
.setAutomaticPaymentMethods(apm)
.build();
var opts = RequestOptions.builder()
.setIdempotencyKey("order_4f8b21").build();
PaymentIntent intent = PaymentIntent.create(params, opts);
PynchtConfiguration.ApiKey = "sk_test_pyn_9v3K…";
// Amounts are in the smallest currency unit
var options = new PaymentIntentCreateOptions
{
Amount = 2000,
Currency = "usd",
AutomaticPaymentMethods = new() { Enabled = true },
};
var opts = new RequestOptions();
opts.IdempotencyKey = "order_4f8b21";
var service = new PaymentIntentService();
var intent = service.Create(options, opts);