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

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open

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
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.

None yet

1 participant