Skip to content

Commit

Permalink
chore: update Stripe wrapper, include deviceInfo and scenario in clie…
Browse files Browse the repository at this point in the history
…nt session
  • Loading branch information
FlaviuExtPrimer committed Jul 23, 2024
1 parent c2ded20 commit c262c34
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 3 deletions.
2 changes: 1 addition & 1 deletion packages/example/android/app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@ dependencies {
implementation "io.primer:3ds-android:1.4.3"
implementation "io.primer:ipay88-my-android:1.0.3"
implementation "io.primer:klarna-android:1.0.4"
implementation "io.primer:stripe-android:1.1.0" // TODO TWS: use release version
implementation "io.primer:stripe-android:1.0.0"

implementation project(path: ':primerioreactnative')

Expand Down
16 changes: 16 additions & 0 deletions packages/example/src/models/IClientSessionRequestBody.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ export interface IClientSessionRequestBody {
customerId?: string;
orderId?: string;
currencyCode?: string;
metadata?: IClientSessionMetadata;
order?: IClientSessionOrder;
customer?: IClientSessionCustomer;
paymentMethod?: IClientSessionPaymentMethod;
Expand All @@ -17,6 +18,15 @@ export interface IClientSessionOrder {
lineItems?: Array<IClientSessionLineItem>
}

export interface IClientSessionMetadata {
scenario?: string;
deviceInfo?: IClientSessionDeviceInfo;
}

export interface IClientSessionDeviceInfo {
ipAddress?: string;
}

export interface IClientSessionCustomer {
emailAddress?: string;
mobileNumber?: string;
Expand Down Expand Up @@ -91,6 +101,12 @@ export let appPaymentParameters: AppPaymentParameters = {
customerId: `rn-customer-${makeRandomString(8)}`,
orderId: `rn-order-${makeRandomString(8)}`,
currencyCode: 'EUR',
metadata: {
scenario: 'STRIPE_ACH_ONEOFF',
deviceInfo : {
ipAddress: '127.0.0.1'
}
},
order: {
countryCode: 'DE',
lineItems: [
Expand Down
2 changes: 1 addition & 1 deletion packages/sdk/android/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,7 @@ dependencies {
api 'com.facebook.react:react-native:+'
implementation "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version"
implementation "org.jetbrains.kotlinx:kotlinx-serialization-json:1.5.1"
implementation 'io.primer:android:2.27.2-snapshot' // TODO TWS: use release version
implementation 'io.primer:android:2.27.6-snapshot'

testImplementation 'io.mockk:mockk:1.13.10'
testImplementation 'org.junit.jupiter:junit-jupiter-api:5.10.2'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,5 +21,5 @@ internal fun PrimerHeadlessUniversalCheckoutPaymentMethod.toPrimerRNHeadlessUniv
PrimerRNHeadlessUniversalCheckoutPaymentMethod(
paymentMethodType,
supportedPrimerSessionIntents,
paymentMethodManagerCategories.minus(PrimerPaymentMethodManagerCategory.CARD_COMPONENTS)
paymentMethodManagerCategories
)

0 comments on commit c262c34

Please sign in to comment.