File tree 1 file changed +10
-0
lines changed
1 file changed +10
-0
lines changed Original file line number Diff line number Diff line change @@ -130,12 +130,22 @@ jQuery( document ).ready( function( $ ) {
130
130
} ) ;
131
131
// Handle payment request button confirmation.
132
132
paymentRequest . on ( 'paymentmethod' , function ( event ) {
133
+ $ ( '#pmpro_btn-submit' ) . attr ( 'disabled' , 'disabled' ) ;
134
+ $ ( '#pmpro_processing_message' ) . css ( 'visibility' , 'visible' ) ;
135
+ $ ( '#payment-request-button' ) . hide ( ) ;
136
+ event . complete ( 'success' ) ;
133
137
pmpro_stripeResponseHandler ( event ) ;
134
138
} ) ;
135
139
}
136
140
}
137
141
} ) ;
138
142
143
+ // Find ALL <form> tags on your page
144
+ jQuery ( 'form' ) . submit ( function ( ) {
145
+ // Hide payment request button on form submit to prevent double charges.
146
+ jQuery ( '#payment-request-button' ) . hide ( ) ;
147
+ } ) ;
148
+
139
149
function stripeUpdatePaymentRequestButton ( ) {
140
150
jQuery . noConflict ( ) . ajax ( {
141
151
url : pmproStripe . restUrl + 'pmpro/v1/checkout_levels' ,
You can’t perform that action at this time.
0 commit comments