- πΊπΈUnited States TomTech
Automatically closed because Drupal 7 security and bugfix support has ended β as of 5 January 2025. If the issue verifiably applies β to later versions, please reopen with details and update the version.
In New Relic, I'm noticing that the API calls to Stripe can sometimes take a while. Currently, we have three things (potentially) happening when the payment form is submitted:
1. A charge is created.
2. A source is created at Stripe.
3. A Card on File entity is created.
In addition, I have new code in the works that updates the Stripe source if a user updates her Commerce Billing address/profile, to make sure the saved card stays current if the customer has moved and needs to update.
Stripe's docs recommend deferring all of these other API calls that are not strictly token- and charge-related into a webhook processor. I think this will be a good idea for sites like ours with lots of concurrent users who are looking to optimize performance however they can.
My idea is the following:
1. First, allow an option for store admins to choose either "At runtime" (default) or "From webhooks" for when and how to save user's cards during checkout.
2. Upon successful charge event, save the generated Stripe token within the $order->data array.
3. When a *.payment_succeeded webhook is received, if configured, retrieve the source and then:
4. If configured to, save the data as a Card on File, as well as a new Source for the customer.
5. This will also mean deferring the creation of a Stripe Customer to the webhook, since saving a card requires it (and we may not always want or need to create a Customer at checkout).
We might need to include additional information in the order, for example a customer_id if applicable.
I'll spin these off into some child issues, including a) new data to save with the order, and b) what events should react upon Webhook receiption, based on what we're doing currently in commerce_stripe_submit_form_submit().
Closed: outdated
3.0
Code
Not all content is available!
It's likely this issue predates Contrib.social: some issue and comment data are missing.
Automatically closed because Drupal 7 security and bugfix support has ended β as of 5 January 2025. If the issue verifiably applies β to later versions, please reopen with details and update the version.