Skip to content

Commit

Permalink
Remove params from ConfirmPaymentSourceRequest previously used in Vau…
Browse files Browse the repository at this point in the history
…lt w/ purchase flow
  • Loading branch information
scannillo committed Aug 9, 2023
1 parent 8e07e5d commit c83eb48
Showing 1 changed file with 1 addition and 15 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -40,19 +40,10 @@ struct ConfirmPaymentSourceRequest: Encodable {
}

enum AttributesKeys: String, CodingKey {
case customer
case vault
case verification
}

enum CustomerKeys: String, CodingKey {
case id
}

enum VaultKeys: String, CodingKey {
case storeInVault
}

enum VerificationKeys: String, CodingKey {
case method
}
Expand Down Expand Up @@ -93,13 +84,8 @@ struct ConfirmPaymentSourceRequest: Encodable {
try billingAddress.encode(cardBillingInfo.locality, forKey: .adminArea2)
try billingAddress.encode(cardBillingInfo.countryCode, forKey: .countryCode)
}
var attributes = card.nestedContainer(keyedBy: AttributesKeys.self, forKey: .attributes)
var customer = attributes.nestedContainer(keyedBy: CustomerKeys.self, forKey: .customer)
try customer.encode("fake-customer-id", forKey: .id) // TODO: - Re-expose vault feature

var vault = attributes.nestedContainer(keyedBy: VaultKeys.self, forKey: .vault)
try vault.encode("ON_SUCCESS", forKey: .storeInVault) // TODO: - Re-expose vault feature

var attributes = card.nestedContainer(keyedBy: AttributesKeys.self, forKey: .attributes)
var verification = attributes.nestedContainer(keyedBy: VerificationKeys.self, forKey: .verification)
try verification.encode(cardRequest.sca.rawValue, forKey: .method)
}
Expand Down

0 comments on commit c83eb48

Please sign in to comment.