class Pay::Stripe::Customer
def charge(amount, options = {})
def charge(amount, options = {}) args = {confirm: true, payment_method: default_payment_method&.processor_id}.merge(options) payment_intent = create_payment_intent(amount, args) Pay::Payment.new(payment_intent).validate charge = payment_intent.latest_charge Pay::Stripe::Charge.sync(charge.id, object: charge) rescue ::Stripe::StripeError => e raise Pay::Stripe::Error, e end