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

[BANKCON-14531] Update Instant Debits flow to call /share endpoint for Panther payments #4063

Merged
merged 2 commits into from
Sep 30, 2024

Conversation

mats-stripe
Copy link
Collaborator

Android equivalent: stripe/stripe-android#9308

Summary

This updates the Instant Debits flow to call the /consumers/payment_details/share endpoint instead of the /payment_methods endpoint for Panther payments. This endpoint, along with the expected_payment_method_type: "card" parameter will indicate whether or not we should "Panther-ize" the payment method response. Lots more details in the Panther eng plan!

Motivation

BANKCON-14531

Testing

With some minor changes to the mobile payment elements (PR coming next!) we can now see the full e2e flow in action!

Screen.Recording.2024-09-26.at.3.11.43.PM.mov

Changelog

N/a

with closure: @escaping (Value) throws -> T
) -> Future<T> {
chained { value in
chained(on: queue) { value in
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Drive-by cleanup of this recently merged method!

Comment on lines +958 to +966
let parameters: [String: Any] = [
"request_surface": requestSurface,
"id": paymentDetailsId,
"credentials": [
"consumer_session_client_secret": consumerSessionClientSecret
],
"expected_payment_method_type": expectedPaymentMethodType,
"expand": ["payment_method"],
]
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

consumerSessionClientSecret: consumerSession.clientSecret,
paymentDetailsId: paymentDetails.redactedPaymentDetails.id
)
.transformed { $0 as PaymentMethodIDProvider }
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

This is where we get to use that new type-erasure API!

Copy link
Collaborator

@tillh-stripe tillh-stripe left a comment

Choose a reason for hiding this comment

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

Looking good from a Link Card Brand perspective!

@mats-stripe mats-stripe force-pushed the mats/call_share_endpoint_for_panther_payments branch from cf977bb to 6440512 Compare September 27, 2024 18:45
Copy link

github-actions bot commented Sep 27, 2024

🚨 New dead code detected in this PR:

{
  "FinancialConnectionsAPIClient.swift_sharePaymentDetails(consumerSessionClientSecret:paymentDetailsId:expectedPaymentMethodType:)": "FinancialConnectionsAPIClient.swift: warning: sharePaymentDetails(consumerSessionClientSecret:paymentDetailsId:expectedPaymentMethodType:) is unused",
  "EmptyFinancialConnectionsAPIClient.swift_sharePaymentDetails(consumerSessionClientSecret:paymentDetailsId:expectedPaymentMethodType:)": "EmptyFinancialConnectionsAPIClient.swift: warning: sharePaymentDetails(consumerSessionClientSecret:paymentDetailsId:expectedPaymentMethodType:) 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, make sure your branch is up-to-date with master.

@mats-stripe mats-stripe merged commit c5f41e2 into master Sep 30, 2024
7 of 8 checks passed
@mats-stripe mats-stripe deleted the mats/call_share_endpoint_for_panther_payments branch September 30, 2024 18:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants