Merge pull request #361 from woocommerce/pcp-125-fix-duplicated-button

Fix duplicated button and saved cards in Pay Now
This commit is contained in:
Emili Castells 2021-11-23 11:07:21 +01:00 committed by GitHub
commit 035cbe5957
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
6 changed files with 106 additions and 130 deletions

View file

@ -58,8 +58,8 @@ trait ProcessPaymentTrait {
* If customer has chosen a saved credit card payment.
*/
$saved_credit_card = filter_input( INPUT_POST, 'saved_credit_card', FILTER_SANITIZE_STRING );
$pay_for_order = filter_input( INPUT_GET, 'pay_for_order', FILTER_SANITIZE_STRING );
if ( $saved_credit_card && ! isset( $pay_for_order ) ) {
$change_payment = filter_input( INPUT_GET, 'woocommerce_change_payment', FILTER_SANITIZE_STRING );
if ( $saved_credit_card && ! isset( $change_payment ) ) {
$user_id = (int) $wc_order->get_customer_id();
$customer = new \WC_Customer( $user_id );