Skip to content

Commit

Permalink
Update data models
Browse files Browse the repository at this point in the history
  • Loading branch information
gt-prime committed Oct 1, 2024
1 parent 1974ddf commit 03a1f81
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -25,13 +25,13 @@ data class PrimerSettingsRN(

@Serializable
data class LocaleSettingsRN(
val languageCode: String? = null,
val languageCode: String? = null,
val localeCode: String? = null
)

@Serializable
data class PrimerPaymentMethodOptionsRN(
@SerialName("android")
@SerialName("android")
val androidSettingsRN: AndroidSettingsRN = AndroidSettingsRN(),
var cardPaymentOptions: PrimerCardPaymentOptionsRN = PrimerCardPaymentOptionsRN(),
var googlePayOptions: PrimerGooglePayOptionsRN = PrimerGooglePayOptionsRN(),
Expand Down Expand Up @@ -124,7 +124,7 @@ data class PrimerThreeDsOptionsRN(
val threeDsOptionsAndroid: PrimerThreeDsAndroidOptionsRN? = null
)

@Serializable
@Serializable
data class PrimerThreeDsAndroidOptionsRN(val threeDsAppRequestorUrl: String? = null)

@Serializable
Expand All @@ -133,10 +133,20 @@ data class PrimerGooglePayOptionsRN(
var allowedCardNetworks: List<String> =
listOf("AMEX", "DISCOVER", "JCB", "MASTERCARD", "VISA"),
var buttonStyle: GooglePayButtonStyle = GooglePayButtonStyle.BLACK,
@SerialName("isCaptureBillingAddressEnabled")
@SerialName("isCaptureBillingAddressEnabled")
var captureBillingAddress: Boolean = false,
@SerialName("isExistingPaymentMethodRequired")
var existingPaymentMethodRequired: Boolean = false
var existingPaymentMethodRequired: Boolean = false,
var shippingAddressParameters: PrimerGoogleShippingAddressParametersRN? = null,
@SerialName("requireShippingMethod")
var requireShippingMethod: Boolean = false,
@SerialName("emailAddressRequired")
var emailAddressRequired: Boolean = false
)

@Serializable
data class PrimerGoogleShippingAddressParametersRN(
var phoneNumberRequired: Boolean = false
)

@Serializable
Expand All @@ -153,8 +163,8 @@ data class PrimerStripeOptionsRN(
) {
@Serializable
data class MandateDataRN(
@SerialName("fullMandateText") val fullMandateText: String? = null,
@SerialName("fullMandateStringResourceName") val fullMandateStringResName: String? = null,
@SerialName("fullMandateText") val fullMandateText: String? = null,
@SerialName("fullMandateStringResourceName") val fullMandateStringResName: String? = null,
val merchantName: String? = null
)
}
Expand Down
9 changes: 8 additions & 1 deletion packages/sdk/src/models/PrimerSettings.ts
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,13 @@ interface IPrimerGooglePayOptions {
allowedCardNetworks?: string[];
isCaptureBillingAddressEnabled?: boolean;
isExistingPaymentMethodRequired?: boolean;
shippingAddressParameters?: IPrimerPrimerGoogleShippingAddressParameters;
requireShippingMethod?: boolean;
emailAddressRequired?: boolean;
}

interface IPrimerPrimerGoogleShippingAddressParameters {
isPhoneNumberRequired?: boolean;
}

interface IPrimerKlarnaOptions {
Expand Down Expand Up @@ -163,4 +170,4 @@ interface IPrimerStripeTemplateMandateData extends IPrimerStripeMandateData {
interface IPrimerFullMandateData extends IPrimerStripeMandateData {
fullMandateText: string;
fullMandateStringResourceName?: string;
}
}

0 comments on commit 03a1f81

Please sign in to comment.