strangerstudios / pmpro-payfast

Add the South African payment processing service PayFast as a gateway option for Paid Memberships Pro.
https://www.paidmembershipspro.com/add-ons/payfast-payment-gateway/
5 stars 13 forks source link

fix: Reject fixed-term discount codes for recurring membership levels #54

Closed gausam closed 4 years ago

gausam commented 4 years ago

Closes #53.

Alternatively, we could have the check made in a number of other places such as the pmpro_checkout_before_change_membership_level method.

My decision in going with the filter instead is because it offers the best UX and informs the user early on in the checkout about the invalidity of their discount code.

Are there any other gateways where the scenario we're solving here might actually be an accepted feature? I'm thinking around whether this would affect a multi-gateway set up in some way if this can be considered acceptable behavior to have a fixed-term discount on a recurring subscription.

andrewlimaza commented 4 years ago

We shouldn't reject it but adjust it to change the pricing accordingly for the level. By default other gateways allow changing from recurring to non-recurring payments. We should adjust the variables sent to PayFast when the discount code is applied. Ensure we don't pass recurring parameters etc.

gausam commented 4 years ago

Superseded by #55.