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’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Move BillingDetails model to StripeCore module, and pass to ElementsSessionContext #4142

Draft
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

mats-stripe
Copy link
Collaborator

Summary

Motivation

Testing

Changelog

Copy link

🚨 New dead code detected in this PR:

FinancialConnectionsAPIClient.swift:236 warning: Function 'sharePaymentDetails(consumerSessionClientSecret:paymentDetailsId:expectedPaymentMethodType:billingDetails:)' is unused
FinancialConnectionsAPIClient.swift:243 warning: Function 'paymentMethods(consumerSessionClientSecret:paymentDetailsId:billingDetails:)' is unused

Please remove the dead code before merging.

If this is intentional, you can bypass this check by adding the label skip dead code check to this PR.

ℹ️ If this comment appears to be left in error, double check that the flagged code is actually used and/or make sure your branch is up-to-date with master.

Copy link

⚠️ Public API changes detected:

StripeCore

- public struct BillingDetails : StripeCore.UnknownFieldsCodable {
- public var address: StripeCore.StripeAPI.BillingDetails.Address?
- public struct Address : StripeCore.UnknownFieldsCodable {
- public var line1: Swift.String?
- public var line2: Swift.String?
- public var city: Swift.String?
- public var state: Swift.String?
- public var postalCode: Swift.String?
- public var country: Swift.String?
- public var _additionalParametersStorage: StripeCore.NonEncodableParameters?
- public var _allResponseFieldsStorage: StripeCore.NonEncodableParameters?
- public init(line1: Swift.String? = nil, line2: Swift.String? = nil, city: Swift.String? = nil, state: Swift.String? = nil, postalCode: Swift.String? = nil, country: Swift.String? = nil)
- public func encode(to encoder: any Swift.Encoder) throws
- public init(from decoder: any Swift.Decoder) throws
+ }
- public var email: Swift.String?
- public var name: Swift.String?
- public var phone: Swift.String?
- public var _additionalParametersStorage: StripeCore.NonEncodableParameters?
- public var _allResponseFieldsStorage: StripeCore.NonEncodableParameters?
- public init(address: StripeCore.StripeAPI.BillingDetails.Address? = nil, email: Swift.String? = nil, name: Swift.String? = nil, phone: Swift.String? = nil)
- public func encode(to encoder: any Swift.Encoder) throws
- public init(from decoder: any Swift.Decoder) throws
+ }

StripeApplePay

- public struct BillingDetails : StripeCore.UnknownFieldsCodable {
- public var address: StripeCore.StripeAPI.BillingDetails.Address?
- public struct Address : StripeCore.UnknownFieldsCodable {
- public var line1: Swift.String?
- public var line2: Swift.String?
- public var city: Swift.String?
- public var state: Swift.String?
- public var postalCode: Swift.String?
- public var country: Swift.String?
- public var _additionalParametersStorage: StripeCore.NonEncodableParameters?
- public var _allResponseFieldsStorage: StripeCore.NonEncodableParameters?
- public func encode(to encoder: any Swift.Encoder) throws
- public init(from decoder: any Swift.Decoder) throws
- }
- public var email: Swift.String?
- public var name: Swift.String?
- public var phone: Swift.String?
- public var _additionalParametersStorage: StripeCore.NonEncodableParameters?
- public var _allResponseFieldsStorage: StripeCore.NonEncodableParameters?
- public func encode(to encoder: any Swift.Encoder) throws
- public init(from decoder: any Swift.Decoder) throws
- }

If you are adding a new public API consider the following:

  • Do these APIs need to be public or can they be protected with @_spi(STP)?
  • If these APIs need to be public, assess whether they require an API review.

If you are modifying or removing a public API:

  • Does this require a breaking version change?
  • Do these changes require API review?

If you confirm these APIs need to be added/updated and have undergone necessary review, add the label modifies public API to this PR to acknowledge and bypass this check.

ℹ️ If this comment appears to be left in error, make sure your branch is up-to-date with master.

let encoder = JSONEncoder()
encoder.keyEncodingStrategy = .convertToSnakeCase
let encodedBillingDetails = try encoder.encode(billingDetails)
parameters["billing_details"] = encodedBillingDetails
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant