repo stringlengths 5 92 | file_url stringlengths 80 287 | file_path stringlengths 5 197 | content stringlengths 0 32.8k | language stringclasses 1
value | license stringclasses 7
values | commit_sha stringlengths 40 40 | retrieved_at stringdate 2026-01-04 15:37:27 2026-01-04 17:58:21 | truncated bool 2
classes |
|---|---|---|---|---|---|---|---|---|
pay-rails/pay | https://github.com/pay-rails/pay/blob/98eb2a4f8556b111e551a7990522bb6a46be65f1/test/pay/paddle_classic/subscription_test.rb | test/pay/paddle_classic/subscription_test.rb | require "test_helper"
class Pay::PaddleClassic::Subscription::Test < ActiveSupport::TestCase
setup do
@pay_customer = pay_customers(:paddle_classic)
end
test "paddle classic cancel" do
subscription = @pay_customer.subscription
next_payment_date = Time.parse(subscription.api_record.next_payment[:date... | ruby | MIT | 98eb2a4f8556b111e551a7990522bb6a46be65f1 | 2026-01-04T15:57:25.277088Z | false |
pay-rails/pay | https://github.com/pay-rails/pay/blob/98eb2a4f8556b111e551a7990522bb6a46be65f1/test/pay/paddle_classic/webhooks/subscription_payment_succeeded_test.rb | test/pay/paddle_classic/webhooks/subscription_payment_succeeded_test.rb | require "test_helper"
class Pay::PaddleClassic::Webhooks::SubscriptionPaymentSucceededTest < ActiveSupport::TestCase
setup do
@data = paddle_classic_event("subscription_payment_succeeded")
@pay_customer = pay_customers(:paddle_classic)
@pay_customer.update(processor_id: @data.user_id)
end
test "padd... | ruby | MIT | 98eb2a4f8556b111e551a7990522bb6a46be65f1 | 2026-01-04T15:57:25.277088Z | false |
pay-rails/pay | https://github.com/pay-rails/pay/blob/98eb2a4f8556b111e551a7990522bb6a46be65f1/test/pay/paddle_classic/webhooks/subscription_updated_test.rb | test/pay/paddle_classic/webhooks/subscription_updated_test.rb | require "test_helper"
class Pay::PaddleClassic::Webhooks::SubscriptionUpdatedTest < ActiveSupport::TestCase
setup do
@data = paddle_classic_event("subscription_updated")
@pay_customer = pay_customers(:paddle_classic)
@pay_customer.update(processor_id: @data.user_id)
@pay_customer.subscription.update(... | ruby | MIT | 98eb2a4f8556b111e551a7990522bb6a46be65f1 | 2026-01-04T15:57:25.277088Z | false |
pay-rails/pay | https://github.com/pay-rails/pay/blob/98eb2a4f8556b111e551a7990522bb6a46be65f1/test/pay/paddle_classic/webhooks/signature_verifier_test.rb | test/pay/paddle_classic/webhooks/signature_verifier_test.rb | require "test_helper"
class Pay::PaddleClassic::Webhooks::SignatureVerifierTest < ActiveSupport::TestCase
setup do
@data = json_fixture("paddle_classic/subscription_created")
end
test "webhook signature is verified correctly" do
verifier = Pay::PaddleClassic::Webhooks::SignatureVerifier.new(@data)
a... | ruby | MIT | 98eb2a4f8556b111e551a7990522bb6a46be65f1 | 2026-01-04T15:57:25.277088Z | false |
pay-rails/pay | https://github.com/pay-rails/pay/blob/98eb2a4f8556b111e551a7990522bb6a46be65f1/test/pay/paddle_classic/webhooks/subscription_created_test.rb | test/pay/paddle_classic/webhooks/subscription_created_test.rb | require "test_helper"
class Pay::PaddleClassic::Webhooks::SubscriptionCreatedTest < ActiveSupport::TestCase
setup do
@data = paddle_classic_event("subscription_created")
@user = users(:paddle_classic)
end
test "paddle classic passthrough" do
json = JSON.parse Pay::PaddleClassic.passthrough(owner: @u... | ruby | MIT | 98eb2a4f8556b111e551a7990522bb6a46be65f1 | 2026-01-04T15:57:25.277088Z | false |
pay-rails/pay | https://github.com/pay-rails/pay/blob/98eb2a4f8556b111e551a7990522bb6a46be65f1/test/pay/paddle_classic/webhooks/subscription_cancelled_test.rb | test/pay/paddle_classic/webhooks/subscription_cancelled_test.rb | require "test_helper"
class Pay::PaddleClassic::Webhooks::SubscriptionCancelledTest < ActiveSupport::TestCase
setup do
@data = paddle_classic_event("subscription_cancelled")
@pay_customer = pay_customers(:paddle_classic)
@pay_customer.update(processor_id: @data.user_id)
end
test "it sets ends_at on ... | ruby | MIT | 98eb2a4f8556b111e551a7990522bb6a46be65f1 | 2026-01-04T15:57:25.277088Z | false |
pay-rails/pay | https://github.com/pay-rails/pay/blob/98eb2a4f8556b111e551a7990522bb6a46be65f1/test/pay/paddle_classic/webhooks/subscription_payment_refunded_test.rb | test/pay/paddle_classic/webhooks/subscription_payment_refunded_test.rb | require "test_helper"
class Pay::PaddleClassic::Webhooks::SubscriptionPaymentRefundedTest < ActiveSupport::TestCase
setup do
@data = paddle_classic_event("subscription_payment_refunded")
@pay_customer = pay_customers(:paddle_classic)
@pay_customer.update(processor_id: @data.user_id)
end
test "a char... | ruby | MIT | 98eb2a4f8556b111e551a7990522bb6a46be65f1 | 2026-01-04T15:57:25.277088Z | false |
pay-rails/pay | https://github.com/pay-rails/pay/blob/98eb2a4f8556b111e551a7990522bb6a46be65f1/test/routes/webhooks_test.rb | test/routes/webhooks_test.rb | # frozen_string_literal: true
require "test_helper"
class WebhookRoutesTest < ActionDispatch::IntegrationTest
test "stripe webhook routes get mounted correctly" do
post "/pay/webhooks/stripe", as: :json
assert_response :bad_request
end
test "braintree webhook routes get mounted correctly" do
post "... | ruby | MIT | 98eb2a4f8556b111e551a7990522bb6a46be65f1 | 2026-01-04T15:57:25.277088Z | false |
pay-rails/pay | https://github.com/pay-rails/pay/blob/98eb2a4f8556b111e551a7990522bb6a46be65f1/test/models/pay/payment_method_test.rb | test/models/pay/payment_method_test.rb | require "test_helper"
class Pay::PaymentMethodTest < ActiveSupport::TestCase
test "owner" do
assert_equal users(:stripe), pay_payment_methods(:one).owner
end
end
| ruby | MIT | 98eb2a4f8556b111e551a7990522bb6a46be65f1 | 2026-01-04T15:57:25.277088Z | false |
pay-rails/pay | https://github.com/pay-rails/pay/blob/98eb2a4f8556b111e551a7990522bb6a46be65f1/test/models/pay/charge_test.rb | test/models/pay/charge_test.rb | require "test_helper"
class Pay::Charge::Test < ActiveSupport::TestCase
test "belongs to a Pay::Customer" do
assert_equal Pay::Stripe::Customer, pay_charges(:stripe).customer.class
end
test "owner" do
assert_equal users(:stripe), pay_charges(:stripe).owner
end
test "braintree scope" do
assert P... | ruby | MIT | 98eb2a4f8556b111e551a7990522bb6a46be65f1 | 2026-01-04T15:57:25.277088Z | false |
pay-rails/pay | https://github.com/pay-rails/pay/blob/98eb2a4f8556b111e551a7990522bb6a46be65f1/test/models/pay/merchant_test.rb | test/models/pay/merchant_test.rb | require "test_helper"
class Pay::MerchantTest < ActiveSupport::TestCase
test "should return stripe connect onboarding status" do
merchant = Pay::Merchant.new
assert_equal false, merchant.onboarding_complete?
merchant.onboarding_complete = true
assert_equal true, merchant.onboarding_complete?
end
e... | ruby | MIT | 98eb2a4f8556b111e551a7990522bb6a46be65f1 | 2026-01-04T15:57:25.277088Z | false |
pay-rails/pay | https://github.com/pay-rails/pay/blob/98eb2a4f8556b111e551a7990522bb6a46be65f1/test/models/pay/customer_test.rb | test/models/pay/customer_test.rb | require "test_helper"
class Pay::CustomerTest < ActiveSupport::TestCase
test "active customers" do
results = Pay::Customer.active
assert_includes results, pay_customers(:stripe)
refute_includes results, pay_customers(:deleted)
end
test "deleted customers" do
assert_includes Pay::Customer.deleted... | ruby | MIT | 98eb2a4f8556b111e551a7990522bb6a46be65f1 | 2026-01-04T15:57:25.277088Z | false |
pay-rails/pay | https://github.com/pay-rails/pay/blob/98eb2a4f8556b111e551a7990522bb6a46be65f1/test/models/pay/subscription_test.rb | test/models/pay/subscription_test.rb | require "test_helper"
class Pay::Subscription::Test < ActiveSupport::TestCase
setup do
@owner = users(:fake)
@pay_customer = @owner.payment_processor
@subscription = @pay_customer.subscriptions.first
end
test "owner" do
assert_equal @owner, @subscription.owner
end
test "validates subscripti... | ruby | MIT | 98eb2a4f8556b111e551a7990522bb6a46be65f1 | 2026-01-04T15:57:25.277088Z | false |
pay-rails/pay | https://github.com/pay-rails/pay/blob/98eb2a4f8556b111e551a7990522bb6a46be65f1/test/models/pay/webhook_test.rb | test/models/pay/webhook_test.rb | require "test_helper"
class Pay::Webhook::Test < ActiveSupport::TestCase
test "rehydrates a Paddle Classic event" do
pay_webhook = Pay::Webhook.create processor: :paddle_classic, event_type: :example, event: json_fixture("paddle_classic/subscription_payment_succeeded")
event = pay_webhook.rehydrated_event
... | ruby | MIT | 98eb2a4f8556b111e551a7990522bb6a46be65f1 | 2026-01-04T15:57:25.277088Z | false |
pay-rails/pay | https://github.com/pay-rails/pay/blob/98eb2a4f8556b111e551a7990522bb6a46be65f1/test/dummy/app/jobs/application_job.rb | test/dummy/app/jobs/application_job.rb | class ApplicationJob < ActiveJob::Base
end
| ruby | MIT | 98eb2a4f8556b111e551a7990522bb6a46be65f1 | 2026-01-04T15:57:25.277088Z | false |
pay-rails/pay | https://github.com/pay-rails/pay/blob/98eb2a4f8556b111e551a7990522bb6a46be65f1/test/dummy/app/helpers/application_helper.rb | test/dummy/app/helpers/application_helper.rb | module ApplicationHelper
end
| ruby | MIT | 98eb2a4f8556b111e551a7990522bb6a46be65f1 | 2026-01-04T15:57:25.277088Z | false |
pay-rails/pay | https://github.com/pay-rails/pay/blob/98eb2a4f8556b111e551a7990522bb6a46be65f1/test/dummy/app/helpers/current_helper.rb | test/dummy/app/helpers/current_helper.rb | module CurrentHelper
def current_user
@current_user ||= User.first || User.create!(email: "test@user.com", first_name: "Test", last_name: "User")
end
def current_team
@current_user ||= Team.first || Team.create!(name: "Test Team", email: "test@team.com", owner: current_user)
end
end
| ruby | MIT | 98eb2a4f8556b111e551a7990522bb6a46be65f1 | 2026-01-04T15:57:25.277088Z | false |
pay-rails/pay | https://github.com/pay-rails/pay/blob/98eb2a4f8556b111e551a7990522bb6a46be65f1/test/dummy/app/controllers/payment_methods_controller.rb | test/dummy/app/controllers/payment_methods_controller.rb | class PaymentMethodsController < ApplicationController
def show
@payment_method = current_user.payment_processor&.default_payment_method
end
end
| ruby | MIT | 98eb2a4f8556b111e551a7990522bb6a46be65f1 | 2026-01-04T15:57:25.277088Z | false |
pay-rails/pay | https://github.com/pay-rails/pay/blob/98eb2a4f8556b111e551a7990522bb6a46be65f1/test/dummy/app/controllers/main_controller.rb | test/dummy/app/controllers/main_controller.rb | class MainController < ApplicationController
def show
end
end
| ruby | MIT | 98eb2a4f8556b111e551a7990522bb6a46be65f1 | 2026-01-04T15:57:25.277088Z | false |
pay-rails/pay | https://github.com/pay-rails/pay/blob/98eb2a4f8556b111e551a7990522bb6a46be65f1/test/dummy/app/controllers/application_controller.rb | test/dummy/app/controllers/application_controller.rb | class ApplicationController < ActionController::Base
include CurrentHelper
protect_from_forgery with: :exception
end
| ruby | MIT | 98eb2a4f8556b111e551a7990522bb6a46be65f1 | 2026-01-04T15:57:25.277088Z | false |
pay-rails/pay | https://github.com/pay-rails/pay/blob/98eb2a4f8556b111e551a7990522bb6a46be65f1/test/dummy/app/controllers/braintree/payment_methods_controller.rb | test/dummy/app/controllers/braintree/payment_methods_controller.rb | class Braintree::PaymentMethodsController < ApplicationController
def edit
end
def update
current_user.set_payment_processor params[:processor]
current_user.payment_processor.update_payment_method(params[:card_token])
redirect_to payment_method_path
end
end
| ruby | MIT | 98eb2a4f8556b111e551a7990522bb6a46be65f1 | 2026-01-04T15:57:25.277088Z | false |
pay-rails/pay | https://github.com/pay-rails/pay/blob/98eb2a4f8556b111e551a7990522bb6a46be65f1/test/dummy/app/controllers/braintree/subscriptions_controller.rb | test/dummy/app/controllers/braintree/subscriptions_controller.rb | class Braintree::SubscriptionsController < ApplicationController
before_action :set_subscription, only: [:show, :edit, :update, :destroy, :cancel, :resume]
def index
@subscriptions = Pay::Subscription.joins(:customer).where(pay_customers: {processor: :braintree}).order(created_at: :desc)
end
def show
en... | ruby | MIT | 98eb2a4f8556b111e551a7990522bb6a46be65f1 | 2026-01-04T15:57:25.277088Z | false |
pay-rails/pay | https://github.com/pay-rails/pay/blob/98eb2a4f8556b111e551a7990522bb6a46be65f1/test/dummy/app/controllers/braintree/charges_controller.rb | test/dummy/app/controllers/braintree/charges_controller.rb | class Braintree::ChargesController < ApplicationController
before_action :set_charge, only: [:show, :refund]
def index
@charges = Pay::Charge.joins(:customer).where(pay_customers: {processor: :braintree}).order(created_at: :desc)
end
def show
end
def new
end
def create
current_user.set_payme... | ruby | MIT | 98eb2a4f8556b111e551a7990522bb6a46be65f1 | 2026-01-04T15:57:25.277088Z | false |
pay-rails/pay | https://github.com/pay-rails/pay/blob/98eb2a4f8556b111e551a7990522bb6a46be65f1/test/dummy/app/controllers/lemon_squeezy/subscriptions_controller.rb | test/dummy/app/controllers/lemon_squeezy/subscriptions_controller.rb | module LemonSqueezy
class SubscriptionsController < ApplicationController
skip_forgery_protection(only: [:create]) # For testing purposes only
def index
@subscriptions = Pay::LemonSqueezy::Subscription.joins(:customer).where(pay_customers: {processor: :lemon_squeezy}).order(created_at: :desc)
end
... | ruby | MIT | 98eb2a4f8556b111e551a7990522bb6a46be65f1 | 2026-01-04T15:57:25.277088Z | false |
pay-rails/pay | https://github.com/pay-rails/pay/blob/98eb2a4f8556b111e551a7990522bb6a46be65f1/test/dummy/app/controllers/lemon_squeezy/charges_controller.rb | test/dummy/app/controllers/lemon_squeezy/charges_controller.rb | module LemonSqueezy
class ChargesController < ApplicationController
skip_forgery_protection(only: [:create]) # For testing purposes only
def index
@charges = Pay::LemonSqueezy::Charge.order(created_at: :desc)
end
def show
@charge = Pay::LemonSqueezy::Charge.find(params[:id])
end
... | ruby | MIT | 98eb2a4f8556b111e551a7990522bb6a46be65f1 | 2026-01-04T15:57:25.277088Z | false |
pay-rails/pay | https://github.com/pay-rails/pay/blob/98eb2a4f8556b111e551a7990522bb6a46be65f1/test/dummy/app/controllers/stripe/payment_methods_controller.rb | test/dummy/app/controllers/stripe/payment_methods_controller.rb | module Stripe
class PaymentMethodsController < ApplicationController
def edit
@setup_intent = ::Stripe::SetupIntent.create
end
def update
current_user.set_payment_processor params[:processor]
current_user.payment_processor.update_payment_method(params[:card_token])
redirect_to pay... | ruby | MIT | 98eb2a4f8556b111e551a7990522bb6a46be65f1 | 2026-01-04T15:57:25.277088Z | false |
pay-rails/pay | https://github.com/pay-rails/pay/blob/98eb2a4f8556b111e551a7990522bb6a46be65f1/test/dummy/app/controllers/stripe/subscriptions_controller.rb | test/dummy/app/controllers/stripe/subscriptions_controller.rb | module Stripe
class SubscriptionsController < ApplicationController
before_action :set_subscription, only: [:show, :edit, :update, :destroy, :cancel, :resume]
def index
@subscriptions = Pay::Subscription.joins(:customer).where(pay_customers: {processor: :stripe}).order(created_at: :desc)
end
d... | ruby | MIT | 98eb2a4f8556b111e551a7990522bb6a46be65f1 | 2026-01-04T15:57:25.277088Z | false |
pay-rails/pay | https://github.com/pay-rails/pay/blob/98eb2a4f8556b111e551a7990522bb6a46be65f1/test/dummy/app/controllers/stripe/checkouts_controller.rb | test/dummy/app/controllers/stripe/checkouts_controller.rb | module Stripe
class CheckoutsController < ApplicationController
def show
current_user.set_payment_processor :stripe
current_user.payment_processor.customer
@payment = current_user.payment_processor.checkout(mode: "payment", line_items: "price_1ILVZaKXBGcbgpbZQ26kgXWG")
@subscription = cur... | ruby | MIT | 98eb2a4f8556b111e551a7990522bb6a46be65f1 | 2026-01-04T15:57:25.277088Z | false |
pay-rails/pay | https://github.com/pay-rails/pay/blob/98eb2a4f8556b111e551a7990522bb6a46be65f1/test/dummy/app/controllers/stripe/charges_controller.rb | test/dummy/app/controllers/stripe/charges_controller.rb | module Stripe
class ChargesController < ApplicationController
before_action :set_charge, only: [:show, :refund]
def index
@charges = Pay::Charge.joins(:customer).where(pay_customers: {processor: :stripe}).order(created_at: :desc)
end
def show
end
def new
end
def create
... | ruby | MIT | 98eb2a4f8556b111e551a7990522bb6a46be65f1 | 2026-01-04T15:57:25.277088Z | false |
pay-rails/pay | https://github.com/pay-rails/pay/blob/98eb2a4f8556b111e551a7990522bb6a46be65f1/test/dummy/app/controllers/stripe/charges/imports_controller.rb | test/dummy/app/controllers/stripe/charges/imports_controller.rb | module Stripe
class Charges::ImportsController < ApplicationController
def new
end
def create
object = find_stripe_object
charge = Pay::Stripe::Webhooks::ChargeSucceeded.new.create_charge(User.first, object)
redirect_to stripe_charge_path(charge)
end
private
def find_strip... | ruby | MIT | 98eb2a4f8556b111e551a7990522bb6a46be65f1 | 2026-01-04T15:57:25.277088Z | false |
pay-rails/pay | https://github.com/pay-rails/pay/blob/98eb2a4f8556b111e551a7990522bb6a46be65f1/test/dummy/app/controllers/paddle_billing/payment_methods_controller.rb | test/dummy/app/controllers/paddle_billing/payment_methods_controller.rb | class PaddleBilling::PaymentMethodsController < ApplicationController
def edit
end
end
| ruby | MIT | 98eb2a4f8556b111e551a7990522bb6a46be65f1 | 2026-01-04T15:57:25.277088Z | false |
pay-rails/pay | https://github.com/pay-rails/pay/blob/98eb2a4f8556b111e551a7990522bb6a46be65f1/test/dummy/app/controllers/paddle_billing/subscriptions_controller.rb | test/dummy/app/controllers/paddle_billing/subscriptions_controller.rb | class PaddleBilling::SubscriptionsController < ApplicationController
before_action :set_subscription, only: [:show, :edit, :update, :destroy, :cancel, :resume]
def index
@subscriptions = Pay::Subscription.joins(:customer).where(pay_customers: {processor: :paddle_billing}).order(created_at: :desc)
end
def ... | ruby | MIT | 98eb2a4f8556b111e551a7990522bb6a46be65f1 | 2026-01-04T15:57:25.277088Z | false |
pay-rails/pay | https://github.com/pay-rails/pay/blob/98eb2a4f8556b111e551a7990522bb6a46be65f1/test/dummy/app/controllers/paddle_billing/charges_controller.rb | test/dummy/app/controllers/paddle_billing/charges_controller.rb | class PaddleBilling::ChargesController < ApplicationController
before_action :set_charge, only: [:show, :refund]
def index
@charges = Pay::Charge.joins(:customer).where(pay_customers: {processor: :paddle_billing}).order(created_at: :desc)
end
def show
end
def new
end
def create
current_user.... | ruby | MIT | 98eb2a4f8556b111e551a7990522bb6a46be65f1 | 2026-01-04T15:57:25.277088Z | false |
pay-rails/pay | https://github.com/pay-rails/pay/blob/98eb2a4f8556b111e551a7990522bb6a46be65f1/test/dummy/app/controllers/paddle_classic/payment_methods_controller.rb | test/dummy/app/controllers/paddle_classic/payment_methods_controller.rb | class PaddleClassic::PaymentMethodsController < ApplicationController
def edit
end
end
| ruby | MIT | 98eb2a4f8556b111e551a7990522bb6a46be65f1 | 2026-01-04T15:57:25.277088Z | false |
pay-rails/pay | https://github.com/pay-rails/pay/blob/98eb2a4f8556b111e551a7990522bb6a46be65f1/test/dummy/app/controllers/paddle_classic/subscriptions_controller.rb | test/dummy/app/controllers/paddle_classic/subscriptions_controller.rb | class PaddleClassic::SubscriptionsController < ApplicationController
before_action :set_subscription, only: [:show, :edit, :update, :destroy, :cancel, :resume]
def index
@subscriptions = Pay::Subscription.joins(:customer).where(pay_customers: {processor: :paddle_classic}).order(created_at: :desc)
end
def ... | ruby | MIT | 98eb2a4f8556b111e551a7990522bb6a46be65f1 | 2026-01-04T15:57:25.277088Z | false |
pay-rails/pay | https://github.com/pay-rails/pay/blob/98eb2a4f8556b111e551a7990522bb6a46be65f1/test/dummy/app/controllers/paddle_classic/charges_controller.rb | test/dummy/app/controllers/paddle_classic/charges_controller.rb | class PaddleClassic::ChargesController < ApplicationController
before_action :set_charge, only: [:show, :refund]
def index
@charges = Pay::Charge.joins(:customer).where(pay_customers: {processor: :paddle_classic}).order(created_at: :desc)
end
def show
end
def new
end
def create
current_user.... | ruby | MIT | 98eb2a4f8556b111e551a7990522bb6a46be65f1 | 2026-01-04T15:57:25.277088Z | false |
pay-rails/pay | https://github.com/pay-rails/pay/blob/98eb2a4f8556b111e551a7990522bb6a46be65f1/test/dummy/app/models/account.rb | test/dummy/app/models/account.rb | class Account < ApplicationRecord
pay_merchant
end
| ruby | MIT | 98eb2a4f8556b111e551a7990522bb6a46be65f1 | 2026-01-04T15:57:25.277088Z | false |
pay-rails/pay | https://github.com/pay-rails/pay/blob/98eb2a4f8556b111e551a7990522bb6a46be65f1/test/dummy/app/models/application_record.rb | test/dummy/app/models/application_record.rb | class ApplicationRecord < ActiveRecord::Base
self.abstract_class = true
end
| ruby | MIT | 98eb2a4f8556b111e551a7990522bb6a46be65f1 | 2026-01-04T15:57:25.277088Z | false |
pay-rails/pay | https://github.com/pay-rails/pay/blob/98eb2a4f8556b111e551a7990522bb6a46be65f1/test/dummy/app/models/team.rb | test/dummy/app/models/team.rb | class Team < ApplicationRecord
pay_customer
pay_merchant
belongs_to :owner, polymorphic: true
def email
owner.email
end
end
| ruby | MIT | 98eb2a4f8556b111e551a7990522bb6a46be65f1 | 2026-01-04T15:57:25.277088Z | false |
pay-rails/pay | https://github.com/pay-rails/pay/blob/98eb2a4f8556b111e551a7990522bb6a46be65f1/test/dummy/app/models/user.rb | test/dummy/app/models/user.rb | class User < ApplicationRecord
pay_customer
# pay_customer stripe_attributes: :stripe_attributes
# pay_customer stripe_attributes: ->(pay_customer) { { metadata: { user_id: pay_customer.owner_id } } }
def stripe_attributes(pay_customer)
{
description: "description",
address: { # Used for tax ca... | ruby | MIT | 98eb2a4f8556b111e551a7990522bb6a46be65f1 | 2026-01-04T15:57:25.277088Z | false |
pay-rails/pay | https://github.com/pay-rails/pay/blob/98eb2a4f8556b111e551a7990522bb6a46be65f1/test/dummy/app/webhooks/charge_succeeded.rb | test/dummy/app/webhooks/charge_succeeded.rb | class ChargeSucceeded
def call(event)
Rails.logger.debug event
end
end
| ruby | MIT | 98eb2a4f8556b111e551a7990522bb6a46be65f1 | 2026-01-04T15:57:25.277088Z | false |
pay-rails/pay | https://github.com/pay-rails/pay/blob/98eb2a4f8556b111e551a7990522bb6a46be65f1/test/dummy/app/mailers/application_mailer.rb | test/dummy/app/mailers/application_mailer.rb | class ApplicationMailer < ActionMailer::Base
default from: "from@example.com"
layout "mailer"
end
| ruby | MIT | 98eb2a4f8556b111e551a7990522bb6a46be65f1 | 2026-01-04T15:57:25.277088Z | false |
pay-rails/pay | https://github.com/pay-rails/pay/blob/98eb2a4f8556b111e551a7990522bb6a46be65f1/test/dummy/app/channels/application_cable/channel.rb | test/dummy/app/channels/application_cable/channel.rb | module ApplicationCable
class Channel < ActionCable::Channel::Base
end
end
| ruby | MIT | 98eb2a4f8556b111e551a7990522bb6a46be65f1 | 2026-01-04T15:57:25.277088Z | false |
pay-rails/pay | https://github.com/pay-rails/pay/blob/98eb2a4f8556b111e551a7990522bb6a46be65f1/test/dummy/app/channels/application_cable/connection.rb | test/dummy/app/channels/application_cable/connection.rb | module ApplicationCable
class Connection < ActionCable::Connection::Base
end
end
| ruby | MIT | 98eb2a4f8556b111e551a7990522bb6a46be65f1 | 2026-01-04T15:57:25.277088Z | false |
pay-rails/pay | https://github.com/pay-rails/pay/blob/98eb2a4f8556b111e551a7990522bb6a46be65f1/test/dummy/db/schema.rb | test/dummy/db/schema.rb | # This file is auto-generated from the current state of the database. Instead
# of editing this file, please use the migrations feature of Active Record to
# incrementally modify your database, and then regenerate this schema definition.
#
# This file is the source Rails uses to define your schema when running `bin/rai... | ruby | MIT | 98eb2a4f8556b111e551a7990522bb6a46be65f1 | 2026-01-04T15:57:25.277088Z | false |
pay-rails/pay | https://github.com/pay-rails/pay/blob/98eb2a4f8556b111e551a7990522bb6a46be65f1/test/dummy/db/migrate/20170205000000_create_users.rb | test/dummy/db/migrate/20170205000000_create_users.rb | class CreateUsers < ActiveRecord::Migration[6.0]
def change
create_table :users do |t|
t.string :email
t.string :first_name
t.string :last_name
t.text :extra_billing_info
end
create_table :teams do |t|
t.string :email
t.string :name
t.references :owner, polymorph... | ruby | MIT | 98eb2a4f8556b111e551a7990522bb6a46be65f1 | 2026-01-04T15:57:25.277088Z | false |
pay-rails/pay | https://github.com/pay-rails/pay/blob/98eb2a4f8556b111e551a7990522bb6a46be65f1/test/dummy/config/application.rb | test/dummy/config/application.rb | require_relative "boot"
require "rails/all"
Bundler.require(*Rails.groups)
require "pay"
module Dummy
class Application < Rails::Application
# Settings in config/environments/* take precedence over those specified here.
# Application configuration should go into files in config/initializers
# -- all .r... | ruby | MIT | 98eb2a4f8556b111e551a7990522bb6a46be65f1 | 2026-01-04T15:57:25.277088Z | false |
pay-rails/pay | https://github.com/pay-rails/pay/blob/98eb2a4f8556b111e551a7990522bb6a46be65f1/test/dummy/config/environment.rb | test/dummy/config/environment.rb | # Load the Rails application.
require_relative "application"
# Initialize the Rails application.
Rails.application.initialize!
| ruby | MIT | 98eb2a4f8556b111e551a7990522bb6a46be65f1 | 2026-01-04T15:57:25.277088Z | false |
pay-rails/pay | https://github.com/pay-rails/pay/blob/98eb2a4f8556b111e551a7990522bb6a46be65f1/test/dummy/config/puma.rb | test/dummy/config/puma.rb | # Puma can serve each request in a thread from an internal thread pool.
# The `threads` method setting takes two numbers a minimum and maximum.
# Any libraries that use thread pools should be configured to match
# the maximum value specified for Puma. Default is set to 5 threads for minimum
# and maximum, this matches ... | ruby | MIT | 98eb2a4f8556b111e551a7990522bb6a46be65f1 | 2026-01-04T15:57:25.277088Z | false |
pay-rails/pay | https://github.com/pay-rails/pay/blob/98eb2a4f8556b111e551a7990522bb6a46be65f1/test/dummy/config/routes.rb | test/dummy/config/routes.rb | # frozen_string_literals: true
Rails.application.routes.draw do
resource :payment_method
namespace :braintree do
resource :payment_method, namespace: :braintree
resources :subscriptions do
member do
patch :cancel
patch :resume
end
end
resources :charges do
member ... | ruby | MIT | 98eb2a4f8556b111e551a7990522bb6a46be65f1 | 2026-01-04T15:57:25.277088Z | false |
pay-rails/pay | https://github.com/pay-rails/pay/blob/98eb2a4f8556b111e551a7990522bb6a46be65f1/test/dummy/config/importmap.rb | test/dummy/config/importmap.rb | # Pin npm packages by running ./bin/importmap
pin "application", preload: true
pin "@hotwired/turbo-rails", to: "turbo.min.js", preload: true
pin "@hotwired/stimulus", to: "stimulus.min.js", preload: true
pin "@hotwired/stimulus-loading", to: "stimulus-loading.js", preload: true
pin_all_from "app/javascript/controller... | ruby | MIT | 98eb2a4f8556b111e551a7990522bb6a46be65f1 | 2026-01-04T15:57:25.277088Z | false |
pay-rails/pay | https://github.com/pay-rails/pay/blob/98eb2a4f8556b111e551a7990522bb6a46be65f1/test/dummy/config/spring.rb | test/dummy/config/spring.rb | %w[
.ruby-version
.rbenv-vars
tmp/restart.txt
tmp/caching-dev.txt
].each { |path| Spring.watch(path) }
| ruby | MIT | 98eb2a4f8556b111e551a7990522bb6a46be65f1 | 2026-01-04T15:57:25.277088Z | false |
pay-rails/pay | https://github.com/pay-rails/pay/blob/98eb2a4f8556b111e551a7990522bb6a46be65f1/test/dummy/config/boot.rb | test/dummy/config/boot.rb | # Set up gems listed in the Gemfile.
ENV['BUNDLE_GEMFILE'] ||= File.expand_path('../../../Gemfile', __dir__)
ENV["RAILS_ENV"] ||= "test"
require 'bundler/setup' if File.exist?(ENV['BUNDLE_GEMFILE'])
$LOAD_PATH.unshift File.expand_path('../../../lib', __dir__)
| ruby | MIT | 98eb2a4f8556b111e551a7990522bb6a46be65f1 | 2026-01-04T15:57:25.277088Z | false |
pay-rails/pay | https://github.com/pay-rails/pay/blob/98eb2a4f8556b111e551a7990522bb6a46be65f1/test/dummy/config/initializers/filter_parameter_logging.rb | test/dummy/config/initializers/filter_parameter_logging.rb | # Be sure to restart your server when you modify this file.
# Configure sensitive parameters which will be filtered from the log file.
Rails.application.config.filter_parameters += [:password]
| ruby | MIT | 98eb2a4f8556b111e551a7990522bb6a46be65f1 | 2026-01-04T15:57:25.277088Z | false |
pay-rails/pay | https://github.com/pay-rails/pay/blob/98eb2a4f8556b111e551a7990522bb6a46be65f1/test/dummy/config/initializers/application_controller_renderer.rb | test/dummy/config/initializers/application_controller_renderer.rb | # Be sure to restart your server when you modify this file.
# ApplicationController.renderer.defaults.merge!(
# http_host: 'example.org',
# https: false
# )
| ruby | MIT | 98eb2a4f8556b111e551a7990522bb6a46be65f1 | 2026-01-04T15:57:25.277088Z | false |
pay-rails/pay | https://github.com/pay-rails/pay/blob/98eb2a4f8556b111e551a7990522bb6a46be65f1/test/dummy/config/initializers/session_store.rb | test/dummy/config/initializers/session_store.rb | # Be sure to restart your server when you modify this file.
Rails.application.config.session_store :cookie_store, key: "_dummy_session"
| ruby | MIT | 98eb2a4f8556b111e551a7990522bb6a46be65f1 | 2026-01-04T15:57:25.277088Z | false |
pay-rails/pay | https://github.com/pay-rails/pay/blob/98eb2a4f8556b111e551a7990522bb6a46be65f1/test/dummy/config/initializers/pay.rb | test/dummy/config/initializers/pay.rb | ENV["BRAINTREE_PUBLIC_KEY"] ||= "5r59rrxhn89npc9n"
ENV["BRAINTREE_PRIVATE_KEY"] ||= "00f0df79303e1270881e5feda7788927"
ENV["BRAINTREE_MERCHANT_ID"] ||= "zyfwpztymjqdcc5g"
ENV["BRAINTREE_ENVIRONMENT"] ||= "sandbox"
Pay.setup do |config|
# For use in the receipt/refund/renewal mailers
config.business_name = "Test Bu... | ruby | MIT | 98eb2a4f8556b111e551a7990522bb6a46be65f1 | 2026-01-04T15:57:25.277088Z | false |
pay-rails/pay | https://github.com/pay-rails/pay/blob/98eb2a4f8556b111e551a7990522bb6a46be65f1/test/dummy/config/initializers/wrap_parameters.rb | test/dummy/config/initializers/wrap_parameters.rb | # Be sure to restart your server when you modify this file.
# This file contains settings for ActionController::ParamsWrapper which
# is enabled by default.
# Enable parameter wrapping for JSON. You can disable this by setting :format to an empty array.
ActiveSupport.on_load(:action_controller) do
wrap_parameters f... | ruby | MIT | 98eb2a4f8556b111e551a7990522bb6a46be65f1 | 2026-01-04T15:57:25.277088Z | false |
pay-rails/pay | https://github.com/pay-rails/pay/blob/98eb2a4f8556b111e551a7990522bb6a46be65f1/test/dummy/config/initializers/inflections.rb | test/dummy/config/initializers/inflections.rb | # Be sure to restart your server when you modify this file.
# Add new inflection rules using the following format. Inflections
# are locale specific, and you may define rules for as many different
# locales as you wish. All of these examples are active by default:
# ActiveSupport::Inflector.inflections(:en) do |inflec... | ruby | MIT | 98eb2a4f8556b111e551a7990522bb6a46be65f1 | 2026-01-04T15:57:25.277088Z | false |
pay-rails/pay | https://github.com/pay-rails/pay/blob/98eb2a4f8556b111e551a7990522bb6a46be65f1/test/dummy/config/initializers/cookies_serializer.rb | test/dummy/config/initializers/cookies_serializer.rb | # Be sure to restart your server when you modify this file.
# Specify a serializer for the signed and encrypted cookie jars.
# Valid options are :json, :marshal, and :hybrid.
Rails.application.config.action_dispatch.cookies_serializer = :json
| ruby | MIT | 98eb2a4f8556b111e551a7990522bb6a46be65f1 | 2026-01-04T15:57:25.277088Z | false |
pay-rails/pay | https://github.com/pay-rails/pay/blob/98eb2a4f8556b111e551a7990522bb6a46be65f1/test/dummy/config/initializers/assets.rb | test/dummy/config/initializers/assets.rb | # Be sure to restart your server when you modify this file.
# Version of your assets, change this if you want to expire all your assets.
Rails.application.config.assets.version = "1.0" if Rails.application.config.respond_to? :assets
# Add additional assets to the asset load path
# Rails.application.config.assets.path... | ruby | MIT | 98eb2a4f8556b111e551a7990522bb6a46be65f1 | 2026-01-04T15:57:25.277088Z | false |
pay-rails/pay | https://github.com/pay-rails/pay/blob/98eb2a4f8556b111e551a7990522bb6a46be65f1/test/dummy/config/initializers/backtrace_silencers.rb | test/dummy/config/initializers/backtrace_silencers.rb | # Be sure to restart your server when you modify this file.
# You can add backtrace silencers for libraries that you're using but don't wish to see in your backtraces.
# Rails.backtrace_cleaner.add_silencer { |line| line =~ /my_noisy_library/ }
# You can also remove all the silencers if you're trying to debug a probl... | ruby | MIT | 98eb2a4f8556b111e551a7990522bb6a46be65f1 | 2026-01-04T15:57:25.277088Z | false |
pay-rails/pay | https://github.com/pay-rails/pay/blob/98eb2a4f8556b111e551a7990522bb6a46be65f1/test/dummy/config/initializers/mime_types.rb | test/dummy/config/initializers/mime_types.rb | # Be sure to restart your server when you modify this file.
# Add new mime types for use in respond_to blocks:
# Mime::Type.register "text/richtext", :rtf
| ruby | MIT | 98eb2a4f8556b111e551a7990522bb6a46be65f1 | 2026-01-04T15:57:25.277088Z | false |
pay-rails/pay | https://github.com/pay-rails/pay/blob/98eb2a4f8556b111e551a7990522bb6a46be65f1/test/dummy/config/environments/test.rb | test/dummy/config/environments/test.rb | require "active_support/core_ext/integer/time"
# The test environment is used exclusively to run your application's
# test suite. You never need to work with it otherwise. Remember that
# your test database is "scratch space" for the test suite and is wiped
# and recreated between test runs. Don't rely on the data the... | ruby | MIT | 98eb2a4f8556b111e551a7990522bb6a46be65f1 | 2026-01-04T15:57:25.277088Z | false |
pay-rails/pay | https://github.com/pay-rails/pay/blob/98eb2a4f8556b111e551a7990522bb6a46be65f1/test/dummy/config/environments/development.rb | test/dummy/config/environments/development.rb | require "active_support/core_ext/integer/time"
Rails.application.configure do
# Settings specified here will take precedence over those in config/application.rb.
# In the development environment your application's code is reloaded any time
# it changes. This slows down response time but is perfect for developme... | ruby | MIT | 98eb2a4f8556b111e551a7990522bb6a46be65f1 | 2026-01-04T15:57:25.277088Z | false |
pay-rails/pay | https://github.com/pay-rails/pay/blob/98eb2a4f8556b111e551a7990522bb6a46be65f1/test/dummy/config/environments/production.rb | test/dummy/config/environments/production.rb | Rails.application.configure do
# Settings specified here will take precedence over those in config/application.rb.
# Code is not reloaded between requests.
config.cache_classes = true
# Eager load code on boot. This eager loads most of Rails and
# your application in memory, allowing both threaded web serve... | ruby | MIT | 98eb2a4f8556b111e551a7990522bb6a46be65f1 | 2026-01-04T15:57:25.277088Z | false |
pay-rails/pay | https://github.com/pay-rails/pay/blob/98eb2a4f8556b111e551a7990522bb6a46be65f1/test/mailers/pay/user_mailer_test.rb | test/mailers/pay/user_mailer_test.rb | require "test_helper"
class UserMailerTest < ActionMailer::TestCase
setup do
@charge = pay_charges(:stripe)
@pay_customer = @charge.customer
@user = @pay_customer.owner
@user.update(extra_billing_info: "extra billing info")
@charge.update stripe_invoice: JSON.parse(file_fixture("stripe/invoice.j... | ruby | MIT | 98eb2a4f8556b111e551a7990522bb6a46be65f1 | 2026-01-04T15:57:25.277088Z | false |
pay-rails/pay | https://github.com/pay-rails/pay/blob/98eb2a4f8556b111e551a7990522bb6a46be65f1/test/mailers/previews/pay/user_mailer_preview.rb | test/mailers/previews/pay/user_mailer_preview.rb | class Pay::UserMailerPreview < ActionMailer::Preview
def payment_action_required
Pay::UserMailer.with(
pay_customer: Pay::Customer.first,
payment_intent_id: "fake"
).payment_action_required
end
def payment_failed
Pay::UserMailer.with(
pay_customer: Pay::Customer.first
).payment_... | ruby | MIT | 98eb2a4f8556b111e551a7990522bb6a46be65f1 | 2026-01-04T15:57:25.277088Z | false |
pay-rails/pay | https://github.com/pay-rails/pay/blob/98eb2a4f8556b111e551a7990522bb6a46be65f1/lib/pay.rb | lib/pay.rb | require "pay/version"
require "pay/engine"
require "pay/errors"
require "pay/adapter"
require "action_mailer"
require "active_support"
module Pay
autoload :Attributes, "pay/attributes"
autoload :Env, "pay/env"
autoload :NanoId, "pay/nano_id"
autoload :Payment, "pay/payment"
autoload :Receipts, "pay/receipts... | ruby | MIT | 98eb2a4f8556b111e551a7990522bb6a46be65f1 | 2026-01-04T15:57:25.277088Z | false |
pay-rails/pay | https://github.com/pay-rails/pay/blob/98eb2a4f8556b111e551a7990522bb6a46be65f1/lib/pay/attributes.rb | lib/pay/attributes.rb | module Pay
# Adds Pay methods to ActiveRecord models
module Attributes
extend ActiveSupport::Concern
module CustomerExtension
extend ActiveSupport::Concern
included do
cattr_accessor :pay_default_payment_processor
cattr_accessor :pay_stripe_customer_attributes
cattr_ac... | ruby | MIT | 98eb2a4f8556b111e551a7990522bb6a46be65f1 | 2026-01-04T15:57:25.277088Z | false |
pay-rails/pay | https://github.com/pay-rails/pay/blob/98eb2a4f8556b111e551a7990522bb6a46be65f1/lib/pay/lemon_squeezy.rb | lib/pay/lemon_squeezy.rb | module Pay
module LemonSqueezy
class Error < Pay::Error
delegate :message, to: :cause
end
module Webhooks
autoload :Order, "pay/lemon_squeezy/webhooks/order"
autoload :Subscription, "pay/lemon_squeezy/webhooks/subscription"
autoload :SubscriptionPayment, "pay/lemon_squeezy/webhook... | ruby | MIT | 98eb2a4f8556b111e551a7990522bb6a46be65f1 | 2026-01-04T15:57:25.277088Z | false |
pay-rails/pay | https://github.com/pay-rails/pay/blob/98eb2a4f8556b111e551a7990522bb6a46be65f1/lib/pay/receipts.rb | lib/pay/receipts.rb | module Pay
module Receipts
def receipt_filename
"receipt-#{created_at.strftime("%Y-%m-%d")}.pdf"
end
alias_method :filename, :receipt_filename
def receipt
receipt_pdf.render
end
def receipt_details
[
[I18n.t("pay.receipt.number"), receipt_number],
[I18n.t("p... | ruby | MIT | 98eb2a4f8556b111e551a7990522bb6a46be65f1 | 2026-01-04T15:57:25.277088Z | false |
pay-rails/pay | https://github.com/pay-rails/pay/blob/98eb2a4f8556b111e551a7990522bb6a46be65f1/lib/pay/paddle_billing.rb | lib/pay/paddle_billing.rb | module Pay
module PaddleBilling
class Error < Pay::Error
delegate :message, to: :cause
end
module Webhooks
autoload :Subscription, "pay/paddle_billing/webhooks/subscription"
autoload :TransactionCompleted, "pay/paddle_billing/webhooks/transaction_completed"
end
extend Env
... | ruby | MIT | 98eb2a4f8556b111e551a7990522bb6a46be65f1 | 2026-01-04T15:57:25.277088Z | false |
pay-rails/pay | https://github.com/pay-rails/pay/blob/98eb2a4f8556b111e551a7990522bb6a46be65f1/lib/pay/version.rb | lib/pay/version.rb | module Pay
VERSION = "11.4.3"
end
| ruby | MIT | 98eb2a4f8556b111e551a7990522bb6a46be65f1 | 2026-01-04T15:57:25.277088Z | false |
pay-rails/pay | https://github.com/pay-rails/pay/blob/98eb2a4f8556b111e551a7990522bb6a46be65f1/lib/pay/paddle_classic.rb | lib/pay/paddle_classic.rb | module Pay
module PaddleClassic
class Error < Pay::Error
delegate :message, to: :cause
end
module Webhooks
autoload :SignatureVerifier, "pay/paddle_classic/webhooks/signature_verifier"
autoload :SubscriptionCreated, "pay/paddle_classic/webhooks/subscription_created"
autoload :Subs... | ruby | MIT | 98eb2a4f8556b111e551a7990522bb6a46be65f1 | 2026-01-04T15:57:25.277088Z | false |
pay-rails/pay | https://github.com/pay-rails/pay/blob/98eb2a4f8556b111e551a7990522bb6a46be65f1/lib/pay/webhooks.rb | lib/pay/webhooks.rb | module Pay
module Webhooks
autoload :Delegator, "pay/webhooks/delegator"
autoload :ProcessJob, "pay/webhooks/process_job"
class << self
delegate :configure, :instrument, to: :delegator
def delegator
@delegator ||= Delegator.new
end
end
end
end
| ruby | MIT | 98eb2a4f8556b111e551a7990522bb6a46be65f1 | 2026-01-04T15:57:25.277088Z | false |
pay-rails/pay | https://github.com/pay-rails/pay/blob/98eb2a4f8556b111e551a7990522bb6a46be65f1/lib/pay/errors.rb | lib/pay/errors.rb | module Pay
# https://avdi.codes/exception-causes-in-ruby-2-1/
class Error < StandardError
end
class PaymentError < StandardError
attr_reader :payment
def initialize(payment)
@payment = payment
end
end
class ActionRequired < PaymentError
def message
I18n.t("pay.errors.action_re... | ruby | MIT | 98eb2a4f8556b111e551a7990522bb6a46be65f1 | 2026-01-04T15:57:25.277088Z | false |
pay-rails/pay | https://github.com/pay-rails/pay/blob/98eb2a4f8556b111e551a7990522bb6a46be65f1/lib/pay/nano_id.rb | lib/pay/nano_id.rb | module Pay
module NanoId
# Generates unique IDs - faster than UUID
ALPHABET = "_-0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ".freeze
ALPHABET_SIZE = ALPHABET.size
def self.generate(size: 21)
id = +""
size.times { id << ALPHABET[(Random.rand * ALPHABET_SIZE).floor] }
... | ruby | MIT | 98eb2a4f8556b111e551a7990522bb6a46be65f1 | 2026-01-04T15:57:25.277088Z | false |
pay-rails/pay | https://github.com/pay-rails/pay/blob/98eb2a4f8556b111e551a7990522bb6a46be65f1/lib/pay/currency.rb | lib/pay/currency.rb | module Pay
class Currency
include ActionView::Helpers::NumberHelper
attr_reader :attributes
def self.all
@currencies ||= begin
path = Engine.root.join("config", "currencies", "iso.json")
JSON.parse File.read(path)
end
end
# Takes an amount (in cents) and currency and... | ruby | MIT | 98eb2a4f8556b111e551a7990522bb6a46be65f1 | 2026-01-04T15:57:25.277088Z | false |
pay-rails/pay | https://github.com/pay-rails/pay/blob/98eb2a4f8556b111e551a7990522bb6a46be65f1/lib/pay/adapter.rb | lib/pay/adapter.rb | module Pay
module Adapter
extend ActiveSupport::Concern
def self.current_adapter
if ActiveRecord::Base.respond_to?(:connection_db_config)
ActiveRecord::Base.connection_db_config.adapter
else
ActiveRecord::Base.connection_config[:adapter]
end
end
def self.json_column... | ruby | MIT | 98eb2a4f8556b111e551a7990522bb6a46be65f1 | 2026-01-04T15:57:25.277088Z | false |
pay-rails/pay | https://github.com/pay-rails/pay/blob/98eb2a4f8556b111e551a7990522bb6a46be65f1/lib/pay/env.rb | lib/pay/env.rb | module Pay
module Env
private
# Search for environment variables
#
# We must handle a lot of different cases, including the new Rails 6
# environment separated credentials files which have no nesting for
# the current environment.
#
# 1. Check environment variable
# 2. Check envir... | ruby | MIT | 98eb2a4f8556b111e551a7990522bb6a46be65f1 | 2026-01-04T15:57:25.277088Z | false |
pay-rails/pay | https://github.com/pay-rails/pay/blob/98eb2a4f8556b111e551a7990522bb6a46be65f1/lib/pay/braintree.rb | lib/pay/braintree.rb | module Pay
module Braintree
class Error < Pay::Error
# For any manually raised Braintree error results (for failure responses)
# we can raise this exception manually but treat it as if we wrapped an exception
attr_reader :result
def initialize(result)
if result.is_a?(::Braintree:... | ruby | MIT | 98eb2a4f8556b111e551a7990522bb6a46be65f1 | 2026-01-04T15:57:25.277088Z | false |
pay-rails/pay | https://github.com/pay-rails/pay/blob/98eb2a4f8556b111e551a7990522bb6a46be65f1/lib/pay/payment.rb | lib/pay/payment.rb | module Pay
class Payment
attr_reader :intent
delegate :id, :amount, :client_secret, :currency, :customer, :status, :confirm, to: :intent
def self.from_id(id)
intent = id.start_with?("seti_") ? ::Stripe::SetupIntent.retrieve(id) : ::Stripe::PaymentIntent.retrieve(id)
new(intent)
end
... | ruby | MIT | 98eb2a4f8556b111e551a7990522bb6a46be65f1 | 2026-01-04T15:57:25.277088Z | false |
pay-rails/pay | https://github.com/pay-rails/pay/blob/98eb2a4f8556b111e551a7990522bb6a46be65f1/lib/pay/engine.rb | lib/pay/engine.rb | # frozen_string_literal: true
module Pay
class Engine < ::Rails::Engine
engine_name "pay"
initializer "pay.processors" do |app|
if Pay.automount_routes
app.routes.append do
mount Pay::Engine, at: Pay.routes_path, as: "pay"
end
end
# Include the pay attributes for... | ruby | MIT | 98eb2a4f8556b111e551a7990522bb6a46be65f1 | 2026-01-04T15:57:25.277088Z | false |
pay-rails/pay | https://github.com/pay-rails/pay/blob/98eb2a4f8556b111e551a7990522bb6a46be65f1/lib/pay/stripe.rb | lib/pay/stripe.rb | module Pay
module Stripe
class Error < Pay::Error
end
module Webhooks
autoload :AccountUpdated, "pay/stripe/webhooks/account_updated"
autoload :ChargeRefunded, "pay/stripe/webhooks/charge_refunded"
autoload :ChargeSucceeded, "pay/stripe/webhooks/charge_succeeded"
autoload :ChargeU... | ruby | MIT | 98eb2a4f8556b111e551a7990522bb6a46be65f1 | 2026-01-04T15:57:25.277088Z | false |
pay-rails/pay | https://github.com/pay-rails/pay/blob/98eb2a4f8556b111e551a7990522bb6a46be65f1/lib/pay/fake_processor.rb | lib/pay/fake_processor.rb | module Pay
module FakeProcessor
class Error < Pay::Error
end
end
end
| ruby | MIT | 98eb2a4f8556b111e551a7990522bb6a46be65f1 | 2026-01-04T15:57:25.277088Z | false |
pay-rails/pay | https://github.com/pay-rails/pay/blob/98eb2a4f8556b111e551a7990522bb6a46be65f1/lib/pay/billable/sync_customer.rb | lib/pay/billable/sync_customer.rb | module Pay
module Billable
module SyncCustomer
# Syncs customer details to the payment processor.
# This way they're kept in sync and email notifications are
# always sent to the correct email address after an update.
extend ActiveSupport::Concern
included do
after_update_c... | ruby | MIT | 98eb2a4f8556b111e551a7990522bb6a46be65f1 | 2026-01-04T15:57:25.277088Z | false |
pay-rails/pay | https://github.com/pay-rails/pay/blob/98eb2a4f8556b111e551a7990522bb6a46be65f1/lib/pay/braintree/webhooks/subscription_went_past_due.rb | lib/pay/braintree/webhooks/subscription_went_past_due.rb | # A subscription has moved from the Active status to the Past Due status. This will only be triggered when the initial transaction in a billing cycle is declined. Once the status moves to past due, it will not be triggered again in that billing cycle.
module Pay
module Braintree
module Webhooks
class Subsc... | ruby | MIT | 98eb2a4f8556b111e551a7990522bb6a46be65f1 | 2026-01-04T15:57:25.277088Z | false |
pay-rails/pay | https://github.com/pay-rails/pay/blob/98eb2a4f8556b111e551a7990522bb6a46be65f1/lib/pay/braintree/webhooks/subscription_went_active.rb | lib/pay/braintree/webhooks/subscription_went_active.rb | # A subscription's first authorized transaction is created, or a successful transaction moves a subscription from the Past Due status to the Active status. Subscriptions with trial periods will not trigger this notification when they move from the trial period into the first billing cycle.
module Pay
module Braintre... | ruby | MIT | 98eb2a4f8556b111e551a7990522bb6a46be65f1 | 2026-01-04T15:57:25.277088Z | false |
pay-rails/pay | https://github.com/pay-rails/pay/blob/98eb2a4f8556b111e551a7990522bb6a46be65f1/lib/pay/braintree/webhooks/subscription_trial_ended.rb | lib/pay/braintree/webhooks/subscription_trial_ended.rb | # A subscription's trial period ends.
module Pay
module Braintree
module Webhooks
class SubscriptionTrialEnded
def call(event)
subscription = event.subscription
return if subscription.nil?
Pay::Braintree::Subscription.sync(subscription.id)
end
end
en... | ruby | MIT | 98eb2a4f8556b111e551a7990522bb6a46be65f1 | 2026-01-04T15:57:25.277088Z | false |
pay-rails/pay | https://github.com/pay-rails/pay/blob/98eb2a4f8556b111e551a7990522bb6a46be65f1/lib/pay/braintree/webhooks/subscription_charged_successfully.rb | lib/pay/braintree/webhooks/subscription_charged_successfully.rb | # A subscription successfully moves to the next billing cycle. This will also occur when either a new transaction is created mid-cycle due to proration on an upgrade or a billing cycle is skipped due to the presence of a negative balance that covers the cost of the subscription.
module Pay
module Braintree
modul... | ruby | MIT | 98eb2a4f8556b111e551a7990522bb6a46be65f1 | 2026-01-04T15:57:25.277088Z | false |
pay-rails/pay | https://github.com/pay-rails/pay/blob/98eb2a4f8556b111e551a7990522bb6a46be65f1/lib/pay/braintree/webhooks/subscription_charged_unsuccessfully.rb | lib/pay/braintree/webhooks/subscription_charged_unsuccessfully.rb | # A subscription successfully moves to the next billing cycle. This will also occur when either a new transaction is created mid-cycle due to proration on an upgrade or a billing cycle is skipped due to the presence of a negative balance that covers the cost of the subscription.
module Pay
module Braintree
modul... | ruby | MIT | 98eb2a4f8556b111e551a7990522bb6a46be65f1 | 2026-01-04T15:57:25.277088Z | false |
pay-rails/pay | https://github.com/pay-rails/pay/blob/98eb2a4f8556b111e551a7990522bb6a46be65f1/lib/pay/braintree/webhooks/subscription_expired.rb | lib/pay/braintree/webhooks/subscription_expired.rb | # A subscription reaches the specified number of billing cycles and expires.
module Pay
module Braintree
module Webhooks
class SubscriptionExpired
def call(event)
subscription = event.subscription
return if subscription.nil?
Pay::Braintree::Subscription.sync(subscript... | ruby | MIT | 98eb2a4f8556b111e551a7990522bb6a46be65f1 | 2026-01-04T15:57:25.277088Z | false |
pay-rails/pay | https://github.com/pay-rails/pay/blob/98eb2a4f8556b111e551a7990522bb6a46be65f1/lib/pay/braintree/webhooks/subscription_canceled.rb | lib/pay/braintree/webhooks/subscription_canceled.rb | # A subscription is canceled.
module Pay
module Braintree
module Webhooks
class SubscriptionCanceled
def call(event)
subscription = event.subscription
return if subscription.nil?
Pay::Braintree::Subscription.sync(subscription.id)
end
end
end
end
en... | ruby | MIT | 98eb2a4f8556b111e551a7990522bb6a46be65f1 | 2026-01-04T15:57:25.277088Z | false |
pay-rails/pay | https://github.com/pay-rails/pay/blob/98eb2a4f8556b111e551a7990522bb6a46be65f1/lib/pay/lemon_squeezy/webhooks/subscription.rb | lib/pay/lemon_squeezy/webhooks/subscription.rb | module Pay
module LemonSqueezy
module Webhooks
class Subscription
def call(subscription)
Pay::LemonSqueezy::Subscription.sync(subscription.id, object: subscription)
end
end
end
end
end
| ruby | MIT | 98eb2a4f8556b111e551a7990522bb6a46be65f1 | 2026-01-04T15:57:25.277088Z | false |
pay-rails/pay | https://github.com/pay-rails/pay/blob/98eb2a4f8556b111e551a7990522bb6a46be65f1/lib/pay/lemon_squeezy/webhooks/subscription_payment.rb | lib/pay/lemon_squeezy/webhooks/subscription_payment.rb | module Pay
module LemonSqueezy
module Webhooks
class SubscriptionPayment
def call(subscription_invoice)
Pay::LemonSqueezy::Charge.sync_subscription_invoice(subscription_invoice.id, object: subscription_invoice)
end
end
end
end
end
| ruby | MIT | 98eb2a4f8556b111e551a7990522bb6a46be65f1 | 2026-01-04T15:57:25.277088Z | false |
pay-rails/pay | https://github.com/pay-rails/pay/blob/98eb2a4f8556b111e551a7990522bb6a46be65f1/lib/pay/lemon_squeezy/webhooks/order.rb | lib/pay/lemon_squeezy/webhooks/order.rb | module Pay
module LemonSqueezy
module Webhooks
class Order
def call(order)
Pay::LemonSqueezy.sync_order(order.id, object: order)
end
end
end
end
end
| ruby | MIT | 98eb2a4f8556b111e551a7990522bb6a46be65f1 | 2026-01-04T15:57:25.277088Z | false |
pay-rails/pay | https://github.com/pay-rails/pay/blob/98eb2a4f8556b111e551a7990522bb6a46be65f1/lib/pay/stripe/webhooks/subscription_deleted.rb | lib/pay/stripe/webhooks/subscription_deleted.rb | module Pay
module Stripe
module Webhooks
class SubscriptionDeleted
def call(event)
# Canceled subscriptions are still accessible via the API, so we can sync their details
Pay::Stripe::Subscription.sync(event.data.object.id, stripe_account: event.try(:account))
end
e... | ruby | MIT | 98eb2a4f8556b111e551a7990522bb6a46be65f1 | 2026-01-04T15:57:25.277088Z | false |
pay-rails/pay | https://github.com/pay-rails/pay/blob/98eb2a4f8556b111e551a7990522bb6a46be65f1/lib/pay/stripe/webhooks/payment_intent_succeeded.rb | lib/pay/stripe/webhooks/payment_intent_succeeded.rb | module Pay
module Stripe
module Webhooks
class PaymentIntentSucceeded
# This webhook does NOT send notifications because stripe sends both
# `charge.succeeded` and `payment_intent.succeeded` events.
#
# We use `charge.succeeded` as the single place to send notifications
... | ruby | MIT | 98eb2a4f8556b111e551a7990522bb6a46be65f1 | 2026-01-04T15:57:25.277088Z | false |
pay-rails/pay | https://github.com/pay-rails/pay/blob/98eb2a4f8556b111e551a7990522bb6a46be65f1/lib/pay/stripe/webhooks/subscription_created.rb | lib/pay/stripe/webhooks/subscription_created.rb | module Pay
module Stripe
module Webhooks
class SubscriptionCreated
def call(event)
Pay::Stripe::Subscription.sync(event.data.object.id, stripe_account: event.try(:account))
end
end
end
end
end
| ruby | MIT | 98eb2a4f8556b111e551a7990522bb6a46be65f1 | 2026-01-04T15:57:25.277088Z | false |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.