Sha256: e36c9a2a0da99a94843edd858d6e0b1c9efcc5cbf183d2fb40fc71d73e5f3242

Contents?: true

Size: 601 Bytes

Versions: 9

Compression:

Stored size: 601 Bytes

Contents

$: << File.expand_path(File.dirname(__FILE__) + '/../lib')

require "chargify_api_ares"

Chargify.configure do |c|
  c.subdomain = ENV['CHARGIFY_SUBDOMAIN']
  c.api_key   = ENV['CHARGIFY_API_KEY']
end

# Find a Chargify Subscription
sub = Chargify::Subscription.find_by_customer_reference 'abc-123-def-456'

# Record an external payment on the Chargify Subscription
pmt = sub.payment(
  amount_in_cents: 2500,
  memo: "Pre-payment for..."
)

# Or, create the external payment directly:
pmt = Chargify::Payment.create(
  subscription_id: sub.id,
  amount_in_cents: 2500,
  memo: "Pre-payment for..."
)

Version data entries

9 entries across 9 versions & 1 rubygems

Version Path
chargify_api_ares-1.4.15 examples/payments.rb
chargify_api_ares-1.4.14 examples/payments.rb
chargify_api_ares-1.4.13 examples/payments.rb
chargify_api_ares-1.4.11 examples/payments.rb
chargify_api_ares-1.4.10 examples/payments.rb
chargify_api_ares-1.4.7 examples/payments.rb
chargify_api_ares-1.4.6 examples/payments.rb
chargify_api_ares-1.4.5 examples/payments.rb
chargify_api_ares-1.4.4 examples/payments.rb