Skip to content

Commit 255d975

Browse files
committed
chore(demo): update for identity
1 parent 8693d4e commit 255d975

File tree

4 files changed

+53
-46
lines changed

4 files changed

+53
-46
lines changed

demo/angular/ios/App/Podfile.lock

Lines changed: 40 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -3,41 +3,41 @@ PODS:
33
- CapacitorCordova
44
- CapacitorCommunityStripe (8.0.0):
55
- Capacitor
6-
- StripeApplePay (~> 25.1.0)
7-
- StripePaymentSheet (~> 25.1.0)
6+
- StripeApplePay (~> 25.3)
7+
- StripePaymentSheet (~> 25.3)
88
- CapacitorCommunityStripeIdentity (8.0.0):
99
- Capacitor
10-
- StripeIdentity (~> 25.1.0)
10+
- StripeIdentity (~> 25.3)
1111
- CapacitorCommunityStripeTerminal (8.0.0):
1212
- Capacitor
13-
- StripeTerminal (= 4.7.3)
13+
- StripeTerminal (~> 4.7)
1414
- CapacitorCordova (8.0.0)
15-
- StripeApplePay (25.1.1):
16-
- StripeCore (= 25.1.1)
17-
- StripeCameraCore (25.1.1):
18-
- StripeCore (= 25.1.1)
19-
- StripeCore (25.1.1)
20-
- StripeIdentity (25.1.1):
21-
- StripeCameraCore (= 25.1.1)
22-
- StripeCore (= 25.1.1)
23-
- StripeUICore (= 25.1.1)
24-
- StripePayments (25.1.1):
25-
- StripeCore (= 25.1.1)
26-
- StripePayments/Stripe3DS2 (= 25.1.1)
27-
- StripePayments/Stripe3DS2 (25.1.1):
28-
- StripeCore (= 25.1.1)
29-
- StripePaymentSheet (25.1.1):
30-
- StripeApplePay (= 25.1.1)
31-
- StripeCore (= 25.1.1)
32-
- StripePayments (= 25.1.1)
33-
- StripePaymentsUI (= 25.1.1)
34-
- StripePaymentsUI (25.1.1):
35-
- StripeCore (= 25.1.1)
36-
- StripePayments (= 25.1.1)
37-
- StripeUICore (= 25.1.1)
15+
- StripeApplePay (25.3.0):
16+
- StripeCore (= 25.3.0)
17+
- StripeCameraCore (25.3.0):
18+
- StripeCore (= 25.3.0)
19+
- StripeCore (25.3.0)
20+
- StripeIdentity (25.3.0):
21+
- StripeCameraCore (= 25.3.0)
22+
- StripeCore (= 25.3.0)
23+
- StripeUICore (= 25.3.0)
24+
- StripePayments (25.3.0):
25+
- StripeCore (= 25.3.0)
26+
- StripePayments/Stripe3DS2 (= 25.3.0)
27+
- StripePayments/Stripe3DS2 (25.3.0):
28+
- StripeCore (= 25.3.0)
29+
- StripePaymentSheet (25.3.0):
30+
- StripeApplePay (= 25.3.0)
31+
- StripeCore (= 25.3.0)
32+
- StripePayments (= 25.3.0)
33+
- StripePaymentsUI (= 25.3.0)
34+
- StripePaymentsUI (25.3.0):
35+
- StripeCore (= 25.3.0)
36+
- StripePayments (= 25.3.0)
37+
- StripeUICore (= 25.3.0)
3838
- StripeTerminal (4.7.3)
39-
- StripeUICore (25.1.1):
40-
- StripeCore (= 25.1.1)
39+
- StripeUICore (25.3.0):
40+
- StripeCore (= 25.3.0)
4141

4242
DEPENDENCIES:
4343
- "Capacitor (from `../../node_modules/@capacitor/ios`)"
@@ -72,19 +72,19 @@ EXTERNAL SOURCES:
7272

7373
SPEC CHECKSUMS:
7474
Capacitor: 341ff7cf652ec695d1a8ebf604db448ac7b6d635
75-
CapacitorCommunityStripe: 1ceab53ae1225cd985fab575eac6931be9643614
76-
CapacitorCommunityStripeIdentity: 520f795fe558bc439d8b39ff9559466f1ff84846
77-
CapacitorCommunityStripeTerminal: cebf86072bc1f93d5fbca55818bdc3e39fe5832c
75+
CapacitorCommunityStripe: 898c3cbc1ed7eaca89912c753ff4e71727fe5bb9
76+
CapacitorCommunityStripeIdentity: 2ba6d7735a2f6693dd9433391a5af1d0eee8b775
77+
CapacitorCommunityStripeTerminal: bba520b2ce40a0a47ca3000bb8f511e8856b3081
7878
CapacitorCordova: 5dc3912d25ef770a3fe0f431bb65c9fbfa2e92f9
79-
StripeApplePay: 4428e5826335017151eeff87e9d36f6688eaa593
80-
StripeCameraCore: 3855662b0bb4c01186ee90e1d1c0bbe78e29dce9
81-
StripeCore: 76440c9bf61bd84149014414ced3470b8d94eb8e
82-
StripeIdentity: f32cd5bdd56eacc7070ac9ea8e93070e7410f358
83-
StripePayments: ace6def8949ed33434a5db2f8fdd184388636be5
84-
StripePaymentSheet: ec3dadf54b470250a40b3c5f7164641a0f1063c3
85-
StripePaymentsUI: 702926af8eae0901821907014ab90c72fc3eabab
79+
StripeApplePay: c8b3f41e861b8a66c04d8a8f2ccefe600902a645
80+
StripeCameraCore: a2570be68b35172fd3a8abde6ebcfa5f76afa213
81+
StripeCore: cf1039ef6983d1a2e23cca60bb9a772999581083
82+
StripeIdentity: e6c8ad7023536480db57c2c6ad3eb8607c0be4c4
83+
StripePayments: 259a5d5804e02f5515368d1763db42bdb4a5224a
84+
StripePaymentSheet: ee746e5b8047db07c91ba02bd883ceb228a902d4
85+
StripePaymentsUI: 01c922dd7b350d7209e821a8f5507d26c5711318
8686
StripeTerminal: b9e92913da8a08ff5c62af75056ad39bf8b02ac6
87-
StripeUICore: c3de64fb6ab7ef376128e862f6bc6817e0a964e9
87+
StripeUICore: 1dfad61e397dd8fe465f6c458adf4bda2591d8e1
8888

8989
PODFILE CHECKSUM: 4d7ec376ccecaff558058129ab933ca30f302b19
9090

demo/angular/src/app/identity/identity.page.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ import {
2525
IonListHeader,
2626
IonTitle,
2727
IonToolbar,
28+
Platform,
2829
} from '@ionic/angular/standalone';
2930

3031
const happyPathItems: ITestItems[] = [
@@ -94,6 +95,7 @@ const cancelPathItems: ITestItems[] = [
9495
export class IdentityPage {
9596
private http = inject(HttpClient);
9697
private helper = inject(HelperService);
98+
private platform = inject(Platform);
9799

98100
public eventItems: ITestItems[] = [];
99101
private readonly listenerHandlers: PluginListenerHandle[] = [];
@@ -167,6 +169,10 @@ export class IdentityPage {
167169
);
168170
});
169171

172+
if (this.platform.is('hybrid') && this.platform.is('android')) {
173+
await new Promise<void>(resolve => StripeIdentity.addListener(IdentityVerificationSheetEventsEnum.VerificationResult, () => resolve()));
174+
}
175+
170176
this.listenerHandlers.forEach((handler) => handler.remove());
171177
}
172178
}

packages/identity/android/src/main/java/com/getcapacitor/community/stripe/identity/StripeIdentity.kt

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -63,12 +63,13 @@ class StripeIdentity(
6363
ephemeralKeySecret!!
6464
)
6565
Logger.info("Presented Identity Verification Sheet")
66+
call.resolve()
6667
} catch (ex: Exception) {
6768
call.reject(ex.localizedMessage, ex)
6869
}
6970
}
7071

71-
fun onVerificationCompleted(bridge: Bridge) {
72+
fun onVerificationCompleted() {
7273
notifyListeners(IdentityVerificationSheetEvent.VerificationResult.webEventName,
7374
JSObject().put(
7475
"result",
@@ -77,7 +78,7 @@ class StripeIdentity(
7778
)
7879
}
7980

80-
fun onVerificationCancelled(bridge: Bridge) {
81+
fun onVerificationCancelled() {
8182
notifyListeners(IdentityVerificationSheetEvent.VerificationResult.webEventName,
8283
JSObject().put(
8384
"result",
@@ -86,7 +87,7 @@ class StripeIdentity(
8687
)
8788
}
8889

89-
fun onVerificationFailed(bridge: Bridge, errorMessage: String?) {
90+
fun onVerificationFailed(errorMessage: String?) {
9091
notifyListeners(IdentityVerificationSheetEvent.VerificationResult.webEventName,
9192
JSObject()
9293
.put(

packages/identity/android/src/main/java/com/getcapacitor/community/stripe/identity/StripeIdentityPlugin.kt

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -38,16 +38,16 @@ class StripeIdentityPlugin : Plugin() {
3838
if (verificationFlowResult is VerificationFlowResult.Completed) {
3939
// The user has completed uploading their documents.
4040
// Let them know that the verification is processing.
41-
implementation.onVerificationCompleted(bridge)
41+
implementation.onVerificationCompleted()
4242
} else if (verificationFlowResult is VerificationFlowResult.Canceled) {
4343
// The user did not complete uploading their documents.
4444
// You should allow them to try again.
45-
implementation.onVerificationCancelled(bridge)
45+
implementation.onVerificationCancelled()
4646
} else if (verificationFlowResult is VerificationFlowResult.Failed) {
4747
// If the flow fails, you should display the localized error
4848
// message to your user using throwable.getLocalizedMessage()
4949
val errorMessage = verificationFlowResult.throwable.localizedMessage;
50-
implementation.onVerificationFailed(bridge, errorMessage)
50+
implementation.onVerificationFailed(errorMessage)
5151
}
5252
}
5353
}

0 commit comments

Comments
 (0)