Title: PMPro payment bug &#8211; simulation
Last modified: August 21, 2016

---

# PMPro payment bug – simulation

 *  Resolved [PeterBe_SK](https://wordpress.org/support/users/peterbe_sk/)
 * (@peterbe_sk)
 * [12 years, 2 months ago](https://wordpress.org/support/topic/pmpro-payment-bug-simulation/)
 * Dear PMPro team and users,
 * I still testing your plugin and I found this behavior. I customize “PMPro Require
   a Code to Register” for registration from one level to two levels (silver and
   gold). This is my customization: if($pmpro_level->id == 2 && empty($discount_code)
   || $pmpro_level->id == 3 && empty($discount_code))
    I set Payment by Check – 
   live/production.
 * 1. I generated discount codes: one code for one level (silver – free level), 
   second for next level (gold)
    2. On registration page for gold I used discount
   code for silver. 3. I seen message about incorrect discount code. 4. On registration
   page for gold I used correct discount code for gold. 5. Then I seen billing address
   fields (pmpro_billing_address_fields) and credit card payment gateway (pmpro_payment_information_fields)
   but I use “Payment by Check”. I left fields empty and successfully finish registration.
 * Same behavior is in sandbox/testing settings. Same behavior if I use random string
   for discount code in registration page.
 * Billing address is not problem, but credit card payment gateway is problem. It
   is on page membership-checkout.
 * Does anyone have a similar plugin behavior? How can I hide credit card payment
   gateway fields?
    Thank you very much.
 * [https://wordpress.org/plugins/paid-memberships-pro/](https://wordpress.org/plugins/paid-memberships-pro/)

Viewing 8 replies - 1 through 8 (of 8 total)

 *  [Great H-master](https://wordpress.org/support/users/great-h-master/)
 * (@great-h-master)
 * [12 years, 2 months ago](https://wordpress.org/support/topic/pmpro-payment-bug-simulation/#post-4688760)
 * Hello. Thank you for using Paid Memberships Pro. I have looked into this issue
   and was able to reproduce the error. I have also come up with a fix, but I will
   need to pass it by Jason, the lead developer. I don’t expect this process to 
   take long, we will likely be able to apply the fix over the next one or two days.
   Thank you for your patience and understanding.
 *  Thread Starter [PeterBe_SK](https://wordpress.org/support/users/peterbe_sk/)
 * (@peterbe_sk)
 * [12 years, 1 month ago](https://wordpress.org/support/topic/pmpro-payment-bug-simulation/#post-4688861)
 * Great H-master, thank you for info.
 * Could you provide information how repair this behavior, please?
 * Today I discovered same behavior if user renewing membership for next period.
 * Thank you very much for help.
    Peter
 *  [Great H-master](https://wordpress.org/support/users/great-h-master/)
 * (@great-h-master)
 * [12 years, 1 month ago](https://wordpress.org/support/topic/pmpro-payment-bug-simulation/#post-4688862)
 * Hello. Very strange, thought the issue had been resolved in one of the updates.
   Are you using the latest version? Just to make sure we understand, is the issue
   still present with the initial checkout or is it now only with renewal?
 *  Thread Starter [PeterBe_SK](https://wordpress.org/support/users/peterbe_sk/)
 * (@peterbe_sk)
 * [12 years, 1 month ago](https://wordpress.org/support/topic/pmpro-payment-bug-simulation/#post-4688863)
 * Thank you for information. I apologize for the inaccurate information.
    I have
   PMPro 1.7.8.1. I didn’t install new version because I didn’t find information
   about this issue in changelog. I will try update next few days and then send 
   information. Thank you again.
 *  [DivaVocals](https://wordpress.org/support/users/divavocals/)
 * (@divavocals)
 * [12 years, 1 month ago](https://wordpress.org/support/topic/pmpro-payment-bug-simulation/#post-4688864)
 * Speaking as someone who has supported free Zen Cart modules, sometimes not all
   the changes get “logged” in the changelog.. **lol** it happens..
 *  Thread Starter [PeterBe_SK](https://wordpress.org/support/users/peterbe_sk/)
 * (@peterbe_sk)
 * [12 years, 1 month ago](https://wordpress.org/support/topic/pmpro-payment-bug-simulation/#post-4688865)
 * After update to PMPro v1.7.9.1 (WP 3.8.2 Slovak) I have same behavior.
 * Situation: Payment method by check. In gold level first I add incorrect discount
   code. Then I add correct code and after I click Apply I see billing fields and
   credit card fields. In free silver level everything is ok.
 * What could be the problem?
 * Thank you for help.
 *  [Jessica Oros](https://wordpress.org/support/users/jessica-o/)
 * (@jessica-o)
 * [12 years, 1 month ago](https://wordpress.org/support/topic/pmpro-payment-bug-simulation/#post-4688867)
 * I just looked into and fixed this. Look for the bugfix in the next update of 
   PMPro but for now you can change this line: [https://github.com/strangerstudios/paid-memberships-pro/blob/dev/services/applydiscountcode.php#L101](https://github.com/strangerstudios/paid-memberships-pro/blob/dev/services/applydiscountcode.php#L101)
   
   to: `if(pmpro_isLevelFree($code_level) || pmpro_getOption("gateway") == "paypalexpress"
   || pmpro_getOption("gateway") == "paypalstandard" || pmpro_getOption('gateway')
   == 'check')` and that will still hide the billing info when a discount code is
   applied and the gateway is set to pay by check.
 * Hope that helps!
 *  Thread Starter [PeterBe_SK](https://wordpress.org/support/users/peterbe_sk/)
 * (@peterbe_sk)
 * [12 years, 1 month ago](https://wordpress.org/support/topic/pmpro-payment-bug-simulation/#post-4688868)
 * Your solutions works. Thank you very much.

Viewing 8 replies - 1 through 8 (of 8 total)

The topic ‘PMPro payment bug – simulation’ is closed to new replies.

 * ![](https://s.w.org/plugins/geopattern-icon/paid-memberships-pro_f1dacb.svg)
 * [Paid Memberships Pro - Content Restriction, User Registration, & Paid Subscriptions](https://wordpress.org/plugins/paid-memberships-pro/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/paid-memberships-pro/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/paid-memberships-pro/)
 * [Active Topics](https://wordpress.org/support/plugin/paid-memberships-pro/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/paid-memberships-pro/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/paid-memberships-pro/reviews/)

 * 8 replies
 * 4 participants
 * Last reply from: [PeterBe_SK](https://wordpress.org/support/users/peterbe_sk/)
 * Last activity: [12 years, 1 month ago](https://wordpress.org/support/topic/pmpro-payment-bug-simulation/#post-4688868)
 * Status: resolved