Results 1 to 6 of 6
Like Tree3Likes
  • 1 Post By jemcapon
  • 1 Post By jomarkosabel
  • 1 Post By dikiyforester

Thread: BUG: a customers default card is charged not the card they enter in the payment form

  1. #1
    Thread Starter
    jemcapon's Avatar
    Join Date
    Jan 2012
    Location
    New Zealand
    Posts
    83
    Thanks
    4
    Thanked 3 Times in 3 Posts

    BUG: a customers default card is charged not the card they enter in the payment form

    There is a serious bug in this plugin. When a user enters a credit card number in the Stripe form that is not necessarily the card that will be charged.

    If the user has previously entered as card number they are saved as a customer in stripe. Any future transactions they attempt will be charged against the card they entered the first time not the number the enter in the Stripe form.

    I have already reported this in this thread:
    https://forums.appthemes.com/stripe/...ed-code-98094/

    However nothing has been done about it and now the issue has arisen on our live site.

    This is what happened:
    1. The user entered a card number which was declined.
    2. The user then entered a different card number, this is also declined.
    3. The user then entered yet a different card number, this is also declined.

    Steps 2 and 3 aren't actually declined due to an issue with the card number entered, they a declined because your plugin is actually attempting to charge to the card in step 1.

    I have had a look at the code and if I change the following function:
    PHP Code:
    private function get_customer$user_id 0$options ) {

            
    $meta_key $this->get_user_meta_key$options );

            if ( 
    === $user_id ) {
                
    $user        wp_get_current_user();
                
    $customer_id get_user_meta$user->ID$meta_keytrue );
            } else {
                
    $user        get_user_by'id'$user_id );
                
    $customer_id get_user_meta$user_id$meta_keytrue );
            }

            
    // If the customer doesn't exist in Stripe, create it - otherwise get customer.
            
    if ( empty( $customer_id ) ) {
                 return 
    $this->create_customer$user$options );
            } else {
                 return 
    $customer_id;
            }

        } 
    To this:

    PHP Code:
    private function get_customer$user_id 0$options ) {

            
    $meta_key $this->get_user_meta_key$options );

            if ( 
    === $user_id ) {
                
    $user        wp_get_current_user();
                
    $customer_id get_user_meta$user->ID$meta_keytrue );
            } else {
                
    $user        get_user_by'id'$user_id );
                
    $customer_id get_user_meta$user_id$meta_keytrue );
            }
            return 
    $this->create_customer$user$options );
        } 
    the problem goes away because a new customer is always created in stripe instead of using the existing customer.

    I have made this change on our test site and would like to make this change on our live site (at least until the bug is fixed).

    Could you please let me know if there any repercussions of making this change?

    I think it will be fine but just want to double check before migrating the change to the live site
    x370znismo likes this.

  2. #2
    jomarkosabel's Avatar
    Join Date
    Mar 2009
    Location
    Philippines
    Posts
    40,978
    Thanks
    170
    Thanked 3,407 Times in 3,278 Posts
    You must be an AppThemes customer and logged in to view this response. Join today!
    x370znismo likes this.
    Please help our moderating team work more efficiently by not sending us support questions via PM. You can read more about how AppThemes support works here. However, you can send a PM to follow up and remind me if I missed your support request/thread.

    Thank you and have a nice day.

  3. #3
    Expired Customer x370znismo's Avatar
    Join Date
    Apr 2016
    Location
    Alabama
    Posts
    67
    Thanks
    16
    Thanked 2 Times in 2 Posts
    You must be an AppThemes customer and logged in to view this response. Join today!

  4. #4
    jomarkosabel's Avatar
    Join Date
    Mar 2009
    Location
    Philippines
    Posts
    40,978
    Thanks
    170
    Thanked 3,407 Times in 3,278 Posts
    You must be an AppThemes customer and logged in to view this response. Join today!
    Please help our moderating team work more efficiently by not sending us support questions via PM. You can read more about how AppThemes support works here. However, you can send a PM to follow up and remind me if I missed your support request/thread.

    Thank you and have a nice day.

  5. #5
    Thread Starter
    jemcapon's Avatar
    Join Date
    Jan 2012
    Location
    New Zealand
    Posts
    83
    Thanks
    4
    Thanked 3 Times in 3 Posts
    You must be an AppThemes customer and logged in to view this response. Join today!

  6. #6
    dikiyforester's Avatar
    Join Date
    Oct 2011
    Location
    Russian Federation
    Posts
    2,229
    Thanks
    89
    Thanked 593 Times in 491 Posts
    You must be an AppThemes customer and logged in to view this response. Join today!
    jomarkosabel likes this.
    arthemes.org - AppThemes plugins, tutorials, modifications and services

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Jomark PayPal default to Credit card
    By jenkinsjeremiah in forum JobRoller General Discussion
    Replies: 1
    Last Post: March 7th, 2014, 12:11 PM
  2. Dimitris Credit card payment option
    By carley75 in forum Help Using Vantage (Legacy)
    Replies: 9
    Last Post: December 19th, 2013, 11:20 AM
  3. Payment Gateways (Paypal / Credit Card Payment Options)
    By tintedsepia in forum ClassiPress General Discussion
    Replies: 1
    Last Post: July 7th, 2011, 09:46 AM