-
Notifications
You must be signed in to change notification settings - Fork 1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Send CBC preferred network in confirm call (#2965)
## Summary - We now send card[networks][preferred] the network call when confirming a CBC intent - When no card brand is selected we omit `networks` from card params entirley. ## Motivation https://docs.google.com/document/d/1T12LgVTkEv-LaDtQO3lGgNDt3nV_mwrUOJWgfUmTa9U/edit ## Testing - New unit tests - Manual ## Changelog See diff
- Loading branch information
1 parent
834866c
commit b5ea455
Showing
9 changed files
with
203 additions
and
10 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
50 changes: 50 additions & 0 deletions
50
.../Source/API Bindings/Models/PaymentMethods/Types/STPPaymentMethodCardNetworksParams.swift
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
// | ||
// STPPaymentMethodCardNetworksParams.swift | ||
// StripePayments | ||
// | ||
// Created by Nick Porter on 9/28/23. | ||
// | ||
|
||
import Foundation | ||
|
||
public class STPPaymentMethodCardNetworksParams: NSObject, STPFormEncodable { | ||
|
||
@objc public var additionalAPIParameters: [AnyHashable: Any] = [:] | ||
|
||
/// The network that your user selected for this payment | ||
/// method. This must reflect an explicit user choice. If your user didn't | ||
/// make a selection, then pass `null`. | ||
@objc public var preferred: String? | ||
|
||
@objc public convenience init(preferred: String?) { | ||
self.init() | ||
self.preferred = preferred | ||
} | ||
|
||
// MARK: - Description | ||
/// :nodoc: | ||
@objc public override var description: String { | ||
let props = [ | ||
// Object | ||
String(format: "%@: %p", NSStringFromClass(STPPaymentMethodCardNetworksParams.self), self), | ||
// Preferred | ||
"preferred = \(preferred ?? "")", | ||
] | ||
|
||
return "<\(props.joined(separator: "; "))>" | ||
} | ||
|
||
// MARK: - STPFormEncodable | ||
|
||
@objc | ||
public class func rootObjectName() -> String? { | ||
return "networks" | ||
} | ||
|
||
@objc | ||
public static func propertyNamesToFormFieldNamesMapping() -> [String: String] { | ||
return [ | ||
NSStringFromSelector(#selector(getter: preferred)): "preferred", | ||
] | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters