Add setup intents support to stripe dashboard link helper#212
Conversation
waiting-for-dev
left a comment
There was a problem hiding this comment.
Thanks, @elia! I left a couple of suggestions, although feel free to go ahead if you think that's premature optimization before we have a more defined interface.
| SolidusStripe::PaymentIntent.where(order: payment.order).pick(:stripe_payment_intent_id) || | ||
| SolidusStripe::SetupIntent.where(order: payment.order).pick(:stripe_setup_intent_id) |
There was a problem hiding this comment.
Thoughts on extracting the logic to the classes? Like:
class SolidusStripe::PaymentIntent
def self.stripe_id(order)
where(order: order).pick(:stripe_payment_intent_id)
endThat could help duck-typing at a later stage if we're not ready yet.
| when /^pi_/ | ||
| "https://dashboard.stripe.com#{path_prefix}/payments/#{intent_id}" | ||
| when /^seti_/ | ||
| "https://dashboard.stripe.com#{path_prefix}/setup_intents/#{intent_id}" |
There was a problem hiding this comment.
Similarly, we could duck type here, although the problem is the payment.transaction_id getting in the way.
|
@elia, linting is failing, though 🙂 |
@waiting-for-dev yeah, I dared to skip the draft at my own peril 😅 – fixing it 👍 |
|
@waiting-for-dev I'll keep the suggestions for the strategy class, for this one I just wanted to have a working link for manual tests 🙌 |
Those for setup intents were missing.
cf55521 to
9fe3784
Compare
Summary
We added payment and setup intents classes attached to the order and we should provide dashboard links in accordance to it.
Checklist
Check out our PR guidelines for more details.
The following are mandatory for all PRs:
The following are not always needed: