Sha256: 68f78f51885cbff2b5b125215d943edf3733502da6dc166f4ceb596096c4225f
Contents?: true
Size: 640 Bytes
Versions: 10
Compression:
Stored size: 640 Bytes
Contents
module Pay module Stripe class Charge attr_reader :pay_charge delegate :processor_id, :owner, to: :pay_charge def initialize(pay_charge) @pay_charge = pay_charge end def charge ::Stripe::Charge.retrieve(processor_id) rescue ::Stripe::StripeError => e raise Pay::Stripe::Error, e end def refund!(amount_to_refund) ::Stripe::Refund.create(charge: processor_id, amount: amount_to_refund) pay_charge.update(amount_refunded: amount_to_refund) rescue ::Stripe::StripeError => e raise Pay::Stripe::Error, e end end end end
Version data entries
10 entries across 10 versions & 1 rubygems