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

Store: Fix Apple Pay Option #21618

Merged
merged 2 commits into from
Jan 19, 2018
Merged
Changes from 1 commit
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
Prev Previous commit
Make sure we don't pass back empty values for payment_request options.
  • Loading branch information
justinshreve committed Jan 19, 2018
commit d3b08f35bf8ecd61df051923cec47520ed1b9d76
Original file line number Diff line number Diff line change
Expand Up @@ -26,11 +26,22 @@ export default {
settings[ settingKey ] = method.settings[ settingKey ].value;
} );

// Temporary Fix. See https://github.com/woocommerce/woocommerce-gateway-stripe/issues/459
// The API default when no choice has been chosen previously is a string 'default'
// If that gets passed back to the API, the entire request fails.
// Temporary Fix.
// If blank values get passed back to the API (see https://github.com/Automattic/wp-calypso/pull/21618#issuecomment-358844061)
// the API call will fail. We can remove this hack when we stop the payment method saving code from passing up all fields, and
// only pass edited fields. See https://github.com/Automattic/wp-calypso/issues/21670
if ( 'stripe' === method.id ) {
settings.payment_request_button_theme = 'dark';
if ( ! settings.payment_request_button_theme ) {
settings.payment_request_button_theme = 'dark';
}

if ( ! settings.payment_request_button_type ) {
settings.payment_request_button_type = 'buy';
}

if ( ! settings.payment_request_button_height ) {
settings.payment_request_button_height = '44';
}
}

const payload = {
Expand Down