-
Notifications
You must be signed in to change notification settings - Fork 27
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
Vault without Purchase #172
Conversation
Sources/CardPayments/APIRequests/SetupTokenDetailsRequest.swift
Outdated
Show resolved
Hide resolved
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.
Just a few questions/cleanup comments
] | ||
] | ||
] | ||
return try? JSONSerialization.data(withJSONObject: requestBody) |
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.
return try? JSONSerialization.data(withJSONObject: requestBody) | |
return try? JSONSerialization.data(withJSONObject: requestBody) |
] | ||
] | ||
] | ||
return try? JSONSerialization.data(withJSONObject: requestBody) |
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.
return try? JSONSerialization.data(withJSONObject: requestBody) | |
return try? JSONSerialization.data(withJSONObject: requestBody) |
environment: DemoSettings.environment, | ||
selectedMerchantIntegration: selectedMerchantIntegration | ||
) | ||
let data = try await data(for: urlRequest) |
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.
Looks like this is a little too far indented
@@ -69,6 +69,23 @@ struct SwiftUICardDemo: View { | |||
) | |||
.cornerRadius(10) | |||
.disabled(!baseViewModel.isCardFormValid(cardNumber: cardNumberText, expirationDate: expirationDateText, cvv: cvvText)) | |||
Button("Vault Card without Purchase") { | |||
guard let card = baseViewModel.createCard( |
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.
Gotcha - should we print an error here or something in that case or do some sort of validation for the buttons?
var mockErrorResponse: Error? | ||
|
||
override func callGraphQL<T, Q>( | ||
name: String, query: Q |
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.
name: String, query: Q | |
name: String, | |
query: Q |
* vault without purchase * clean up cardClient initializer * Use associatedType for variables for GraphQLQuery protocol * moving setuptoken call to demo app * use APIRequest for merchantServer setupToken request * use enum for PaymentSourceInput for different payment options * get request for setup token details * move graphQL request, responses from Core to Card module * remove APIRequest use in demo app * Add VaultCardDelegate for VaultCardResult * Add payment token creation in demo app * remove duplicate UpdateSetupTokenQuery.swift * rename UpdateSetupTokenRequest to UpdateSetupTokenQuery * added newly named file reference to project * add mocks for unit tests, pr feedback * disable swiftlint for multiline query, target for card test * correct target for MockGraphQLClient * CardClient vault error tests * docStrings and CHANGELOG * PR feedback * PR feedback * PR feedback nodoc String for GraphQLQuery requestBody() * spacing in paymentTokenRequest * PR feedback * PR feedback from Jax 8/16/23 * PR feedback from Jax cleanup
Summary of changes
There is currently a refactor ticket (#177) on the network layer that includes replacing GraphQLClient. There are some TODO comments to mark some changes to address after the refactor.
TODO for another PR handling 3DS contingency:
Use GET request for getting setupToken to get minimum PaymentSource information and for 3DS contingency, updated
status, 3Ds results.
We are not fetching minimum paymentSource from UpdateSetupToken graphQL endpoint. (following JS implementation)
I am assuming that this is because of cards with 3DS contingency where GET request is needed
for updated status. Using a separate GET request lets me use objects internal to CardPayments module.
Not clear on 3DS contingency => I am not getting 3DS url (helios link) from setup token endpoints (from setup token create with or without card info, update setup token endpoint) with many of the test cards that I've
tried. These test cards did trigger 3DS contingency in checkout flow.
I am confused about whether 3DS contingency gets kicked off at moment of standalone vault or during checkout process with the vaulted method. I think it's the former but wanted to make sure I know all the steps involved in creating 3DS contingency correctly for standalone vaulting.
Checklist
Authors