Sha256: 8322590994ff2a49db28a5abc99d8c846c18dc6cce7d9d18ae906461ae1fe64e

Contents?: true

Size: 703 Bytes

Versions: 9

Compression:

Stored size: 703 Bytes

Contents

module Paddle
  module Classic
    class PaymentsResource < Resource
      def list(**params)
        response = post_request("2.0/subscription/payments", body: params)
        Collection.from_response(response, type: Payment)
      end

      def reschedule(payment_id:, date:)
        attrs = { payment_id: payment_id, date: date }
        response = post_request("2.0/subscription/payments_reschedule", body: attrs)
        true if response.success?
      end

      def refund(order_id:, **params)
        attrs = { order_id: order_id }
        response = post_request("2.0/payment/refund", body: attrs.merge(params))
        PaymentRefund.new(response.body["response"])
      end
    end
  end
end

Version data entries

9 entries across 9 versions & 1 rubygems

Version Path
paddle-2.7.0 lib/paddle/classic/resources/payments.rb
paddle-2.6.0 lib/paddle/classic/resources/payments.rb
paddle-2.5.2 lib/paddle/classic/resources/payments.rb
paddle-2.5.1 lib/paddle/classic/resources/payments.rb
paddle-2.5.0 lib/paddle/classic/resources/payments.rb
paddle-2.4.1 lib/paddle/classic/resources/payments.rb
paddle-2.4.0 lib/paddle/classic/resources/payments.rb
paddle-2.3.0 lib/paddle/classic/resources/payments.rb
paddle-2.2.1 lib/paddle/classic/resources/payments.rb