Skip to content

Commit 2821aae

Browse files
authored
Show Stripe Link button when email prefilled (#2388)
1 parent c1fc945 commit 2821aae

File tree

2 files changed

+11
-8
lines changed

2 files changed

+11
-8
lines changed

assets/css/stripe-link.css

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
height: 40px;
1111
background: no-repeat
1212
url( '../../client/payment-method-icons/link/icon.svg' );
13-
background-color: none;
13+
background-color: transparent !important;
1414
cursor: pointer;
1515
border: none;
1616
}

client/stripe-link/index.js

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -4,19 +4,22 @@ const showLinkButton = ( linkAutofill ) => {
44
const linkButtonTop =
55
jQuery( '#billing_email' ).position().top +
66
( jQuery( '#billing_email' ).outerHeight() - 40 ) / 2;
7-
jQuery( '.wcpay-stripelink-modal-trigger' ).show();
8-
jQuery( '.wcpay-stripelink-modal-trigger' ).css(
7+
jQuery( '.stripe-gateway-stripelink-modal-trigger' ).show();
8+
jQuery( '.stripe-gateway-stripelink-modal-trigger' ).css(
99
'top',
1010
linkButtonTop + 'px'
1111
);
1212
}
1313

1414
// Handle StripeLink button click.
15-
jQuery( '.wcpay-stripelink-modal-trigger' ).on( 'click', ( event ) => {
16-
event.preventDefault();
17-
// Trigger modal.
18-
linkAutofill.launch( { email: jQuery( '#billing_email' ).val() } );
19-
} );
15+
jQuery( '.stripe-gateway-stripelink-modal-trigger' ).on(
16+
'click',
17+
( event ) => {
18+
event.preventDefault();
19+
// Trigger modal.
20+
linkAutofill.launch( { email: jQuery( '#billing_email' ).val() } );
21+
}
22+
);
2023
};
2124

2225
const enableStripeLinkPaymentMethod = ( options ) => {

0 commit comments

Comments
 (0)