Skip to content
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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update GraphQL schema and CreatePaymentIntentMutation to match #1941

Merged
merged 1 commit into from
Feb 13, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
24 changes: 14 additions & 10 deletions KsApi/GraphAPI.swift
Original file line number Diff line number Diff line change
Expand Up @@ -746,14 +746,15 @@ public enum GraphAPI {
public var graphQLMap: GraphQLMap

/// - Parameters:
/// - projectId
/// - amountDollars
/// - digitalMarketingAttributed
/// - projectId: kickstarter project id
/// - amount: total amount to be paid (eg. 10.55)
/// - digitalMarketingAttributed: if the payment is attributed to digital marketing (default: false)
/// - clientMutationId: A unique identifier for the client performing the mutation.
public init(projectId: GraphQLID, amountDollars: String, digitalMarketingAttributed: Swift.Optional<Bool?> = nil, clientMutationId: Swift.Optional<String?> = nil) {
graphQLMap = ["projectId": projectId, "amountDollars": amountDollars, "digitalMarketingAttributed": digitalMarketingAttributed, "clientMutationId": clientMutationId]
public init(projectId: GraphQLID, amount: String, digitalMarketingAttributed: Swift.Optional<Bool?> = nil, clientMutationId: Swift.Optional<String?> = nil) {
graphQLMap = ["projectId": projectId, "amount": amount, "digitalMarketingAttributed": digitalMarketingAttributed, "clientMutationId": clientMutationId]
}

/// kickstarter project id
public var projectId: GraphQLID {
get {
return graphQLMap["projectId"] as! GraphQLID
Expand All @@ -763,15 +764,17 @@ public enum GraphAPI {
}
}

public var amountDollars: String {
/// total amount to be paid (eg. 10.55)
public var amount: String {
get {
return graphQLMap["amountDollars"] as! String
return graphQLMap["amount"] as! String
}
set {
graphQLMap.updateValue(newValue, forKey: "amountDollars")
graphQLMap.updateValue(newValue, forKey: "amount")
}
}

/// if the payment is attributed to digital marketing (default: false)
public var digitalMarketingAttributed: Swift.Optional<Bool?> {
get {
return graphQLMap["digitalMarketingAttributed"] as? Swift.Optional<Bool?> ?? Swift.Optional<Bool?>.none
Expand Down Expand Up @@ -4423,6 +4426,7 @@ public enum GraphAPI {
}
}

/// the stripe payment intent client secret used to complete a payment
public var clientSecret: String {
get {
return resultMap["clientSecret"]! as! String
Expand Down Expand Up @@ -8054,7 +8058,7 @@ public enum GraphAPI {
}
}

/// The current user's backing of this project.
/// The current user's backing of this project. Does not include inactive backings.
public var backing: Backing? {
get {
return (resultMap["backing"] as? ResultMap).flatMap { Backing(unsafeResultMap: $0) }
Expand Down Expand Up @@ -8350,7 +8354,7 @@ public enum GraphAPI {
}
}

/// The current user's backing of this project.
/// The current user's backing of this project. Does not include inactive backings.
public var backing: Backing? {
get {
return (resultMap["backing"] as? ResultMap).flatMap { Backing(unsafeResultMap: $0) }
Expand Down
2 changes: 1 addition & 1 deletion KsApi/MockService.swift
Original file line number Diff line number Diff line change
Expand Up @@ -676,7 +676,7 @@
let mutation = GraphAPI
.CreatePaymentIntentMutation(input: GraphAPI.CreatePaymentIntentInput(
projectId: input.projectId,
amountDollars: input.amountDollars,
amount: input.amountDollars,
digitalMarketingAttributed: input.digitalMarketingAttributed
))

Expand Down
2 changes: 1 addition & 1 deletion KsApi/Service.swift
Original file line number Diff line number Diff line change
Expand Up @@ -192,7 +192,7 @@ public struct Service: ServiceType {
.perform(mutation: GraphAPI
.CreatePaymentIntentMutation(input: GraphAPI.CreatePaymentIntentInput(
projectId: input.projectId,
amountDollars: input.amountDollars,
amount: input.amountDollars,
digitalMarketingAttributed: input.digitalMarketingAttributed
)))
.flatMap(PaymentIntentEnvelope.envelopeProducer(from:))
Expand Down