豊富な機能を持つ構築済みの UI コンポーネント Stripe Elements を使用して、運営中のサイトに独自の決済フォームを設計しましょう。最新の Elements では、より多くの決済手段に対応可能です。独自の UI を使用して API ベースの組み込みを構築する場合は、お問い合わせください。
const stripe = require('stripe')('sk_test_BQokikJOvBiI2HlWgH4olfQ2');
// Create a payment intent to start a purchase flow.
let paymentIntent = await stripe.paymentIntents.create({
amount: 2000,
currency: 'usd',
description: 'My first payment',
});
// Complete the payment using a test card.
await stripe.paymentIntents.confirm(paymentIntent.id, {
payment_method: 'pm_card_mastercard',
});
Stripe.api_key = 'sk_test_BQokikJOvBiI2HlWgH4olfQ2'
# Create a payment intent to start a purchase flow.
payment_intent = Stripe::PaymentIntent.create({
amount: 2000,
currency: 'usd',
description: 'My first payment',
})
# Complete the payment using a test card.
Stripe::PaymentIntent.confirm(payment_intent.id, {
payment_method: 'pm_card_mastercard',
})
stripe.api_key = 'sk_test_BQokikJOvBiI2HlWgH4olfQ2'
# Create a payment intent to start a purchase flow.
payment_intent = stripe.PaymentIntent.create(
amount=2000,
currency='usd',
description='My first payment',
)
# Complete the payment using a test card.
stripe.PaymentIntent.confirm(
payment_intent.id,
payment_method='pm_card_mastercard',
)
stripe.Key = "sk_test_BQokikJOvBiI2HlWgH4olfQ2"
// Create a payment intent to start a purchase flow.
params := &stripe;.PaymentIntentParams{
Amount: stripe.Int64(2000),
Currency: stripe.String(string(stripe.CurrencyUSD)),
Description: stripe.String("My first payment"),
}
pi, _ := paymentintent.New(params)
// Complete the payment using a test card.
confirmParams := &stripe.PaymentIntentConfirmParams;{
PaymentMethod: stripe.String("pm_card_mastercard"),
}
paymentintent.Confirm(pi.ID, confirmParams)
$stripe = new \Stripe\StripeClient('sk_test_BQokikJOvBiI2HlWgH4olfQ2');
// Create a payment intent to start a purchase flow.
$payment_intent = $stripe->paymentIntents->create([
'amount' => 2000,
'currency' => 'usd',
'description' => 'My first payment',
]);
// Complete the payment using a test card.
$payment_intent->confirm([
'payment_method' => 'pm_card_mastercard',
]);
Stripe.apiKey = "sk_test_BQokikJOvBiI2HlWgH4olfQ2";
// Create a payment intent to start a purchase flow.
PaymentIntentCreateParams params =
PaymentIntentCreateParams.builder()
.setAmount(2000L)
.setCurrency("usd")
.setDescription("My first payment")
.build();
PaymentIntent paymentIntent = PaymentIntent.create(params);
// Complete the payment using a test card.
PaymentIntentConfirmParams confirmParams =
PaymentIntentConfirmParams.builder()
.setPaymentMethod("pm_card_mastercard")
.build();
paymentIntent.confirm(confirmParams);
StripeConfiguration.ApiKey = "sk_test_BQokikJOvBiI2HlWgH4olfQ2";
// Create a payment intent to start a purchase flow.
var options = new PaymentIntentCreateOptions
{
Amount = 2000,
Currency = "usd",
Description = "My first payment",
};
var service = new PaymentIntentService();
var paymentIntent = service.Create(options);
// Complete the payment using a test card.
var confirmOptions = new PaymentIntentConfirmOptions
{
PaymentMethod = "pm_card_mastercard",
};
service.Confirm(paymentIntent.Id, confirmOptions);
const stripe = require('stripe')('sk_test_BQokikJOvBiI2HlWgH4olfQ2');
// Create a payment intent to start a purchase flow.
let paymentIntent = await stripe.paymentIntents.create({
amount: 2000,
currency: 'usd',
description: 'My first payment',
});
// Complete the payment using a test card.
await stripe.paymentIntents.confirm(paymentIntent.id, {
payment_method: 'pm_card_mastercard',
});