WordPress.org

Ready to get started?Download WordPress

Forums

WP Stripe
[resolved] Customer name & description not being passed to Stripe (7 posts)

  1. rhiner402
    Member
    Posted 2 years ago #

    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/

  2. rhiner402
    Member
    Posted 2 years ago #

    The description requires a change to the wp_stripe_charge function

  3. rhiner402
    Member
    Posted 2 years ago #

    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;
    }
  4. rhiner402
    Member
    Posted 2 years ago #

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

  5. Noel Tock
    Human Made
    Plugin Author

    Posted 2 years ago #

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

  6. Noel Tock
    Human Made
    Plugin Author

    Posted 2 years ago #

    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

  7. Noel Tock
    Human Made
    Plugin Author

    Posted 2 years ago #

    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).

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic

Tags