-
Notifications
You must be signed in to change notification settings - Fork 292
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[v7] Update BTThreeDSecureRequest
Parameters
#1452
base: v7
Are you sure you want to change the base?
[v7] Update BTThreeDSecureRequest
Parameters
#1452
Conversation
BTThreeDSecureRequest
Required ParametersBTThreeDSecureRequest
Parameters
BTThreeDSecureRequest
ParametersBTThreeDSecureRequest
Parameters
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
One comment but it's not a blocker. Approving ahead of time.
public init( | ||
accountType: BTThreeDSecureAccountType = .unspecified, | ||
additionalInformation: BTThreeDSecureAdditionalInformation? = nil, | ||
amount: NSDecimalNumber? = 0, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Based on this logic it looks like both amount and the delegate may be required:
if request.amount?.decimalValue.isNaN == true || request.amount == nil { | |
NSLog("%@ BTThreeDSecureRequest amount can not be nil or NaN.", BTLogLevelDescription.string(for: .critical)) | |
let error = BTThreeDSecureError.configuration("BTThreeDSecureRequest amount can not be nil or NaN.") | |
notifyFailure(with: error, completion: completion) | |
return | |
} | |
if request.threeDSecureRequestDelegate == nil { | |
let message = "Configuration Error: threeDSecureRequestDelegate can not be nil when versionRequested is 2." | |
let error = BTThreeDSecureError.configuration(message) | |
notifyFailure(with: error, completion: completion) | |
return | |
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ahh yep, good catch! the amount does seem to be required (i've also confirmed this by raising a BT 3D Secure General Inquiry workflow request) - as for the delegate, it seems that it was also previously optional so i wonder if it's okay to leave that as is 👀
accountType: BTThreeDSecureAccountType = .unspecified, | ||
additionalInformation: BTThreeDSecureAdditionalInformation? = nil, | ||
billingAddress: BTThreeDSecurePostalAddress? = nil, | ||
_cardAddChallenge: BTThreeDSecureCardAddChallenge = .unspecified, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: we can probably just leave this out of the init for now then remove it in the ticket to remove the property completely. If that's more work than it's worth though, feel free to leave and we can hopefully pick up that cleanup ticket soon!
/// - uiType: Optional: Sets all UI types that the device supports for displaying specific challenge user interfaces in the 3D Secure challenge. Defaults to `.both` | ||
/// - v2UICustomization: Optional. UI Customization for 3DS2 challenge views. | ||
public init( | ||
amount: String, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🤔 I am getting an error with the amount as a string in the demo app. Are we sure this is valid? It looks like a Double
works as expected.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
hmm yea i'm a bit confused on this - i also feel amount as Double
makes more sense (and this aligns with what is mentioned in our iOS BT Dev Docs) but after asking here #bt-service-3dsecure and checking the android equivalent it looks like they define amount as a string
Summary of changes
BTThreeDSecureRequest
properties to have everything in the init vs using dot syntaxChecklist
Authors