Skip to content

Commit

Permalink
[skip actions] fix:resolve with an error if merchantDisplayName isn't…
Browse files Browse the repository at this point in the history
… provided (#1015)
  • Loading branch information
charliecruzan-stripe authored Jun 27, 2022
1 parent ff870bd commit 814d8b4
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,10 @@ class PaymentSheetFragment(
override fun onViewCreated(view: View, savedInstanceState: Bundle?) {
super.onViewCreated(view, savedInstanceState)
val merchantDisplayName = arguments?.getString("merchantDisplayName").orEmpty()
if (merchantDisplayName.isEmpty()) {
initPromise.resolve(createError(ErrorType.Failed.toString(), "merchantDisplayName cannot be empty or null."))
return
}
val customerId = arguments?.getString("customerId").orEmpty()
val customerEphemeralKeySecret = arguments?.getString("customerEphemeralKeySecret").orEmpty()
val countryCode = arguments?.getString("merchantCountryCode").orEmpty()
Expand Down
3 changes: 2 additions & 1 deletion src/types/PaymentSheet.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,11 @@ import type { BillingDetails } from './Common';
export type SetupParams = ClientSecretParams &
GooglePayParams &
ApplePayParams & {
/** Your customer-facing business name. On Android, this is required and cannot be an empty string. */
merchantDisplayName: string;
customerId?: string;
customerEphemeralKeySecret?: string;
customFlow?: boolean;
merchantDisplayName?: string;
style?: 'alwaysLight' | 'alwaysDark' | 'automatic';
returnURL?: string;
defaultBillingDetails?: BillingDetails;
Expand Down

0 comments on commit 814d8b4

Please sign in to comment.