WordPress.org

Support

Support » Plugins and Hacks » [Resolved] [Plugin: WP Stripe] Customer name & description not being passed to Stripe

[Resolved] [Plugin: WP Stripe] Customer name & description not being passed to Stripe

  • This code fixes the Name.. but not the description. (from stripe-display.php)

    Stripe.createToken({
    number: jQuery(‘.card-number’).val(),
    cvc: jQuery(‘.card-cvc’).val(),
    exp_month: jQuery(‘.card-expiry-month’).val(),
    exp_year: jQuery(‘.card-expiry-year’).val(),
    name: jQuery(‘input[name=wp_stripe_name]’).val(),
    }, amount, stripeResponseHandler);

    http://wordpress.org/extend/plugins/wp-stripe/

Viewing 6 replies - 1 through 6 (of 6 total)
  • The description requires a change to the wp_stripe_charge function

    This puts the comment description into Stripe…

    function wp_stripe_charge($amount, $card, $description) {
        /* Currency - All amounts must be denominated in USD when creating charges with Stripe — the currency conversion happens automatically */
        $currency = 'usd';
        /* Card - Token from stripe.js is provided (not individual card elements)*/
        $opts = array(
            'card' => $card,
            'amount' => $amount,
            'currency' => $currency
        );
        if ( $description ) {
            $opts['description'] = $description;
        }
        $charge = Stripe_Charge::create($opts);
        return $charge;
    }

    Thanks to Brian Collins at Stripe.com for making these code suggestions!

    Plugin Author Noel Tock

    @noel_tock

    Thanks for that, I’ll be able to review the strip suggestions & enhancements next week when I’m done launching @happytables 🙂 Cheers, Noel

    Plugin Author Noel Tock

    @noel_tock

    Very cool, I’ll that info onto Stripe in my next release:

    Here’s an update: http://wordpress.org/support/topic/plugin-wp-stripe-official-wp-stripe-update

    Plugin Author Noel Tock

    @noel_tock

    Where did you find the bit about:

    name: jQuery(‘input[name=wp_stripe_name]’).val(),

    This doesn’t appear in the API documentation for creating a charge.

    Cheers

    Edit: Not in the part of creating a charge, but was in a sep. section for the token. Not sure if I’ll be adding it yet of creating customer objects (might do both).

Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘[Resolved] [Plugin: WP Stripe] Customer name & description not being passed to Stripe’ is closed to new replies.