From 322c473629c3353b4383bc0eb75e06a1242457a5 Mon Sep 17 00:00:00 2001 From: Brian Dorfman Date: Fri, 3 Nov 2017 14:54:15 -0700 Subject: [PATCH] Capitalize currency and country codes automatically Payment context already force-capitalizes the currency code before attempting to create a PKPaymentAuthorizationViewController but this other helper method does not. iOS now returns nil for PKPaymentAuthorizationViewController if the request you create it with has a lowercase currency code so capitalize it automatically for people. --- Stripe/STPAPIClient.m | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Stripe/STPAPIClient.m b/Stripe/STPAPIClient.m index c2a2dfdbd03..6fe75070786 100644 --- a/Stripe/STPAPIClient.m +++ b/Stripe/STPAPIClient.m @@ -414,8 +414,8 @@ + (PKPaymentRequest *)paymentRequestWithMerchantIdentifier:(NSString *)merchantI [paymentRequest setMerchantIdentifier:merchantIdentifier]; [paymentRequest setSupportedNetworks:[self supportedPKPaymentNetworks]]; [paymentRequest setMerchantCapabilities:PKMerchantCapability3DS]; - [paymentRequest setCountryCode:countryCode]; - [paymentRequest setCurrencyCode:currencyCode]; + [paymentRequest setCountryCode:countryCode.uppercaseString]; + [paymentRequest setCurrencyCode:currencyCode.uppercaseString]; return paymentRequest; }