You are an expert in writing code in many different languages. Your goal is to perform code completion for the following code, keeping in mind the rest of the code and the file meta data.
    Metadata details:
    filename: charge.rb
    path of file: ./repos/pay/lib/pay/paddle_billing
    
    the code of the file until where you have to start completion: module Pay
  module PaddleBilling
    class Charge
      attr_reader :pay_charge

      delegate :processor_id, :customer, to: :pay_charge

      def initialize(pay_charge)
        @pay_charge = pay_charge
      end

      def self.sync(charge_id, object: nil, try: 0, retries: 1)
        # Skip loading the latest ch
    
      def self.sync(charge_id, object: nil, try: 0, retries: 1)
        # Skip loading the latest charge details from the API if we already have it
        object ||= ::Paddle::Transaction.retrieve(id: charge_id)

        # Ignore transactions that aren't completed
        return unless object.status == "completed"

        # Ignore charges without a Customer
        return if object.customer_id.blank?

        pay_customer = Pay::Customer.find_by(processor: :paddle_billing, processor_id: object.customer_id)
        return unless pay_customer

        # Ignore transactions that are payment method changes
        # But update the customer's payment method
        if object.origin == "subscription_payment_method_change"
          Pay::PaddleBilling::PaymentMethod.sync(pay_customer: pay_customer, attributes: object.payments.first)
          return
        end