From da957a3305c4ec12a1cb86f5bc0127f2dc7a143c Mon Sep 17 00:00:00 2001 From: Aditya Rajan Date: Thu, 18 Jul 2024 16:21:50 +0200 Subject: [PATCH 1/3] Remove Giropay references --- .../BrowseExamplesViewController.m | 90 +++++++++---------- .../GiropayExampleViewController.h | 17 ---- .../GiropayExampleViewController.m | 87 ------------------ .../Source/STPPaymentMethod+BasicUI.swift | 2 +- .../STPPaymentMethodParams+BasicUI.swift | 2 +- .../StripeiOS/Source/STPSource+BasicUI.swift | 2 - .../STPPaymentMethodGiropayParamsTests.swift | 49 ---------- .../STPPaymentMethodGiropayTests.swift | 43 --------- .../StripeiOSTests/STPPaymentMethodTest.swift | 3 - .../StripeiOSTests/STPSourceParamsTest.swift | 3 - Stripe/StripeiOSTests/STPSourceTest.swift | 9 -- .../Source/Helpers/Images.swift | 1 - .../PaymentSheet/PaymentMethodType.swift | 4 +- .../PaymentSheet/PaymentOption+Images.swift | 2 - ...ymentSheet+PaymentMethodAvailability.swift | 2 +- .../PaymentSheetSnapshotTests.swift | 26 ------ ...MethodListViewControllerSnapshotTest.swift | 1 - .../STPPaymentMethodEnums.swift | 4 - .../Enums+CustomStringConvertible.swift | 4 - .../StripePaymentsObjcTestUtils/STPFixtures.m | 1 - .../Common/IntegrationMethods.swift | 4 - .../IntegrationTester/Source/MainMenu.swift | 1 - .../IntegrationTesterUITests.swift | 3 - 23 files changed, 45 insertions(+), 315 deletions(-) delete mode 100644 Example/Non-Card Payment Examples/Non-Card Payment Examples/GiropayExampleViewController.h delete mode 100644 Example/Non-Card Payment Examples/Non-Card Payment Examples/GiropayExampleViewController.m delete mode 100644 Stripe/StripeiOSTests/STPPaymentMethodGiropayParamsTests.swift delete mode 100644 Stripe/StripeiOSTests/STPPaymentMethodGiropayTests.swift diff --git a/Example/Non-Card Payment Examples/Non-Card Payment Examples/BrowseExamplesViewController.m b/Example/Non-Card Payment Examples/Non-Card Payment Examples/BrowseExamplesViewController.m index 717002d1969..b8ef26d3c98 100644 --- a/Example/Non-Card Payment Examples/Non-Card Payment Examples/BrowseExamplesViewController.m +++ b/Example/Non-Card Payment Examples/Non-Card Payment Examples/BrowseExamplesViewController.m @@ -16,7 +16,6 @@ #import "AUBECSDebitExampleViewController.h" #import "BancontactExampleViewController.h" #import "FPXExampleViewController.h" -#import "GiropayExampleViewController.h" #import "iDEALExampleViewController.h" #import "Przelewy24ExampleViewController.h" #import "OXXOExampleViewController.h" @@ -84,69 +83,66 @@ - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(N cell.textLabel.text = @"AU BECS Debit"; break; case 10: - cell.textLabel.text = @"giropay"; - break; - case 11: cell.textLabel.text = @"Przelewy24"; break; - case 12: + case 11: cell.textLabel.text = @"Bancontact"; break; - case 13: + case 12: cell.textLabel.text = @"EPS"; break; - case 14: + case 13: cell.textLabel.text = @"Sofort (PaymentMethods)"; break; - case 15: + case 14: cell.textLabel.text = @"GrabPay"; break; - case 16: + case 15: cell.textLabel.text = @"OXXO"; break; - case 17: + case 16: cell.textLabel.text = @"Afterpay"; break; - case 18: + case 17: cell.textLabel.text = @"Boleto"; break; - case 19: + case 18: cell.textLabel.text = @"Klarna (PaymentMethods)"; break; - case 20: + case 19: cell.textLabel.text = @"Affirm (PaymentMethods)"; break; - case 21: + case 20: cell.textLabel.text = @"US Bank Account"; break; - case 22: + case 21: cell.textLabel.text = @"US Bank Account w/ FinancialConnections"; break; - case 23: + case 22: cell.textLabel.text = @"Cash App Pay"; break; - case 24: + case 23: cell.textLabel.text = @"BLIK"; break; - case 25: + case 24: cell.textLabel.text = @"PayPal"; break; - case 26: + case 25: cell.textLabel.text = @"RevolutPay"; break; - case 27: + case 26: cell.textLabel.text = @"Swish"; break; - case 28: + case 27: cell.textLabel.text = @"Amazon Pay"; break; - case 29: + case 28: cell.textLabel.text = @"Alma"; break; - case 30: + case 29: cell.textLabel.text = @"Multibanco"; break; - case 31: + case 30: cell.textLabel.text = @"MobilePay"; break; } @@ -224,132 +220,126 @@ - (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath break; } case 10: { - GiropayExampleViewController *exampleVC = [GiropayExampleViewController new]; - exampleVC.delegate = self; - viewController = exampleVC; - break; - } - case 11: { Przelewy24ExampleViewController *exampleVC = [Przelewy24ExampleViewController new]; exampleVC.delegate = self; viewController = exampleVC; break; } - case 12: { + case 11: { BancontactExampleViewController *exampleVC = [BancontactExampleViewController new]; exampleVC.delegate = self; viewController = exampleVC; break; } - case 13: { + case 12: { EPSExampleViewController *exampleVC = [EPSExampleViewController new]; exampleVC.delegate = self; viewController = exampleVC; break; } - case 14: { + case 13: { SofortExampleViewController *exampleVC = [SofortExampleViewController new]; exampleVC.delegate = self; viewController = exampleVC; break; } - case 15: { + case 14: { GrabPayExampleViewController *exampleVC = [GrabPayExampleViewController new]; exampleVC.delegate = self; viewController = exampleVC; break; } - case 16: { + case 15: { OXXOExampleViewController *exampleVC = [OXXOExampleViewController new]; exampleVC.delegate = self; viewController = exampleVC; break; } - case 17: { + case 16: { AfterpayClearpayExampleViewController *exampleVC = [AfterpayClearpayExampleViewController new]; exampleVC.delegate = self; viewController = exampleVC; break; } - case 18: { + case 17: { BoletoExampleViewController *exampleVC = [BoletoExampleViewController new]; exampleVC.delegate = self; viewController = exampleVC; break; } - case 19: { + case 18: { KlarnaExampleViewController *exampleVC = [KlarnaExampleViewController new]; exampleVC.delegate = self; viewController = exampleVC; break; } - case 20: { + case 19: { AffirmExampleViewController *exampleVC = [AffirmExampleViewController new]; exampleVC.delegate = self; viewController = exampleVC; break; } - case 21: { + case 20: { USBankAccountExampleViewController *exampleVC = [USBankAccountExampleViewController new]; exampleVC.delegate = self; viewController = exampleVC; break; } - case 22: { + case 21: { USBankAccountFinancialConnectionsExampleViewController *exampleVC = [USBankAccountFinancialConnectionsExampleViewController new]; exampleVC.delegate = self; viewController = exampleVC; break; } - case 23: { + case 22: { CashAppExampleViewController *exampleVC = [CashAppExampleViewController new]; exampleVC.delegate = self; viewController = exampleVC; break; } - case 24: { + case 23: { BlikExampleViewController *exampleVC = [BlikExampleViewController new]; exampleVC.delegate = self; viewController = exampleVC; break; } - case 25: { + case 24: { PayPalExampleViewController *exampleVC = [PayPalExampleViewController new]; exampleVC.delegate = self; viewController = exampleVC; break; } - case 26: { + case 25: { RevolutPayExampleViewController *exampleVC = [RevolutPayExampleViewController new]; exampleVC.delegate = self; viewController = exampleVC; break; } - case 27: { + case 26: { SwishExampleViewController *exampleVC = [SwishExampleViewController new]; exampleVC.delegate = self; viewController = exampleVC; break; } - case 28: { + case 27: { AmazonPayExampleViewController *exampleVC = [AmazonPayExampleViewController new]; exampleVC.delegate = self; viewController = exampleVC; break; } - case 29: { + case 28: { AlmaExampleViewController *exampleVC = [AlmaExampleViewController new]; exampleVC.delegate = self; viewController = exampleVC; break; } - case 30: { + case 29: { MultibancoExampleViewController *exampleVC = [MultibancoExampleViewController new]; exampleVC.delegate = self; viewController = exampleVC; break; } - case 31: { + case 30: { MobilePayExampleViewController *exampleVC = [MobilePayExampleViewController new]; exampleVC.delegate = self; viewController = exampleVC; diff --git a/Example/Non-Card Payment Examples/Non-Card Payment Examples/GiropayExampleViewController.h b/Example/Non-Card Payment Examples/Non-Card Payment Examples/GiropayExampleViewController.h deleted file mode 100644 index bb0f2b4f813..00000000000 --- a/Example/Non-Card Payment Examples/Non-Card Payment Examples/GiropayExampleViewController.h +++ /dev/null @@ -1,17 +0,0 @@ -// -// GiropayExampleViewControllewrViewController.h -// Non-Card Payment Examples -// -// Created by Cameron Sabol on 4/22/20. -// Copyright © 2020 Stripe. All rights reserved. -// - -#import "PaymentExampleViewController.h" - -NS_ASSUME_NONNULL_BEGIN - -@interface GiropayExampleViewController : PaymentExampleViewController - -@end - -NS_ASSUME_NONNULL_END diff --git a/Example/Non-Card Payment Examples/Non-Card Payment Examples/GiropayExampleViewController.m b/Example/Non-Card Payment Examples/Non-Card Payment Examples/GiropayExampleViewController.m deleted file mode 100644 index 54f1621eb27..00000000000 --- a/Example/Non-Card Payment Examples/Non-Card Payment Examples/GiropayExampleViewController.m +++ /dev/null @@ -1,87 +0,0 @@ -// -// GiropayExampleViewControllewrViewController.m -// Non-Card Payment Examples -// -// Created by Cameron Sabol on 4/22/20. -// Copyright © 2020 Stripe. All rights reserved. -// - -#import "GiropayExampleViewController.h" - -#import "MyAPIClient.h" - -@interface GiropayExampleViewController () - -@end - -@implementation GiropayExampleViewController { - UITextField *_nameField; -} - -- (void)viewDidLoad { - [super viewDidLoad]; - // Do any additional setup after loading the view. - self.title = @"giropay"; - - _nameField = [[UITextField alloc] init]; - _nameField.borderStyle = UITextBorderStyleRoundedRect; - _nameField.textContentType = UITextContentTypeName; - _nameField.placeholder = @"Name"; - _nameField.translatesAutoresizingMaskIntoConstraints = NO; - [self.view addSubview:_nameField]; - - - [self.payButton setTitle:@"Pay with giropay" forState:UIControlStateNormal]; - [self.payButton sizeToFit]; - - [NSLayoutConstraint activateConstraints:@[ - [_nameField.centerXAnchor constraintEqualToAnchor:self.payButton.centerXAnchor], - [_nameField.bottomAnchor constraintEqualToAnchor:self.payButton.topAnchor constant:-12.f], - [_nameField.widthAnchor constraintEqualToConstant:240.f], - ]]; -} - -- (void)payButtonSelected { - [super payButtonSelected]; - [self updateUIForPaymentInProgress:YES]; - - [[MyAPIClient sharedClient] createPaymentIntentWithCompletion:^(MyAPIClientResult status, NSString *clientSecret, NSError *error) { - if (status == MyAPIClientResultFailure || clientSecret == nil) { - [self.delegate exampleViewController:self didFinishWithError:error]; - return; - } - - STPPaymentIntentParams *paymentIntentParams = [[STPPaymentIntentParams alloc] initWithClientSecret:clientSecret]; - - STPPaymentMethodBillingDetails *billingDetails = [[STPPaymentMethodBillingDetails alloc] init]; - billingDetails.name = self->_nameField.text; - - - STPPaymentMethodGiropayParams *giropay = [[STPPaymentMethodGiropayParams alloc] init]; - - // giropay does not require additional parameters so we only need to pass the init-ed - // STPPaymentMethoGiropayParams instance to STPPaymentMethodParams - paymentIntentParams.paymentMethodParams = [STPPaymentMethodParams paramsWithGiropay:giropay - billingDetails:billingDetails - metadata:nil]; - - paymentIntentParams.returnURL = @"payments-example://stripe-redirect"; - [[STPPaymentHandler sharedHandler] confirmPayment:paymentIntentParams - withAuthenticationContext:self.delegate - completion:^(STPPaymentHandlerActionStatus handlerStatus, STPPaymentIntent * handledIntent, NSError * _Nullable handlerError) { - switch (handlerStatus) { - case STPPaymentHandlerActionStatusFailed: - [self.delegate exampleViewController:self didFinishWithError:handlerError]; - break; - case STPPaymentHandlerActionStatusCanceled: - [self.delegate exampleViewController:self didFinishWithMessage:@"Canceled"]; - break; - case STPPaymentHandlerActionStatusSucceeded: - [self.delegate exampleViewController:self didFinishWithMessage:@"Payment successfully created"]; - break; - } - }]; - } additionalParameters:@"country=de"]; -} - -@end diff --git a/Stripe/StripeiOS/Source/STPPaymentMethod+BasicUI.swift b/Stripe/StripeiOS/Source/STPPaymentMethod+BasicUI.swift index 9af0f314ca6..bfa287c3b26 100644 --- a/Stripe/StripeiOS/Source/STPPaymentMethod+BasicUI.swift +++ b/Stripe/StripeiOS/Source/STPPaymentMethod+BasicUI.swift @@ -66,7 +66,7 @@ extension STPPaymentMethod: STPPaymentOption { return true case .alipay, // Careful! Revisit this if/when we support recurring Alipay .AUBECSDebit, - .bacsDebit, .SEPADebit, .iDEAL, .FPX, .cardPresent, .giropay, .EPS, .payPal, + .bacsDebit, .SEPADebit, .iDEAL, .FPX, .cardPresent, .EPS, .payPal, .przelewy24, .bancontact, .OXXO, .sofort, .grabPay, .netBanking, .UPI, .afterpayClearpay, .blik, .weChatPay, .boleto, .klarna, .affirm, .cashApp, .paynow, .zip, .revolutPay, .amazonPay, diff --git a/Stripe/StripeiOS/Source/STPPaymentMethodParams+BasicUI.swift b/Stripe/StripeiOS/Source/STPPaymentMethodParams+BasicUI.swift index 73c49daab2c..9876c2b66a0 100644 --- a/Stripe/StripeiOS/Source/STPPaymentMethodParams+BasicUI.swift +++ b/Stripe/StripeiOS/Source/STPPaymentMethodParams+BasicUI.swift @@ -36,7 +36,7 @@ extension STPPaymentMethodParams: STPPaymentOption { switch type { case .card, .link, .USBankAccount, .instantDebits: return true - case .alipay, .AUBECSDebit, .bacsDebit, .SEPADebit, .iDEAL, .FPX, .cardPresent, .giropay, + case .alipay, .AUBECSDebit, .bacsDebit, .SEPADebit, .iDEAL, .FPX, .cardPresent, .grabPay, .EPS, .przelewy24, .bancontact, .netBanking, .OXXO, .payPal, .sofort, .UPI, .afterpayClearpay, .blik, .weChatPay, .boleto, .klarna, .affirm, .cashApp, .paynow, .zip, .revolutPay, .amazonPay, .alma, .mobilePay, .konbini, .promptPay, .swish, .twint, .multibanco, diff --git a/Stripe/StripeiOS/Source/STPSource+BasicUI.swift b/Stripe/StripeiOS/Source/STPSource+BasicUI.swift index 67510e70e87..397461c308e 100644 --- a/Stripe/StripeiOS/Source/STPSource+BasicUI.swift +++ b/Stripe/StripeiOS/Source/STPSource+BasicUI.swift @@ -39,8 +39,6 @@ extension STPSource: STPPaymentOption { } else { return STPCard.string(from: .unknown) } - case .giropay: - return STPPaymentMethodType.giropay.displayName case .iDEAL: return STPPaymentMethodType.iDEAL.displayName case .SEPADebit: diff --git a/Stripe/StripeiOSTests/STPPaymentMethodGiropayParamsTests.swift b/Stripe/StripeiOSTests/STPPaymentMethodGiropayParamsTests.swift deleted file mode 100644 index 1b0504162fd..00000000000 --- a/Stripe/StripeiOSTests/STPPaymentMethodGiropayParamsTests.swift +++ /dev/null @@ -1,49 +0,0 @@ -// Converted to Swift 5.8.1 by Swiftify v5.8.28463 - https://swiftify.com/ -// -// STPPaymentMethodGiropayParamsTests.m -// StripeiOS Tests -// -// Created by Cameron Sabol on 4/21/20. -// Copyright © 2020 Stripe, Inc. All rights reserved. -// - -import StripeCoreTestUtils - -class STPPaymentMethodGiropayParamsTests: XCTestCase { - func testCreateGiropayPaymentMethod() { - let client = STPAPIClient(publishableKey: STPTestingDefaultPublishableKey) - let giropayParams = STPPaymentMethodGiropayParams() - - let billingDetails = STPPaymentMethodBillingDetails() - billingDetails.name = "Jenny Rosen" - - let params = STPPaymentMethodParams( - giropay: giropayParams, - billingDetails: billingDetails, - metadata: [ - "test_key": "test_value" - ]) - - let expectation = self.expectation(description: "Payment Method giropay create") - - client.createPaymentMethod( - with: params) { paymentMethod, error in - expectation.fulfill() - - XCTAssertNil(error, "Unexpected error creating giropay PaymentMethod") - XCTAssertNotNil(paymentMethod, "Failed to create giropay PaymentMethod") - XCTAssertNotNil(paymentMethod?.stripeId, "Missing stripeId") - XCTAssertNotNil(paymentMethod?.created, "Missing created") - XCTAssertFalse(paymentMethod!.liveMode, "Incorrect livemode") - XCTAssertEqual(paymentMethod?.type, .giropay, "Incorrect PaymentMethod type") - - // Billing Details - XCTAssertEqual(paymentMethod?.billingDetails!.name, "Jenny Rosen") - - // giropay Details - XCTAssertNotNil(paymentMethod?.giropay, "Missing giropay") - } - - waitForExpectations(timeout: STPTestingNetworkRequestTimeout, handler: nil) - } -} diff --git a/Stripe/StripeiOSTests/STPPaymentMethodGiropayTests.swift b/Stripe/StripeiOSTests/STPPaymentMethodGiropayTests.swift deleted file mode 100644 index 5e421c4f494..00000000000 --- a/Stripe/StripeiOSTests/STPPaymentMethodGiropayTests.swift +++ /dev/null @@ -1,43 +0,0 @@ -// -// STPPaymentMethodGiropayTests.swift -// StripeiOS Tests -// -// Created by Cameron Sabol on 4/21/20. -// Copyright © 2020 Stripe, Inc. All rights reserved. -// -import StripeCoreTestUtils - -@testable@_spi(STP) import Stripe -@testable@_spi(STP) import StripeCore -@testable@_spi(STP) import StripePayments -@testable@_spi(STP) import StripePaymentSheet -@testable@_spi(STP) import StripePaymentsUI - -class STPPaymentMethodGiropayTests: XCTestCase { - private(set) var giropayJSON: [AnyHashable: Any]? - - func _retrieveGiropayDebitJSON(_ completion: @escaping ([AnyHashable: Any]?) -> Void) { - if let giropayJSON = giropayJSON { - completion(giropayJSON) - } else { - let client = STPAPIClient(publishableKey: STPTestingDefaultPublishableKey) - client.retrievePaymentIntent( - withClientSecret: "pi_1GfsdtFY0qyl6XeWLnepIXCI_secret_bLJRSeSY7fBjDXnwh9BUKilMW", - expand: ["payment_method"] - ) { [self] paymentIntent, _ in - giropayJSON = paymentIntent?.paymentMethod?.giropay?.allResponseFields - completion(giropayJSON ?? [:]) - } - } - } - - func testCorrectParsing() { - let jsonExpectation = XCTestExpectation(description: "Fetch Giropay JSON") - _retrieveGiropayDebitJSON({ json in - let giropay = STPPaymentMethodGiropay.decodedObject(fromAPIResponse: json) - XCTAssertNotNil(giropay, "Failed to decode JSON") - jsonExpectation.fulfill() - }) - wait(for: [jsonExpectation], timeout: STPTestingNetworkRequestTimeout) - } -} diff --git a/Stripe/StripeiOSTests/STPPaymentMethodTest.swift b/Stripe/StripeiOSTests/STPPaymentMethodTest.swift index 99bd2660795..5c8b96b7092 100644 --- a/Stripe/StripeiOSTests/STPPaymentMethodTest.swift +++ b/Stripe/StripeiOSTests/STPPaymentMethodTest.swift @@ -81,7 +81,6 @@ class STPPaymentMethodTest: XCTestCase { .OXXO, .alipay, .payPal, - .giropay, .multibanco, .unknown, ] @@ -103,8 +102,6 @@ class STPPaymentMethodTest: XCTestCase { XCTAssertEqual(string, "bacs_debit") case .AUBECSDebit: XCTAssertEqual(string, "au_becs_debit") - case .giropay: - XCTAssertEqual(string, "giropay") case .przelewy24: XCTAssertEqual(string, "p24") case .bancontact: diff --git a/Stripe/StripeiOSTests/STPSourceParamsTest.swift b/Stripe/StripeiOSTests/STPSourceParamsTest.swift index 0534c5b82de..4f7d3db9a12 100644 --- a/Stripe/StripeiOSTests/STPSourceParamsTest.swift +++ b/Stripe/StripeiOSTests/STPSourceParamsTest.swift @@ -81,9 +81,6 @@ class STPSourceParamsTest: XCTestCase { sourceParams.type = .card XCTAssertEqual(sourceParams.rawTypeString, "card") - sourceParams.type = .giropay - XCTAssertEqual(sourceParams.rawTypeString, "giropay") - sourceParams.type = .iDEAL XCTAssertEqual(sourceParams.rawTypeString, "ideal") diff --git a/Stripe/StripeiOSTests/STPSourceTest.swift b/Stripe/StripeiOSTests/STPSourceTest.swift index 6e358141d9d..41e027006f4 100644 --- a/Stripe/StripeiOSTests/STPSourceTest.swift +++ b/Stripe/StripeiOSTests/STPSourceTest.swift @@ -21,9 +21,6 @@ class STPSourceTest: XCTestCase { XCTAssertEqual(STPSource.type(from: "card"), STPSourceType.card) XCTAssertEqual(STPSource.type(from: "CARD"), STPSourceType.card) - XCTAssertEqual(STPSource.type(from: "giropay"), STPSourceType.giropay) - XCTAssertEqual(STPSource.type(from: "GIROPAY"), STPSourceType.giropay) - XCTAssertEqual(STPSource.type(from: "ideal"), STPSourceType.iDEAL) XCTAssertEqual(STPSource.type(from: "IDEAL"), STPSourceType.iDEAL) @@ -59,7 +56,6 @@ class STPSourceTest: XCTestCase { let values = [ STPSourceType.bancontact, STPSourceType.card, - STPSourceType.giropay, STPSourceType.iDEAL, STPSourceType.SEPADebit, STPSourceType.sofort, @@ -79,8 +75,6 @@ class STPSourceTest: XCTestCase { XCTAssertEqual(string, "bancontact") case STPSourceType.card: XCTAssertEqual(string, "card") - case STPSourceType.giropay: - XCTAssertEqual(string, "giropay") case STPSourceType.iDEAL: XCTAssertEqual(string, "ideal") case STPSourceType.SEPADebit: @@ -419,7 +413,6 @@ class STPSourceTest: XCTestCase { STPTestUtils.jsonNamed(STPTestJSONSourceAlipay), STPTestUtils.jsonNamed(STPTestJSONSourceBancontact), STPTestUtils.jsonNamed(STPTestJSONSourceEPS), - STPTestUtils.jsonNamed(STPTestJSONSourceGiropay), STPTestUtils.jsonNamed(STPTestJSONSourceiDEAL), STPTestUtils.jsonNamed(STPTestJSONSourceMultibanco), STPTestUtils.jsonNamed(STPTestJSONSourceP24), @@ -463,8 +456,6 @@ class STPSourceTest: XCTestCase { XCTAssertEqual(source?.label, "Bancontact") case STPSourceType.card: XCTAssertEqual(source?.label, "Visa 5556") - case STPSourceType.giropay: - XCTAssertEqual(source?.label, "giropay") case STPSourceType.iDEAL: XCTAssertEqual(source?.label, "iDEAL") case STPSourceType.SEPADebit: diff --git a/StripePaymentSheet/StripePaymentSheet/Source/Helpers/Images.swift b/StripePaymentSheet/StripePaymentSheet/Source/Helpers/Images.swift index 064e76c144d..da64ab22321 100644 --- a/StripePaymentSheet/StripePaymentSheet/Source/Helpers/Images.swift +++ b/StripePaymentSheet/StripePaymentSheet/Source/Helpers/Images.swift @@ -28,7 +28,6 @@ enum Image: String, CaseIterable, ImageMaker { case pm_type_bancontact = "icon-pm-bancontact" case pm_type_card = "icon-pm-card" case pm_type_eps = "icon-pm-eps" - case pm_type_giropay = "icon-pm-giropay" case pm_type_ideal = "icon-pm-ideal" case pm_type_klarna = "icon-pm-klarna" case pm_type_p24 = "icon-pm-p24" diff --git a/StripePaymentSheet/StripePaymentSheet/Source/PaymentSheet/PaymentMethodType.swift b/StripePaymentSheet/StripePaymentSheet/Source/PaymentSheet/PaymentMethodType.swift index 7fde06144ce..b0f038ff84e 100644 --- a/StripePaymentSheet/StripePaymentSheet/Source/PaymentSheet/PaymentMethodType.swift +++ b/StripePaymentSheet/StripePaymentSheet/Source/PaymentSheet/PaymentMethodType.swift @@ -224,7 +224,7 @@ extension PaymentSheet { return [.userSupportsDelayedPaymentMethods] case .bacsDebit: return [.returnURL, .userSupportsDelayedPaymentMethods] - case .cardPresent, .blik, .weChatPay, .grabPay, .FPX, .giropay, .przelewy24, .EPS, + case .cardPresent, .blik, .weChatPay, .grabPay, .FPX, .przelewy24, .EPS, .netBanking, .OXXO, .afterpayClearpay, .UPI, .link, .affirm, .paynow, .zip, .alma, .mobilePay, .unknown, .alipay, .konbini, .promptPay, .swish, .twint, .multibanco: return [.unsupportedForSetup] @unknown default: @@ -236,7 +236,7 @@ extension PaymentSheet { switch paymentMethod { case .blik, .card, .cardPresent, .UPI, .weChatPay, .paynow, .promptPay: return [] - case .alipay, .EPS, .FPX, .giropay, .grabPay, .netBanking, .payPal, .przelewy24, .klarna, + case .alipay, .EPS, .FPX, .grabPay, .netBanking, .payPal, .przelewy24, .klarna, .bancontact, .iDEAL, .cashApp, .affirm, .zip, .revolutPay, .amazonPay, .alma, .mobilePay, .swish, .twint: return [.returnURL] case .USBankAccount: diff --git a/StripePaymentSheet/StripePaymentSheet/Source/PaymentSheet/PaymentOption+Images.swift b/StripePaymentSheet/StripePaymentSheet/Source/PaymentSheet/PaymentOption+Images.swift index b987475657a..607307eb27b 100644 --- a/StripePaymentSheet/StripePaymentSheet/Source/PaymentSheet/PaymentOption+Images.swift +++ b/StripePaymentSheet/StripePaymentSheet/Source/PaymentSheet/PaymentOption+Images.swift @@ -170,8 +170,6 @@ extension STPPaymentMethodType { return .pm_type_sepa case .EPS: return .pm_type_eps - case .giropay: - return .pm_type_giropay case .przelewy24: return .pm_type_p24 case .afterpayClearpay: diff --git a/StripePaymentSheet/StripePaymentSheet/Source/PaymentSheet/PaymentSheet+PaymentMethodAvailability.swift b/StripePaymentSheet/StripePaymentSheet/Source/PaymentSheet/PaymentSheet+PaymentMethodAvailability.swift index d53b44ed36a..97fdba882c9 100644 --- a/StripePaymentSheet/StripePaymentSheet/Source/PaymentSheet/PaymentSheet+PaymentMethodAvailability.swift +++ b/StripePaymentSheet/StripePaymentSheet/Source/PaymentSheet/PaymentSheet+PaymentMethodAvailability.swift @@ -21,7 +21,7 @@ extension PaymentSheet { @_spi(STP) public static var supportedPaymentMethods: [STPPaymentMethodType] = [ .card, .payPal, .klarna, .afterpayClearpay, .affirm, - .iDEAL, .bancontact, .sofort, .SEPADebit, .EPS, .giropay, .przelewy24, + .iDEAL, .bancontact, .sofort, .SEPADebit, .EPS, .przelewy24, .USBankAccount, .instantDebits, .AUBECSDebit, diff --git a/StripePaymentSheet/StripePaymentSheetTests/PaymentSheet/PaymentSheetSnapshotTests.swift b/StripePaymentSheet/StripePaymentSheetTests/PaymentSheet/PaymentSheetSnapshotTests.swift index e97eef28c8f..63f20dda2a7 100644 --- a/StripePaymentSheet/StripePaymentSheetTests/PaymentSheet/PaymentSheetSnapshotTests.swift +++ b/StripePaymentSheet/StripePaymentSheetTests/PaymentSheet/PaymentSheetSnapshotTests.swift @@ -823,32 +823,6 @@ class PaymentSheetSnapshotTests: STPSnapshotTestCase { verify(paymentSheet.bottomSheetViewController.view!) } - func testPaymentSheet_LPM_giropay_only() { - stubSessions( - fileMock: .elementsSessionsPaymentMethod_200, - responseCallback: { data in - return self.updatePaymentMethodDetail( - data: data, - variables: [ - "": "\"giropay\"", - "": "\"eur\"", - ] - ) - } - ) - stubPaymentMethods(fileMock: .saved_payment_methods_200) - stubCustomers() - - preparePaymentSheet( - currency: "eur", - override_payment_methods_types: ["giropay"], - automaticPaymentMethods: false, - useLink: false - ) - presentPaymentSheet(darkMode: false) - verify(paymentSheet.bottomSheetViewController.view!) - } - func testPaymentSheet_LPM_p24_only() { stubSessions( fileMock: .elementsSessionsPaymentMethod_200, diff --git a/StripePaymentSheet/StripePaymentSheetTests/PaymentSheet/VerticalPaymentMethodListViewControllerSnapshotTest.swift b/StripePaymentSheet/StripePaymentSheetTests/PaymentSheet/VerticalPaymentMethodListViewControllerSnapshotTest.swift index 8d73f28995b..9ab8236138e 100644 --- a/StripePaymentSheet/StripePaymentSheetTests/PaymentSheet/VerticalPaymentMethodListViewControllerSnapshotTest.swift +++ b/StripePaymentSheet/StripePaymentSheetTests/PaymentSheet/VerticalPaymentMethodListViewControllerSnapshotTest.swift @@ -35,7 +35,6 @@ final class VerticalPaymentMethodListViewControllerSnapshotTest: STPSnapshotTest .cashApp, .card, .EPS, - .giropay, .iDEAL, .klarna, .konbini, diff --git a/StripePayments/StripePayments/Source/API Bindings/Models/PaymentMethods/STPPaymentMethodEnums.swift b/StripePayments/StripePayments/Source/API Bindings/Models/PaymentMethods/STPPaymentMethodEnums.swift index 94a6ede8922..8e8b6f92207 100644 --- a/StripePayments/StripePayments/Source/API Bindings/Models/PaymentMethods/STPPaymentMethodEnums.swift +++ b/StripePayments/StripePayments/Source/API Bindings/Models/PaymentMethods/STPPaymentMethodEnums.swift @@ -29,8 +29,6 @@ import Foundation @objc(STPPaymentMethodTypeAUBECSDebit) case AUBECSDebit /// A Bacs Debit payment method. case bacsDebit - /// A giropay payment method. - case giropay /// A Przelewy24 Debit payment method. case przelewy24 /// An EPS payment method. @@ -111,8 +109,6 @@ import Foundation return STPLocalizedString("AU Direct Debit", "Payment Method type brand name.") case .grabPay: return STPLocalizedString("GrabPay", "Payment Method type brand name.") - case .giropay: - return STPLocalizedString("giropay", "Payment Method type brand name.") case .EPS: return STPLocalizedString("EPS", "Payment Method type brand name.") case .przelewy24: diff --git a/StripePayments/StripePayments/Source/Categories/Enums+CustomStringConvertible.swift b/StripePayments/StripePayments/Source/Categories/Enums+CustomStringConvertible.swift index 4c997341957..5f742134a73 100644 --- a/StripePayments/StripePayments/Source/Categories/Enums+CustomStringConvertible.swift +++ b/StripePayments/StripePayments/Source/Categories/Enums+CustomStringConvertible.swift @@ -495,8 +495,6 @@ extension STPPaymentMethodType: CustomStringConvertible { return "card" case .cardPresent: return "cardPresent" - case .giropay: - return "giropay" case .grabPay: return "grabPay" case .iDEAL: @@ -774,8 +772,6 @@ extension STPSourceType: CustomStringConvertible { return "bancontact" case .card: return "card" - case .giropay: - return "giropay" case .iDEAL: return "iDEAL" case .klarna: diff --git a/StripePayments/StripePaymentsObjcTestUtils/STPFixtures.m b/StripePayments/StripePaymentsObjcTestUtils/STPFixtures.m index 50bbbdea7f1..e5b6ddec42d 100644 --- a/StripePayments/StripePaymentsObjcTestUtils/STPFixtures.m +++ b/StripePayments/StripePaymentsObjcTestUtils/STPFixtures.m @@ -26,7 +26,6 @@ NSString *const STPTestJSONSourceBancontact = @"BancontactSource"; NSString *const STPTestJSONSourceCard = @"CardSource"; NSString *const STPTestJSONSourceEPS = @"EPSSource"; -NSString *const STPTestJSONSourceGiropay = @"GiropaySource"; NSString *const STPTestJSONSourceiDEAL = @"iDEALSource"; NSString *const STPTestJSONSourceMultibanco = @"MultibancoSource"; NSString *const STPTestJSONSourceP24 = @"P24Source"; diff --git a/Testers/IntegrationTester/Common/IntegrationMethods.swift b/Testers/IntegrationTester/Common/IntegrationMethods.swift index 7647be4a756..9bbfa85d75f 100644 --- a/Testers/IntegrationTester/Common/IntegrationMethods.swift +++ b/Testers/IntegrationTester/Common/IntegrationMethods.swift @@ -19,7 +19,6 @@ public enum IntegrationMethod: String, CaseIterable { case alipay = "Alipay" case bacsDebit = "Bacs Debit" case aubecsDebit = "AU BECS Debit" - case giropay case przelewy24 = "Przelewy24" case bancontact = "Bancontact" case eps = "EPS" @@ -64,9 +63,6 @@ extension IntegrationMethod { case .aubecsDebit: let aubecsDebit = STPPaymentMethodAUBECSDebitParams() return STPPaymentMethodParams(aubecsDebit: aubecsDebit, billingDetails: Self.defaultBillingDetails, metadata: nil) - case .giropay: - let giropay = STPPaymentMethodGiropayParams() - return STPPaymentMethodParams(giropay: giropay, billingDetails: Self.defaultBillingDetails, metadata: nil) case .przelewy24: let przelewy24 = STPPaymentMethodPrzelewy24Params() return STPPaymentMethodParams(przelewy24: przelewy24, billingDetails: Self.defaultBillingDetails, metadata: nil) diff --git a/Testers/IntegrationTester/IntegrationTester/Source/MainMenu.swift b/Testers/IntegrationTester/IntegrationTester/Source/MainMenu.swift index 8d91958d9d2..47e39a7c6c3 100644 --- a/Testers/IntegrationTester/IntegrationTester/Source/MainMenu.swift +++ b/Testers/IntegrationTester/IntegrationTester/Source/MainMenu.swift @@ -34,7 +34,6 @@ struct IntegrationView: View { .paypal: PaymentMethodView(integrationMethod: integrationMethod) case .oxxo, - .giropay, .bancontact, .eps, .grabpay, diff --git a/Testers/IntegrationTester/IntegrationTesterUITests/IntegrationTesterUITests.swift b/Testers/IntegrationTester/IntegrationTesterUITests/IntegrationTesterUITests.swift index 7718c722a72..c26b12ca271 100644 --- a/Testers/IntegrationTester/IntegrationTesterUITests/IntegrationTesterUITests.swift +++ b/Testers/IntegrationTester/IntegrationTesterUITests/IntegrationTesterUITests.swift @@ -135,9 +135,6 @@ class IntegrationTesterUIPMTests: IntegrationTesterUITests { case .oxxo: // TODO: OXXO is currently broken break - case .giropay: - // TODO: Giropay is deprecated - break } } } From 9f2c232d1c05f145c1b870280492244a9af48618 Mon Sep 17 00:00:00 2001 From: Aditya Rajan Date: Thu, 18 Jul 2024 17:03:51 +0200 Subject: [PATCH 2/3] Remove more Giropay Refs --- .../PaymentMethods/STPPaymentMethod.swift | 3 -- .../STPPaymentMethodEnums.swift | 2 - .../STPPaymentMethodParams.swift | 18 --------- .../Models/Sources/STPSource.swift | 1 - .../Models/Sources/STPSourceParams.swift | 39 ------------------- .../PaymentHandler/STPPaymentHandler.swift | 1 - 6 files changed, 64 deletions(-) diff --git a/StripePayments/StripePayments/Source/API Bindings/Models/PaymentMethods/STPPaymentMethod.swift b/StripePayments/StripePayments/Source/API Bindings/Models/PaymentMethods/STPPaymentMethod.swift index 422c110276a..fab42b03ce1 100644 --- a/StripePayments/StripePayments/Source/API Bindings/Models/PaymentMethods/STPPaymentMethod.swift +++ b/StripePayments/StripePayments/Source/API Bindings/Models/PaymentMethods/STPPaymentMethod.swift @@ -246,9 +246,6 @@ public class STPPaymentMethod: NSObject, STPAPIResponseDecodable { paymentMethod.auBECSDebit = STPPaymentMethodAUBECSDebit.decodedObject( fromAPIResponse: dict.stp_dictionary(forKey: "au_becs_debit") ) - paymentMethod.giropay = STPPaymentMethodGiropay.decodedObject( - fromAPIResponse: dict.stp_dictionary(forKey: "giropay") - ) paymentMethod.eps = STPPaymentMethodEPS.decodedObject( fromAPIResponse: dict.stp_dictionary(forKey: "eps") ) diff --git a/StripePayments/StripePayments/Source/API Bindings/Models/PaymentMethods/STPPaymentMethodEnums.swift b/StripePayments/StripePayments/Source/API Bindings/Models/PaymentMethods/STPPaymentMethodEnums.swift index 8e8b6f92207..d915dd0a143 100644 --- a/StripePayments/StripePayments/Source/API Bindings/Models/PaymentMethods/STPPaymentMethodEnums.swift +++ b/StripePayments/StripePayments/Source/API Bindings/Models/PaymentMethods/STPPaymentMethodEnums.swift @@ -204,8 +204,6 @@ import Foundation return "au_becs_debit" case .bacsDebit: return "bacs_debit" - case .giropay: - return "giropay" case .przelewy24: return "p24" case .EPS: diff --git a/StripePayments/StripePayments/Source/API Bindings/Models/PaymentMethods/STPPaymentMethodParams.swift b/StripePayments/StripePayments/Source/API Bindings/Models/PaymentMethods/STPPaymentMethodParams.swift index 5f999ffd312..3a21ac7d8b9 100644 --- a/StripePayments/StripePayments/Source/API Bindings/Models/PaymentMethods/STPPaymentMethodParams.swift +++ b/StripePayments/StripePayments/Source/API Bindings/Models/PaymentMethods/STPPaymentMethodParams.swift @@ -217,24 +217,6 @@ public class STPPaymentMethodParams: NSObject, STPFormEncodable { self.metadata = metadata } - /// Creates params for a giropay PaymentMethod; - /// - Parameters: - /// - giropay: An object containing additional giropay details. - /// - billingDetails: An object containing the user's billing details. Note that `billingDetails.name` is required for giropay PaymentMethods. - /// - metadata: Additional information to attach to the PaymentMethod. - @objc - public convenience init( - giropay: STPPaymentMethodGiropayParams, - billingDetails: STPPaymentMethodBillingDetails, - metadata: [String: String]? - ) { - self.init() - self.type = .giropay - self.giropay = giropay - self.billingDetails = billingDetails - self.metadata = metadata - } - /// Creates params for an EPS PaymentMethod; /// - Parameters: /// - eps: An object containing additional EPS details. diff --git a/StripePayments/StripePayments/Source/API Bindings/Models/Sources/STPSource.swift b/StripePayments/StripePayments/Source/API Bindings/Models/Sources/STPSource.swift index df479707034..c54f30c1739 100644 --- a/StripePayments/StripePayments/Source/API Bindings/Models/Sources/STPSource.swift +++ b/StripePayments/StripePayments/Source/API Bindings/Models/Sources/STPSource.swift @@ -82,7 +82,6 @@ public class STPSource: NSObject, STPAPIResponseDecodable, STPSourceProtocol { return [ "bancontact": NSNumber(value: STPSourceType.bancontact.rawValue), "card": NSNumber(value: STPSourceType.card.rawValue), - "giropay": NSNumber(value: STPSourceType.giropay.rawValue), "ideal": NSNumber(value: STPSourceType.iDEAL.rawValue), "sepa_debit": NSNumber(value: STPSourceType.SEPADebit.rawValue), "sofort": NSNumber(value: STPSourceType.sofort.rawValue), diff --git a/StripePayments/StripePayments/Source/API Bindings/Models/Sources/STPSourceParams.swift b/StripePayments/StripePayments/Source/API Bindings/Models/Sources/STPSourceParams.swift index 239913b9537..ca5d251627f 100644 --- a/StripePayments/StripePayments/Source/API Bindings/Models/Sources/STPSourceParams.swift +++ b/StripePayments/StripePayments/Source/API Bindings/Models/Sources/STPSourceParams.swift @@ -155,45 +155,6 @@ extension STPSourceParams { return params } - /// Creates params for a Giropay source. - /// - seealso: https://stripe.com/docs/sources/giropay#create-source - /// - Parameters: - /// - amount: The amount to charge the customer in EUR. - /// - name: The full name of the account holder. - /// - returnURL: The URL the customer should be redirected to after - /// they have successfully verified the payment. - /// - statementDescriptor: (Optional) A custom statement descriptor for - /// the payment. - /// @note The currency for Giropay must be "eur". This will be set automatically - /// for you. - /// - Returns: an STPSourceParams object populated with the provided values. - @objc - public class func giropayParams( - withAmount amount: Int, - name: String, - returnURL: String, - statementDescriptor: String? - ) -> STPSourceParams { - let params = self.init() - params.type = .giropay - params.amount = NSNumber(value: amount) - params.currency = "eur" // Giropay must always use eur - params.owner = [ - "name": name - ] - params.redirect = [ - "return_url": returnURL - ] - if let statementDescriptor = statementDescriptor { - params.additionalAPIParameters = [ - "giropay": [ - "statement_descriptor": statementDescriptor - ], - ] - } - return params - } - /// Creates params for an iDEAL source. /// - seealso: https://stripe.com/docs/sources/ideal#create-source /// - Parameters: diff --git a/StripePayments/StripePayments/Source/PaymentHandler/STPPaymentHandler.swift b/StripePayments/StripePayments/Source/PaymentHandler/STPPaymentHandler.swift index 7921cbe82c9..2a0bf081c37 100644 --- a/StripePayments/StripePayments/Source/PaymentHandler/STPPaymentHandler.swift +++ b/StripePayments/StripePayments/Source/PaymentHandler/STPPaymentHandler.swift @@ -705,7 +705,6 @@ public class STPPaymentHandler: NSObject { .iDEAL, .FPX, .cardPresent, - .giropay, .EPS, .payPal, .przelewy24, From 63db0b206214975922a3eb62b046a95e551f3aef Mon Sep 17 00:00:00 2001 From: Aditya Rajan Date: Thu, 18 Jul 2024 17:19:31 +0200 Subject: [PATCH 3/3] Remove more Giropay Refs --- .../Models/PaymentMethods/STPPaymentMethodParams.swift | 7 ------- 1 file changed, 7 deletions(-) diff --git a/StripePayments/StripePayments/Source/API Bindings/Models/PaymentMethods/STPPaymentMethodParams.swift b/StripePayments/StripePayments/Source/API Bindings/Models/PaymentMethods/STPPaymentMethodParams.swift index 3a21ac7d8b9..a0feac7e0db 100644 --- a/StripePayments/StripePayments/Source/API Bindings/Models/PaymentMethods/STPPaymentMethodParams.swift +++ b/StripePayments/StripePayments/Source/API Bindings/Models/PaymentMethods/STPPaymentMethodParams.swift @@ -664,9 +664,6 @@ public class STPPaymentMethodParams: NSObject, STPFormEncodable { let iDEAL = STPPaymentMethodiDEALParams() self.iDEAL = iDEAL self.iDEAL?.bankName = paymentMethod.iDEAL?.bankName - case .giropay: - let giropay = STPPaymentMethodGiropayParams() - self.giropay = giropay case .przelewy24: let przelewy24 = STPPaymentMethodPrzelewy24Params() self.przelewy24 = przelewy24 @@ -1195,8 +1192,6 @@ extension STPPaymentMethodParams { auBECSDebit = STPPaymentMethodAUBECSDebitParams() case .bacsDebit: bacsDebit = STPPaymentMethodBacsDebitParams() - case .giropay: - giropay = STPPaymentMethodGiropayParams() case .przelewy24: przelewy24 = STPPaymentMethodPrzelewy24Params() case .EPS: @@ -1279,8 +1274,6 @@ extension STPPaymentMethodParams { return "Bacs Debit" case .AUBECSDebit: return "AU BECS Debit" - case .giropay: - return "giropay" case .przelewy24: return "Przelewy24" case .EPS: