move rhailib to herolib
This commit is contained in:
@@ -0,0 +1,34 @@
|
||||
// Response handler for successful payment intent creation
|
||||
// This script is triggered when a payment intent is successfully created
|
||||
|
||||
print("✅ Payment Intent Created Successfully!");
|
||||
print("=====================================");
|
||||
|
||||
// The response data is available as 'parsed_data'
|
||||
if parsed_data != () {
|
||||
print(`Payment Intent ID: ${parsed_data.id}`);
|
||||
print(`Amount: ${parsed_data.amount}`);
|
||||
print(`Currency: ${parsed_data.currency}`);
|
||||
print(`Status: ${parsed_data.status}`);
|
||||
|
||||
if parsed_data.client_secret != () {
|
||||
print(`Client Secret: ${parsed_data.client_secret}`);
|
||||
}
|
||||
|
||||
// You can now trigger additional workflows
|
||||
print("🔄 Triggering next steps...");
|
||||
|
||||
// Example: Send confirmation email
|
||||
// eval_file("flows/send_payment_confirmation_email.rhai");
|
||||
|
||||
// Example: Update user account
|
||||
// eval_file("flows/update_user_payment_status.rhai");
|
||||
|
||||
// Example: Log analytics event
|
||||
// eval_file("flows/log_payment_analytics.rhai");
|
||||
|
||||
} else {
|
||||
print("⚠️ No response data received");
|
||||
}
|
||||
|
||||
print("🎉 Payment intent response processing complete!");
|
Reference in New Issue
Block a user