Prompt Details
Model
(claude-4-7-opus)
Token size
205
Example input
[task]: stripe_payment_flow
[payment_types]: one_time
[currency]: usd
[webhook_events]: payment_intent.succeeded
Example output
import Stripe from 'stripe';
const stripe = new Stripe(process.env.STRIPE_SECRET_KEY!, {
apiVersion: '2023-10-16',
});
export async function createPaymentIntent(
amount: number,
currency: string = 'usd',
customerId?: string
): Promise<Stripe.PaymentIntent> {
try {
return await stripe.paymentIntents.create({
amount,
currency,
customer: customerId,
automatic_payment_methods: { enabled: true },
}, {
idempotencyKey: `pi_${Date.now()}_${Math.random().toString(36).substr(2, 9)}`
});
} catch (error) {
if (error instanceof Stripe.errors.StripeError) {
throw new Error(`Stripe error: ${error.message}`);
}
throw error;
}
}
By purchasing this prompt, you agree to our terms of service
CLAUDE-4-7-OPUS
Production-grade Stripe integration prompt engineered for Claude's tool_use API. Generates complete payment flow — PaymentIntent creation, webhook signature verification, subscription management, refund processing, and idempotency keys. Structured JSON schema with chain-of-thought execution. Output is 95%+ parseable TypeScript every time. Not a chat prompt — a tool_use schema blueprint.
...more
Added 1 week ago
