In my store, when a user checks out, I always want...
# support
e
In my store, when a user checks out, I always want them to pay half of the total amount on the order because they are only paying a deposit - i plan to redirect the user back to the payments page later to pay the rest. what would be the best way to force the payment checkout step's value to be half of the current order's total?
j
Most payment integrations always pull the order total. You're going to have to make some modifications to your payment integration to instead charge half.
e
Interesting. I'm using the new solidus stripe integration
anyone happen to know the easiest way to half the payment with this stripe integration?
j
I don't know it well enough. Should be easy enough to hunt down where the integration pulls the total to charge from and figure out how to change it, though.
e
hmm, is it the payment intent i want to change? i wonder if this is what i want to change
j
seems likely
e
Yeah ... I tried to override it with
Copy code
SolidusStripe::PaymentIntent.class_eval do
  def stripe_order_amount
    raise 'howdy'
  end
end
but that didn't run. anyone know the proper way to override this one method?
i also tried prepending the new method definition and adding it right to my models.. not sure what to try next
m
@Eric Gross You can read about this from solidus official guides.
e
@Muhammad Usama Yousaf thank you for the link. i have tried overriding the method and using
class_eval
so i think i tried all of the suggestions on that page... i wonder if this code isn't being run in tests for some reason but it would be if i checked out manually, i'll verify that
👀 1
Nope, must be a different method