Skip to content

Commit

Permalink
Link v3: Reintroduce bindings and data models (#4153)
Browse files Browse the repository at this point in the history
## Summary
Re-introduce Link data models and bindings.

## Motivation
Enable Link v3, prepare for View Controllers.

## Testing
Existing tests, will be exercised in VCs in the next PR.

## Changelog
No user-facing changes.
  • Loading branch information
davidme-stripe authored Oct 25, 2024
1 parent 3606eeb commit 46306d6
Show file tree
Hide file tree
Showing 31 changed files with 1,258 additions and 30 deletions.
6 changes: 5 additions & 1 deletion Stripe/StripeiOSTests/PayWithLinkButtonSnapshotTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -86,12 +86,16 @@ extension PayWithLinkButtonSnapshotTests {
fileprivate struct LinkAccountStub: PaymentSheetLinkAccountInfoProtocol {
let email: String
let isRegistered: Bool
var redactedPhoneNumber: String?
var isLoggedIn: Bool
}

fileprivate func makeAccountStub(email: String, isRegistered: Bool) -> LinkAccountStub {
return LinkAccountStub(
email: email,
isRegistered: isRegistered
isRegistered: isRegistered,
redactedPhoneNumber: "+1********55",
isLoggedIn: true
)
}

Expand Down
7 changes: 7 additions & 0 deletions StripeCore/StripeCore/Source/Analytics/STPAnalyticEvent.swift
Original file line number Diff line number Diff line change
Expand Up @@ -143,6 +143,13 @@ import Foundation
case linkPopupError = "link.popup.error"
case linkPopupLogout = "link.popup.logout"

// MARK: - Link 2FA
case link2FAStart = "link.2fa.start"
case link2FAStartFailure = "link.2fa.start_failure"
case link2FAComplete = "link.2fa.complete"
case link2FACancel = "link.2fa.cancel"
case link2FAFailure = "link.2fa.failure"

// MARK: - Link Misc
case linkAccountLookupComplete = "link.account_lookup.complete"
case linkAccountLookupFailure = "link.account_lookup.failure"
Expand Down
24 changes: 24 additions & 0 deletions StripePaymentSheet/StripePaymentSheet.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,10 @@
2EC9C94DD8D62E4F4EFC8AB8 /* IntentStatusPollerTest.swift in Sources */ = {isa = PBXBuildFile; fileRef = 990304EF35A0EE37DCE20D5B /* IntentStatusPollerTest.swift */; };
311AC53D6C76953E9B70148A /* ConsumerSession+PublishableKey.swift in Sources */ = {isa = PBXBuildFile; fileRef = E2D61B52BFA201D25E8F6428 /* ConsumerSession+PublishableKey.swift */; };
313F5F832B0BE5FD00BD98A9 /* Docs.docc in Sources */ = {isa = PBXBuildFile; fileRef = 313F5F822B0BE5FD00BD98A9 /* Docs.docc */; };
3147CEBB2CC07E960067B5E4 /* LinkUtils.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3147CEBA2CC07E960067B5E4 /* LinkUtils.swift */; };
3147CEC02CC080570067B5E4 /* LinkInMemoryCookieStore.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3147CEBD2CC080570067B5E4 /* LinkInMemoryCookieStore.swift */; };
3147CEC12CC080570067B5E4 /* LinkCookieStore.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3147CEBC2CC080570067B5E4 /* LinkCookieStore.swift */; };
3147CEC22CC080570067B5E4 /* LinkSecureCookieStore.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3147CEBE2CC080570067B5E4 /* LinkSecureCookieStore.swift */; };
31699A812BE183B30048677F /* DownloadManager.swift in Sources */ = {isa = PBXBuildFile; fileRef = 31699A802BE183B30048677F /* DownloadManager.swift */; };
31699A832BE183D40048677F /* DownloadManagerTest.swift in Sources */ = {isa = PBXBuildFile; fileRef = 31699A822BE183D40048677F /* DownloadManagerTest.swift */; };
316B33122B5F171C0008D2E5 /* UserDefaults+StripePaymentSheetTest.swift in Sources */ = {isa = PBXBuildFile; fileRef = 316B33112B5F171C0008D2E5 /* UserDefaults+StripePaymentSheetTest.swift */; };
Expand Down Expand Up @@ -429,6 +433,10 @@
2E2B99961C09E31383C9FCE9 /* mt */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = mt; path = mt.lproj/Localizable.strings; sourceTree = "<group>"; };
2E42F31D392C0AED757D6239 /* StripePaymentSheet.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = StripePaymentSheet.framework; sourceTree = BUILT_PRODUCTS_DIR; };
313F5F822B0BE5FD00BD98A9 /* Docs.docc */ = {isa = PBXFileReference; lastKnownFileType = folder.documentationcatalog; path = Docs.docc; sourceTree = "<group>"; };
3147CEBA2CC07E960067B5E4 /* LinkUtils.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = LinkUtils.swift; sourceTree = "<group>"; };
3147CEBC2CC080570067B5E4 /* LinkCookieStore.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = LinkCookieStore.swift; sourceTree = "<group>"; };
3147CEBD2CC080570067B5E4 /* LinkInMemoryCookieStore.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = LinkInMemoryCookieStore.swift; sourceTree = "<group>"; };
3147CEBE2CC080570067B5E4 /* LinkSecureCookieStore.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = LinkSecureCookieStore.swift; sourceTree = "<group>"; };
3168698F2C61B0F5EC1240FE /* sl-SI */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = "sl-SI"; path = "sl-SI.lproj/Localizable.strings"; sourceTree = "<group>"; };
31699A802BE183B30048677F /* DownloadManager.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = DownloadManager.swift; sourceTree = "<group>"; };
31699A822BE183D40048677F /* DownloadManagerTest.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = DownloadManagerTest.swift; sourceTree = "<group>"; };
Expand Down Expand Up @@ -836,6 +844,16 @@
path = AddressViewController;
sourceTree = "<group>";
};
3147CEBF2CC080570067B5E4 /* CookieStore */ = {
isa = PBXGroup;
children = (
3147CEBC2CC080570067B5E4 /* LinkCookieStore.swift */,
3147CEBD2CC080570067B5E4 /* LinkInMemoryCookieStore.swift */,
3147CEBE2CC080570067B5E4 /* LinkSecureCookieStore.swift */,
);
path = CookieStore;
sourceTree = "<group>";
};
319DFD940EAA6EA0A0F4E771 /* Services */ = {
isa = PBXGroup;
children = (
Expand Down Expand Up @@ -1059,6 +1077,7 @@
D0CE026F53D10DA10D7BC4E7 /* ConsumerSession.swift */,
4208AD2E0A737F5E0F00DE48 /* ConsumerSession+LookupResponse.swift */,
E2D61B52BFA201D25E8F6428 /* ConsumerSession+PublishableKey.swift */,
3147CEBF2CC080570067B5E4 /* CookieStore */,
981F958E99945A0318D47BBF /* PaymentDetails.swift */,
F1E614E8481658A027599A92 /* STPAPIClient+Link.swift */,
B662953D2C63F6C2007B6B14 /* PaymentDetailsShareResponse.swift */,
Expand Down Expand Up @@ -1225,6 +1244,7 @@
isa = PBXGroup;
children = (
B02DD1BA93CC92A187051B2F /* LinkAccountContext.swift */,
3147CEBA2CC07E960067B5E4 /* LinkUtils.swift */,
A1928BE9DFF116368B1A19DC /* LinkCookieKey.swift */,
);
path = Verification;
Expand Down Expand Up @@ -1959,6 +1979,9 @@
F3A34AD1CC2CBB899738C9D7 /* LinkInlineSignupElement.swift in Sources */,
56BB7C81AB3A24D3AD88A904 /* LinkInlineSignupView-CheckboxElement.swift in Sources */,
7479F814D1BC58A6B19F054C /* LinkInlineSignupView.swift in Sources */,
3147CEC02CC080570067B5E4 /* LinkInMemoryCookieStore.swift in Sources */,
3147CEC12CC080570067B5E4 /* LinkCookieStore.swift in Sources */,
3147CEC22CC080570067B5E4 /* LinkSecureCookieStore.swift in Sources */,
258A75AF2E5393186C8850CA /* LinkEmailElement.swift in Sources */,
EDE71E0BEDD94FB1101F3C10 /* FormElement+Link.swift in Sources */,
C346B534D57A952D4415ADFD /* Intent+Link.swift in Sources */,
Expand Down Expand Up @@ -2090,6 +2113,7 @@
B8A217F26AAEC592B9B0D2E1 /* CardScanButton.swift in Sources */,
436A212E364FD78C3745DDA3 /* CardScanningView.swift in Sources */,
19A6D9D9951E13377F305263 /* CircularButton.swift in Sources */,
3147CEBB2CC07E960067B5E4 /* LinkUtils.swift in Sources */,
6BA8D33A2B0C1FBF008C51FF /* CVCPaymentMethodInformationView.swift in Sources */,
B662953E2C63F6C2007B6B14 /* PaymentDetailsShareResponse.swift in Sources */,
F79DBDF42E5C0ED6B6DDC246 /* ConfirmButton.swift in Sources */,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,9 @@
/* Text for a button that, when tapped, displays another screen where the customer can add a new payment method */
"Add a payment method" = "Add a payment method";

/* Button prompt to add a bank account as a payment method. */
"Add bank account" = "Add bank account";

/* Title shown above a view allowing the customer to save their first card. */
"Add card" = "Add card";

Expand Down Expand Up @@ -284,9 +287,22 @@ is not supported by the merchant */
/* An error message. */
"The IBAN you entered is invalid, \"%@\" is not a supported country code." = "The IBAN you entered is invalid, \"%@\" is not a supported country code.";

/* Error message shown when the user enters an expired verification code. */
"The provided verification code has expired." = "The provided verification code has expired.";

/* Error message shown when the user enters an incorrect verification code. */
"The provided verification code is incorrect." = "The provided verification code is incorrect.";

/* Error message shown when the user enters an incorrect verification code too many times. */
"Too many attempts. Please try again in a few minutes." = "Too many attempts. Please try again in a few minutes.";

/* Title for a button that when tapped, updates a card brand. */
"Update" = "Update";

/* Title for a button that when tapped, presents a screen for updating a card. Also
the heading the screen itself. */
"Update card" = "Update card";

/* Title for a screen for updating a card brand. */
"Update card brand" = "Update card brand";

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,16 @@ extension String.Localized {
STPLocalizedString("Back", "Text for back button")
}

static var update_card: String {
STPLocalizedString(
"Update card",
"""
Title for a button that when tapped, presents a screen for updating a card. Also
the heading the screen itself.
"""
)
}

static var update_card_brand: String {
STPLocalizedString(
"Update card brand",
Expand Down
Loading

0 comments on commit 46306d6

Please sign in to comment.