Skip to content

Commit

Permalink
Add Error Message for Card Already Exists (#364)
Browse files Browse the repository at this point in the history
* add card already exists localizations

Co-authored-by: Sarah Koop <skoop@paypal.com>

* add missing translation

* add strings to internal localization references

Co-authored-by: Sarah Koop <skoop@paypal.com>

* update message and add test for duplicate payment method

Co-authored-by: Sarah Koop <skoop@paypal.com>

* Bump core SDK to 5.6.0

Signed-off-by: Jax DesMarais-Leder <jdesmarais@paypal.com>

* Update CHANGELOG

Signed-off-by: Jax DesMarais-Leder <jdesmarais@paypal.com>

* Update CHANGELOG

Signed-off-by: Jax DesMarais-Leder <jdesmarais@paypal.com>

* Remove broken test

Signed-off-by: Jax DesMarais-Leder <jdesmarais@paypal.com>

* bump core version to 5.6.1

Co-authored-by: Sarah Koop <skoop@paypal.com>

Co-authored-by: Jax DesMarais-Leder <jdesmarais@paypal.com>
  • Loading branch information
sarahkoop and jaxdesmarais authored Jan 18, 2022
1 parent 31b9018 commit 2df23e9
Show file tree
Hide file tree
Showing 29 changed files with 24 additions and 11 deletions.
14 changes: 7 additions & 7 deletions BraintreeDropIn.podspec
Original file line number Diff line number Diff line change
Expand Up @@ -24,13 +24,13 @@ Pod::Spec.new do |s|
s.source_files = "Sources/BraintreeDropIn/**/*.{h,m}"
s.public_header_files = "Sources/BraintreeDropIn/Public/BraintreeDropIn/*.h"
s.frameworks = "UIKit"
s.dependency "Braintree/ApplePay", "~> 5.5"
s.dependency "Braintree/Card", "~> 5.5"
s.dependency "Braintree/Core", "~> 5.5"
s.dependency "Braintree/UnionPay", "~> 5.5"
s.dependency "Braintree/PayPal", "~> 5.5"
s.dependency "Braintree/ThreeDSecure", "~> 5.5"
s.dependency "Braintree/Venmo", "~> 5.5"
s.dependency "Braintree/ApplePay", "~> 5.6.1"
s.dependency "Braintree/Card", "~> 5.6.1"
s.dependency "Braintree/Core", "~> 5.6.1"
s.dependency "Braintree/UnionPay", "~> 5.6.1"
s.dependency "Braintree/PayPal", "~> 5.6.1"
s.dependency "Braintree/ThreeDSecure", "~> 5.6.1"
s.dependency "Braintree/Venmo", "~> 5.6.1"
s.resource_bundles = {
"BraintreeDropIn-Localization" => ["Sources/BraintreeDropIn/Resources/*.lproj"] }

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@
"repositoryURL": "https://github.com/braintree/braintree_ios",
"state": {
"branch": null,
"revision": "6d57ebe2182ab0e441c8ec359f3c8ba4dc5edb6b",
"version": "5.5.0"
"revision": "5cf3fb4dfd60a59763ac582b09839256fa8cb278",
"version": "5.6.1"
}
},
{
Expand Down
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
# Braintree iOS Drop-in SDK - Release Notes

## unreleased
* Require `braintree_ios` 5.6.1 or higher
* Add specific error message for duplicate payment method

## 9.3.0 (2021-11-08)
* iOS 15 - Fix bug where payment method icon border was missing after card flow cancellation
* Require `braintree_ios` 5.5.0 or higher
Expand Down
2 changes: 1 addition & 1 deletion Package.swift
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ let package = Package(
)
],
dependencies: [
.package(name: "Braintree", url: "https://github.com/braintree/braintree_ios", from: "5.5.0")
.package(name: "Braintree", url: "https://github.com/braintree/braintree_ios", from: "5.6.1")
],
targets: [
// Targets are the basic building blocks of a package. A target can define a module or a test suite.
Expand Down
6 changes: 5 additions & 1 deletion Sources/BraintreeDropIn/BTCardFormViewController.m
Original file line number Diff line number Diff line change
Expand Up @@ -566,7 +566,11 @@ - (void)basicTokenization {
self.navigationItem.rightBarButtonItem = addCardButton;

if (error != nil) {
UIAlertController *alertController = [UIAlertController alertControllerWithTitle:BTDropInLocalizedString(CARD_DETAILS_LABEL) message:BTDropInLocalizedString(REVIEW_AND_TRY_AGAIN) preferredStyle:UIAlertControllerStyleAlert];
NSString *message = BTDropInLocalizedString(REVIEW_AND_TRY_AGAIN);
if (error.code == BTCardClientErrorTypeCardAlreadyExists) {
message = BTDropInLocalizedString(CARD_ALREADY_EXISTS);
}
UIAlertController *alertController = [UIAlertController alertControllerWithTitle:BTDropInLocalizedString(CARD_DETAILS_LABEL) message:message preferredStyle:UIAlertControllerStyleAlert];
UIAlertAction *alertAction = [UIAlertAction actionWithTitle:BTDropInLocalizedString(TOP_LEVEL_ERROR_ALERT_VIEW_OK_BUTTON_TEXT) style:UIAlertActionStyleDefault handler:nil];
[alertController addAction: alertAction];
[navController presentViewController:alertController animated:YES completion:nil];
Expand Down
4 changes: 4 additions & 0 deletions Sources/BraintreeDropIn/Localization/BTDropInLocalization.m
Original file line number Diff line number Diff line change
Expand Up @@ -148,6 +148,10 @@ + (NSString *)REVIEW_AND_TRY_AGAIN {
return NSLocalizedStringWithDefaultValue(@"REVIEW_AND_TRY_AGAIN", [self localizationTable], [self localizationBundle], @"Please review your information and try again.", @"REVIEW_AND_TRY_AGAIN");
}

+ (NSString *)CARD_ALREADY_EXISTS {
return NSLocalizedStringWithDefaultValue(@"CARD_ALREADY_EXISTS", [self localizationTable], [self localizationBundle], @"This credit card already exists as a saved payment method.", @"CARD_ALREADY_EXISTS");
}

+ (NSString *)INVALID_LABEL {
return NSLocalizedStringWithDefaultValue(@"INVALID_LABEL", [self localizationTable], [self localizationBundle], @"Invalid:", @"INVALID_LABEL");
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@
+ (NSString *)EDIT_PAYMENT_METHOD;
+ (NSString *)THERE_WAS_AN_ERROR;
+ (NSString *)REVIEW_AND_TRY_AGAIN;
+ (NSString *)CARD_ALREADY_EXISTS;
+ (NSString *)INVALID_LABEL;
+ (NSString *)YEAR_LABEL;
+ (NSString *)MONTH_LABEL;
Expand Down
Binary file modified Sources/BraintreeDropIn/Resources/ar.lproj/BTUI.strings
Binary file not shown.
Binary file modified Sources/BraintreeDropIn/Resources/da.lproj/BTUI.strings
Binary file not shown.
Binary file modified Sources/BraintreeDropIn/Resources/de.lproj/BTUI.strings
Binary file not shown.
Binary file modified Sources/BraintreeDropIn/Resources/en.lproj/BTUI.strings
Binary file not shown.
Binary file modified Sources/BraintreeDropIn/Resources/es.lproj/BTUI.strings
Binary file not shown.
Binary file modified Sources/BraintreeDropIn/Resources/fr-CA.lproj/BTUI.strings
Binary file not shown.
Binary file modified Sources/BraintreeDropIn/Resources/fr.lproj/BTUI.strings
Binary file not shown.
Binary file modified Sources/BraintreeDropIn/Resources/he.lproj/BTUI.strings
Binary file not shown.
Binary file modified Sources/BraintreeDropIn/Resources/id.lproj/BTUI.strings
Binary file not shown.
Binary file modified Sources/BraintreeDropIn/Resources/it.lproj/BTUI.strings
Binary file not shown.
Binary file modified Sources/BraintreeDropIn/Resources/ja.lproj/BTUI.strings
Binary file not shown.
Binary file modified Sources/BraintreeDropIn/Resources/ko.lproj/BTUI.strings
Binary file not shown.
Binary file modified Sources/BraintreeDropIn/Resources/nb.lproj/BTUI.strings
Binary file not shown.
Binary file modified Sources/BraintreeDropIn/Resources/nl.lproj/BTUI.strings
Binary file not shown.
Binary file modified Sources/BraintreeDropIn/Resources/pl.lproj/BTUI.strings
Binary file not shown.
Binary file modified Sources/BraintreeDropIn/Resources/pt.lproj/BTUI.strings
Binary file not shown.
Binary file modified Sources/BraintreeDropIn/Resources/ru.lproj/BTUI.strings
Binary file not shown.
Binary file modified Sources/BraintreeDropIn/Resources/sv.lproj/BTUI.strings
Binary file not shown.
Binary file modified Sources/BraintreeDropIn/Resources/th.lproj/BTUI.strings
Binary file not shown.
Binary file modified Sources/BraintreeDropIn/Resources/zh-Hans.lproj/BTUI.strings
Binary file not shown.
Binary file modified Sources/BraintreeDropIn/Resources/zh-Hant-HK.lproj/BTUI.strings
Binary file not shown.
Binary file modified Sources/BraintreeDropIn/Resources/zh-Hant.lproj/BTUI.strings
Binary file not shown.

0 comments on commit 2df23e9

Please sign in to comment.