Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Exploratory PR to allow people to adjust the style of the mounted Stripe Elements fields. #3099

Merged
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions classes/gateways/class.pmprogateway_stripe.php
Original file line number Diff line number Diff line change
Expand Up @@ -776,6 +776,7 @@ public static function pmpro_checkout_after_preheader( $order ) {
'updatePaymentRequestButton' => apply_filters( 'pmpro_stripe_update_payment_request_button', true ),
'currency' => strtolower( $pmpro_currency ),
'accountCountry' => $stripe->get_account_country(),
'style' => apply_filters( 'pmpro_stripe_card_element_style', array() ),
);

if ( ! empty( $order ) ) {
Expand Down
6 changes: 3 additions & 3 deletions js/pmpro-stripe.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,9 @@ jQuery( document ).ready( function( $ ) {
* Set up default credit card fields.
*/
// Create Elements.
cardNumber = elements.create('cardNumber');
cardExpiry = elements.create('cardExpiry');
cardCvc = elements.create('cardCvc');
cardNumber = elements.create('cardNumber', { style: pmproStripe.style });
cardExpiry = elements.create('cardExpiry', { style: pmproStripe.style });
cardCvc = elements.create('cardCvc', { style: pmproStripe.style });

// Mount Elements. Ensure CC field is present before loading Stripe.
if ( $( '#AccountNumber' ).length > 0 ) {
Expand Down