Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Paddle Billing and Stripe sync methods #943

Merged
merged 1 commit into from
Jul 10, 2024
Merged

Add Paddle Billing and Stripe sync methods #943

merged 1 commit into from
Jul 10, 2024

Conversation

excid3
Copy link
Collaborator

@excid3 excid3 commented Jan 19, 2024

The goal of this PR is to introduce a simple interface for syncing one-time or subscription transactions. For Stripe, this is syncing Checkout Sessions and determining the Charge or Subscription to sync. For Paddle Billing, this retrieves a Transaction and determines if it is a charge or subscription.

We can also take this a step further and provide a method that takes a hash (like params) and determines whether to sync from Stripe, Paddle Billing, etc.

The end goal is to provide integrations a single method to call for syncing after checkout.

class Checkout::CompletedController < ApplicationController
  def show
    charge_or_subscription = Pay.sync(params)
    # handle fulfillment
    redirect_to root_path, notice: "Thanks for your purchase!"
  end
end

@excid3 excid3 self-assigned this Jan 19, 2024
@excid3 excid3 added the Paddle label Jan 29, 2024
@excid3 excid3 merged commit 078c69f into main Jul 10, 2024
36 checks passed
@excid3 excid3 deleted the sync-methods branch July 10, 2024 16:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant