Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
40 commits
Select commit Hold shift + click to select a range
05b3be0
Initial commit
matt-evervault Jul 24, 2025
1f1f3b0
Checkpoint update android
matt-evervault Jul 28, 2025
8bdc0c3
Checkpoint generating with AI
matt-evervault Jul 29, 2025
2aa1db9
Checkpoint changes
matt-evervault Jul 29, 2025
4d9a083
Checkpoint Android builds
matt-evervault Jul 30, 2025
1dd61e8
try using spm dependency
matt-evervault Aug 1, 2025
71e8472
Temporarily reference local pod for iOS to unblock
matt-evervault Aug 4, 2025
8b21d16
Checkpoint ios updates
matt-evervault Aug 4, 2025
fc8f530
Checkpoint iOS compiles
matt-evervault Aug 4, 2025
b7a27c4
Checkpoint cleanup and updates
matt-evervault Aug 5, 2025
bc40f65
Checkpoint with Josh
matt-evervault Aug 13, 2025
779437b
Cleanup into separate components
matt-evervault Aug 14, 2025
cc66f13
Merge branch 'master' into feature/react-native-payment
matt-evervault Aug 20, 2025
c865a6c
Checkpoint cleanup native types
matt-evervault Aug 20, 2025
05caabb
Updates to ApplePay
matt-evervault Aug 20, 2025
6e350ed
updates to google pay
matt-evervault Aug 20, 2025
c06b9a4
Checkpoint compiling native interfaces
matt-evervault Aug 21, 2025
a5c9370
Merge branch 'master' into feature/react-native-payment
matt-evervault Aug 27, 2025
6eb9997
fix conflicts
joshpensky Aug 29, 2025
628c5ce
fix index.ios and index for ApplePayButton
joshpensky Aug 29, 2025
dfcf2f7
Update package.json
matt-evervault Aug 29, 2025
cdf18a3
set up ev pay pod
joshpensky Aug 29, 2025
8ac23f0
use esm build for react-native field
joshpensky Aug 29, 2025
f46825a
update to RN 0.77
joshpensky Aug 29, 2025
5907d66
update to RN 0.77
joshpensky Aug 29, 2025
1e1ab47
get native component building
joshpensky Sep 1, 2025
27fa2ef
Merge branch 'master' of https://github.com/evervault/evervault-js in…
joshpensky Sep 1, 2025
98e5ea3
get setter props working
joshpensky Sep 1, 2025
0a7c380
get on* event handlers working
joshpensky Sep 1, 2025
9252e66
move event handling to delegate
joshpensky Sep 1, 2025
ed5a431
checkpoint: complex objects
joshpensky Sep 2, 2025
9e99892
checkpoint: conversion
joshpensky Sep 2, 2025
a9a8129
top level props
joshpensky Sep 2, 2025
3722723
button rendering
joshpensky Sep 2, 2025
7928aa3
get event handling working
joshpensky Sep 2, 2025
1410393
support error codes, network support
joshpensky Sep 2, 2025
bdca7c6
didAuthorizePayment
joshpensky Sep 2, 2025
42755c8
prepare transaction
joshpensky Sep 2, 2025
1719a24
fix date range
joshpensky Sep 2, 2025
ebccaae
checkpoint
joshpensky Sep 2, 2025
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
37 changes: 24 additions & 13 deletions examples/expo/app.config.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,25 @@
const plugins = [];
const buildProperties = {
android: {
minSdkVersion: 26,
},
ios: {},
};

// Use local EvervaultPayment pod
if (process.env.EV_PAY_PATH) {
buildProperties.ios.extraPods = [
{
name: "EvervaultPayment",
path: process.env.EV_PAY_PATH,
},
];
}

// Enable ProGuard
if (process.env.PROGUARD_ENABLED === "true") {
buildProperties.android.enableProguardInReleaseBuilds = true;
buildProperties.android.enableShrinkResourcesInReleaseBuilds = true;

const extraProguardRules = `
# Rules for Evervault RN SDK
-keep class com.nativeevervault.** { *; }
Expand All @@ -16,17 +35,7 @@ if (process.env.PROGUARD_ENABLED === "true") {
# Rules for React Native Screens
-dontwarn org.slf4j.impl.StaticLoggerBinder
`;

plugins.push([
"expo-build-properties",
{
android: {
enableProguardInReleaseBuilds: true,
enableShrinkResourcesInReleaseBuilds: true,
extraProguardRules,
},
},
]);
buildProperties.android.extraProguardRules = extraProguardRules;

console.log("ProGuard enabled.");
}
Expand Down Expand Up @@ -62,7 +71,9 @@ module.exports = {
backgroundColor: "#ffffff",
},
],
...plugins,
// Customize build properties here:
// https://docs.expo.dev/versions/latest/sdk/build-properties/
["expo-build-properties", buildProperties],
],
},
};
5 changes: 3 additions & 2 deletions examples/expo/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,13 @@
"version": "1.0.8",
"scripts": {
"expo": "expo",
"build-lib": "pnpm --workspace-root react-native build",
"dev": "expo start --localhost",
"android": "rimraf android && expo run:android --no-bundler",
"android:release": "rimraf android && expo run:android --no-bundler --variant release",
"android:release": "pnpm android --variant release",
"android:release:proguard": "PROGUARD_ENABLED=true pnpm android:release",
"ios": "rimraf ios && expo run:ios --no-bundler",
"ios:release": "rimraf ios && expo run:ios --no-bundler --configuration Release"
"ios:release": "pnpm ios --configuration Release"
},
"dependencies": {
"@evervault/react-native": "workspace:*",
Expand Down
12 changes: 12 additions & 0 deletions examples/expo/src/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import { CardExample } from "@/src/screens/Card";
import { ThreeDSecureExample } from "@/src/screens/ThreeDSecure";
import { Image, ImageSourcePropType } from "react-native";
import { EncryptExample } from "@/src/screens/Encrypt";
import { PayExample } from "./screens/Pay";

function tabBarIcon(source: ImageSourcePropType) {
return function TabBarIcon({ color, size }: { color: string; size: number }) {
Expand All @@ -33,6 +34,17 @@ const Tabs = createBottomTabNavigator({
},
},

Pay: {
screen: PayExample,
options: {
headerShown: false,
title: "Pay",
tabBarIcon: tabBarIcon(
require("@/assets/images/icons/credit-card.png")
),
},
},

ThreeDSecure: {
screen: ThreeDSecureExample,
options: {
Expand Down
150 changes: 150 additions & 0 deletions examples/expo/src/screens/Pay.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,150 @@
import React, { useMemo, useState } from "react";
import {
View,
Text,
StyleSheet,
Alert,
SafeAreaView,
TextInput,
ScrollView,
} from "react-native";
import {
ApplePayAuthorizedPaymentEvent,
ApplePayButton,
} from "@evervault/react-native";
import { Code } from "@/src/ui/Code";

export const PayExample: React.FC = () => {
const [isProcessing, setIsProcessing] = useState(false);

// // Transaction details
// const transaction: Transaction = {
// currency: "USD",
// country: "US",
// paymentSummaryItems: [
// {
// label: "Premium Subscription",
// amount: "29.99",
// },
// ],
// };

const handlePrepareTransaction = () => {
console.log("Preparing transaction...");
// You can modify the transaction here if needed
};

const [event, setEvent] = useState<ApplePayAuthorizedPaymentEvent | null>(
null
);

return (
<ScrollView>
<SafeAreaView>
<View style={styles.container}>
<Text style={styles.title}>Evervault Apple Pay Example</Text>
<Text style={styles.subtitle}>iOS Integration</Text>

<View style={styles.paymentContainer}>
<ApplePayButton
appId="your-evervault-app-id"
merchantId="your-apple-merchant-id"
transaction={{
type: "oneOff",
country: "US",
currency: "USD",
paymentSummaryItems: [
{
label: "Test Item A",
amount: "100",
},
{
label: "Test Item B",
amount: "200",
},
],
requiredShippingContactFields: ["name", "emailAddress"],
shippingType: "delivery",
shippingMethods: [
{
label: "Test Method",
amount: "5",
detail: "This is a test method",
dateRange: {
start: "2025-01-01",
end: "2025-03-04",
},
},
],
}}
supportedNetworks={[
"visa",
"mastercard",
"amex",
"discover",
"jcb",
]}
buttonType="addMoney"
buttonStyle="automatic"
onAuthorizePayment={setEvent}
onFinishWithResult={console.log}
// transaction={transaction}
// onPrepareTransaction={handlePrepareTransaction}
style={{ width: "100%", height: 50 }}
/>
</View>

<Code>{event ? JSON.stringify(event, null, 2) : "null"}</Code>

{isProcessing && (
<Text style={styles.processingText}>Processing payment...</Text>
)}

<Text style={styles.note}>
Note: This example requires a valid Apple Merchant ID and Evervault
App ID. Make sure Apple Pay is enabled on your device.
</Text>
</View>
</SafeAreaView>
</ScrollView>
);
};

const styles = StyleSheet.create({
container: {
flex: 1,
padding: 20,
gap: 20,
backgroundColor: "#f5f5f5",
},
title: {
fontSize: 24,
fontWeight: "bold",
textAlign: "center",
marginBottom: 8,
},
subtitle: {
fontSize: 16,
textAlign: "center",
color: "#666",
marginBottom: 30,
},
paymentContainer: {
alignItems: "center",
},
paymentButton: {
width: "100%",
height: 50,
},
processingText: {
textAlign: "center",
color: "#007AFF",
marginBottom: 20,
},
note: {
fontSize: 12,
color: "#999",
textAlign: "center",
fontStyle: "italic",
},
});
26 changes: 23 additions & 3 deletions packages/react-native-v2/android/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -21,17 +21,37 @@ android {
namespace "com.nativeevervault"

defaultConfig {
minSdkVersion safeExtGet('minSdkVersion', 24)
minSdkVersion safeExtGet('minSdkVersion', 26)
targetSdkVersion safeExtGet('targetSdkVersion', 35)
}
}

repositories {
mavenCentral()
google()
maven { url 'https://jitpack.io' }
}

dependencies {
implementation 'com.facebook.react:react-native'
implementation 'com.evervault.sdk:evervault-core:1.1'
}
implementation("com.evervault.sdk:evervault-core:1.2")
implementation("com.evervault.sdk:evervault-inputs:2.0.0")
api("com.github.evervault:evervault-pay:android-v0.0.22")

// Compose dependencies
implementation platform('androidx.compose:compose-bom:2024.02.00')
implementation 'androidx.compose.ui:ui'
implementation 'androidx.compose.ui:ui-tooling-preview'
implementation 'androidx.compose.material3:material3'
implementation 'androidx.compose.runtime:runtime'
implementation 'androidx.activity:activity-compose:1.8.2'
implementation 'androidx.lifecycle:lifecycle-viewmodel-compose:2.7.0'
implementation 'com.google.code.gson:gson:2.10.1'

// Google Pay dependencies
implementation 'com.google.android.gms:play-services-wallet:19.3.0'

// Lifecycle dependencies
implementation 'androidx.lifecycle:lifecycle-viewmodel-ktx:2.7.0'
implementation 'androidx.lifecycle:lifecycle-runtime-ktx:2.7.0'
}
Loading
Loading