/** * Display payment form. * * @param float $amount * @param $user * @param int $product_id * @param int $txn_id * @see https://gitlab.com/pronamic/memberpress/blob/1.2.4/app/lib/MeprBaseGateway.php#L230-233 */ public function display_payment_form($amount, $user, $product_id, $txn_id) { $product = new MeprProduct($product_id); $coupon = false; $txn = new MeprTransaction($txn_id); // Artifically set the price of the $prd in case a coupon was used if ($product->price !== $amount) { $coupon = true; $product->price = $amount; } $invoice = MeprTransactionsHelper::get_invoice($txn); echo $invoice; // WPCS: XSS ok. ?> <div class="mp_wrapper mp_payment_form_wrapper"> <form action="" method="post" id="payment-form" class="mepr-form" novalidate> <input type="hidden" name="mepr_process_payment_form" value="Y" /> <input type="hidden" name="mepr_transaction_id" value="<?php echo esc_attr($txn_id); ?> " /> <input type="hidden" name="pronamic_pay_memberpress_pay" value="1" /> <div class="mepr_spacer"> </div> <?php // Gateway $config_id = $this->settings->config_id; $gateway = Pronamic_WP_Pay_Plugin::get_gateway($config_id); if ($gateway) { echo $gateway->get_input_html(); // WPCS: XSS ok. } ?> <div class="mepr_spacer"> </div> <input type="submit" class="mepr-submit" value="<?php esc_attr_e('Pay', 'pronamic_ideal'); ?> " /> <img src="<?php echo esc_attr(admin_url('images/loading.gif')); ?> " style="display: none;" class="mepr-loading-gif" /> <?php MeprView::render('/shared/has_errors', get_defined_vars()); ?> <noscript><p class="mepr_nojs"><?php esc_html_e('JavaScript is disabled in your browser. You will not be able to complete your purchase until you either enable JavaScript in your browser, or switch to a browser that supports it.', 'pronamic_ideal'); ?> </p></noscript> </form> </div> <?php }
"><i class="mp-icon mp-icon-plus-circled mp-24"></i></a> </ol> <br/> </div> <div id="integration" class="mepr-options-hidden-pane"> <h3><?php _e('Payment Methods', 'memberpress'); ?> </h3> <div id="integrations-list"> <?php $objs = $mepr_options->payment_methods(); foreach ($objs as $pm_id => $obj) { if ($obj instanceof MeprBaseRealGateway) { require MeprView::file("/options/gateway"); } } ?> </div> <a href="" id="mepr-add-integration" title="<?php _e('Add a Payment Method', 'memberpress'); ?> "><i class="mp-icon mp-icon-plus-circled mp-24"></i></a> <?php //do_action('mepr-integration-options'); ?> <?php //MeprOptionsHelper::gateways_dropdown('gateway[' . time() . ']', ''); ?> <?php
?> <?php // This thing needs to be hidden in order for this to work so we do it explicitly as a style ?> <input type="text" id="mepr_no_val" name="mepr_no_val" class="mepr-form-input" autocomplete="off" /> <?php } ?> <?php do_action('mepr-user-signup-fields'); ?> <div class="mepr_spacer"> </div> <input type="submit" class="mepr-submit" value="<?php echo stripslashes($product->signup_button_text); ?> " /> <img src="<?php echo admin_url('images/loading.gif'); ?> " style="display: none;" class="mepr-loading-gif" /> <?php require MeprView::file('/shared/has_errors'); ?> </form> </div>