29. Stripe Testing | Form Forge - Build Forms with AI in Seconds
Download Log in

29. Stripe Testing

Developer Guide

Stripe CLI

bash
stripe login
stripe listen --forward-to http://localhost:8888/wp-json/formforge/v1/stripe/webhook
stripe trigger payment_intent.succeeded

Test Card Numbers

Card NumberResult
4242 4242 4242 4242Successful payment
4000 0000 0000 9995Payment declined
4000 0025 0000 3155Requires 3D Secure authentication

Verifying Payment Data in Submissions

php
global $wpdb;
$sub = $wpdb->get_row( $wpdb->prepare(
    "SELECT data FROM {$wpdb->prefix}formforge_submissions WHERE id = %d", 42
) );
$data = json_decode( $sub->data, true );

if ( isset( $data['_payment'] ) ) {
    $status = $data['_payment']['status'];     // "succeeded"
    $amount = $data['_payment']['amount'];     // 2500 (cents)
    $pi_id  = $data['_payment']['payment_id']; // "pi_3N1234567890"
}

The raw _payment bag stays in the database for webhook reconciliation, but user-facing surfaces should use FORMFORGE_Value_Formatter::payment_summary_fields() or submission_display_fields() so they show readable payment rows and never print internal keys such as __payment.

Forge AI Assistant Online

Hi! I'm the Form Forge AI assistant. Ask me anything about the plugin — setup, features, troubleshooting, or development.

Just now
Powered by Forge AI · Browse docs