-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
[MBL-1273] Implement Create Checkout Mutation #1982
Conversation
|
||
return CreateCheckoutInput( | ||
projectId: project.graphID, | ||
amount: "\(pledgeTotal)", |
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.
Presumably pledgeTotal
is a double - does it need to be formatted in a specific way for the server? My concern would be that the automatic printer might output "7" or "7.0" or "7.000000001" and the server might expect a specific number of decimal places.
return CreateCheckoutInput( | ||
projectId: project.graphID, | ||
amount: "\(pledgeTotal)", | ||
locationId: "\(project.location.id)", |
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.
Unconcerned about this one because it's an int.
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.
This LGTM, but only assuming that the print for pledgeTotal
gives you something consistent/sane.
I'd recommend using a more specific print formatter like String.format("%.2d", pledgeTotal)
or NumberFormatter
so that you're guaranteed consistent results; I'd also be fine with it if there's documentation that proves this doesn't matter (either on the GraphQL side or the Swift side).
I don't know how clever the GraphQL parser is about numeric types, nor how clever Swift wants to be, I just trust neither 😉
…thub.com/kickstarter/ios-oss into scott/pcb/create-checkout-implementation
📲 What
When the CTA on Confirm Details is pressed, call CreateCheckout
🤔 Why
The ValidateCheckout Mutation that will be called on the checkout screen needs a
checkoutId
returned from this mutation. We'll call it here and if successful navigate to the checkout screen, passing along thecheckoutId
.🛠 How
The checkout screen isn't complete yet so there's nothing to navigate to, but we can wire this new mutation up in the meantime.
✅ Acceptance criteria
⏰ TODO