Sha256: 309d768ccd181d3d814b3e79253dd5b7f927564553a13e9c08b2c6665e80c136

Contents?: true

Size: 298 Bytes

Versions: 2

Compression:

Stored size: 298 Bytes

Contents

module Tang
  class DeleteCoupon
    def self.call(coupon)
      begin
        c = Stripe::Coupon.retrieve(coupon.stripe_id)
        c.delete        
      rescue Stripe::StripeError => e
        coupon.errors.add(:base, :invalid, message: e.message)
      end
      return coupon
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
tang-0.2.2 app/services/tang/delete_coupon.rb
tang-0.2.1 app/services/tang/delete_coupon.rb