Introduce NICardManagementExtraHeaders
- Use
NICardManagementExtraHeaders
when need to add some specific httpHeaders for each SDK http request, for example to bypass additional firewalls
final class AdditionalDemoHeadersProvider: NICardManagementExtraHeaders {
func additionalNetworkHeaders() -> [String: String] {
["extraHeader1": "DemoExtraHttpHeaderValue"]
}
}
let sdk = NICardManagementAPI(
rootUrl: connection.baseUrl,
cardIdentifierId: cardIdentifierId,
cardIdentifierType: cardIdentifierType,
bankCode: bankCode,
tokenFetchable: tokenFetcher,
// pass nil if there are no needs in extra headers
extraHeadersProvider: NICardManagementExtraHeaders,
// pass nil or add logger for debugging, like NICardManagementLogging()
logger: NICardManagementLogger
)
Change card details appearance configuration
- Delete
NITheme
- provide required colors for all elements instead
- Delete
NILanguage
- provide desired strings in any language
- Delete localisation files
- Delete
UIElementColor
, UIElementFont
- use NSAttributedString
in NICardAttributes
to configure element's Font, Coror, etc.
- Use
NICardAttributes
to configure appearance
let cardAttributes = NICardAttributes(
shouldBeMaskedDefault: Set([.cvv]),
labels: [
.cardNumber: NSAttributedString(
string: "My card >>",
attributes: [
.font : UIElement.CardDetails.cardNumber.defaultLabelFont,
.foregroundColor: UIColor.red
]
),
.cvv: NSAttributedString(
string: "My CVV >>",
attributes: [
.font : UIElement.CardDetails.cvv.defaultLabelFont,
.foregroundColor: UIColor.blue
]
),
.cardHolder: NICardAttributes.zero.labels[.cardHolder]!,
.expiry: NICardAttributes.zero.labels[.expiry]!,
]
)
Change PIN forms appearance configuration
- provide desired text/color configuration if needed
let pinVerifyConfig = VerifyPinViewModel.Config(
descriptionAttributedText: NSAttributedString(
string: NISDKStrings.verify_pin_description.rawValue,
attributes: [.font : UIElement.PinFormLabel.verifyPinDescription.defaultFont, .foregroundColor: UIColor.label]
),
titleText: NISDKStrings.verify_pin_title.rawValue,
backgroundColor: .clear
)
let pinChangeConfig = ChangePinViewModel.Config(
enterCurrentPinText: NSAttributedString(
string: NISDKStrings.change_pin_description_enter_current_pin.rawValue,
attributes: [.font : UIFont(name: "Helvetica", size: 18) ?? UIFont.systemFont(ofSize: 18), .foregroundColor: UIColor.label]
),
enterNewPinText: ChangePinViewModel.Config.default.enterNewPinText,
reEnterNewPinText: ChangePinViewModel.Config.default.reEnterNewPinText,
notMatchPinText: ChangePinViewModel.Config.default.notMatchPinText,
titleText: ChangePinViewModel.Config.default.titleText,
backgroundColor: ChangePinViewModel.Config.default.backgroundColor
)
let pinSetConfig = SetPinViewModel.Config.default
sdk.setPinForm(type: pinType, config: pinSetConfig) { successResponse, errorResponse in
// handle here error and success
}
Binary framework added
- if you want to add
NICardManagementSDK
as a framework instead of using CocoaPods - download the framework NICardManagementSDK_v2.1.0.zip
and add it manually
- check
Example-with-framework.zip
as an example of a project with an embedded NICardManagementSDK
framework
- In your project file --> choose your target --> Build Phases --> Link Binary With Libraries section --> drag and drop
NICardManagementSDK
framework