Class: Stripe::InvoiceService::PayParams

Inherits:
RequestParams show all
Defined in:
lib/stripe/services/invoice_service.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods inherited from RequestParams

#to_h

Constructor Details

#initialize(expand: nil, forgive: nil, mandate: nil, off_session: nil, paid_out_of_band: nil, payment_method: nil, source: nil) ⇒ PayParams

Returns a new instance of PayParams.



1804
1805
1806
1807
1808
1809
1810
1811
1812
1813
1814
1815
1816
1817
1818
1819
1820
# File 'lib/stripe/services/invoice_service.rb', line 1804

def initialize(
  expand: nil,
  forgive: nil,
  mandate: nil,
  off_session: nil,
  paid_out_of_band: nil,
  payment_method: nil,
  source: nil
)
  @expand = expand
  @forgive = forgive
  @mandate = mandate
  @off_session = off_session
  @paid_out_of_band = paid_out_of_band
  @payment_method = payment_method
  @source = source
end

Instance Attribute Details

#expandObject

Specifies which fields in the response should be expanded.



1788
1789
1790
# File 'lib/stripe/services/invoice_service.rb', line 1788

def expand
  @expand
end

#forgiveObject

In cases where the source used to pay the invoice has insufficient funds, passing ‘forgive=true` controls whether a charge should be attempted for the full amount available on the source, up to the amount to fully pay the invoice. This effectively forgives the difference between the amount available on the source and the amount due.

Passing ‘forgive=false` will fail the charge if the source hasn’t been pre-funded with the right amount. An example for this case is with ACH Credit Transfers and wires: if the amount wired is less than the amount due by a small amount, you might want to forgive the difference. Defaults to ‘false`.



1792
1793
1794
# File 'lib/stripe/services/invoice_service.rb', line 1792

def forgive
  @forgive
end

#mandateObject

ID of the mandate to be used for this invoice. It must correspond to the payment method used to pay the invoice, including the payment_method param or the invoice’s default_payment_method or default_source, if set.



1794
1795
1796
# File 'lib/stripe/services/invoice_service.rb', line 1794

def mandate
  @mandate
end

#off_sessionObject

Indicates if a customer is on or off-session while an invoice payment is attempted. Defaults to ‘true` (off-session).



1796
1797
1798
# File 'lib/stripe/services/invoice_service.rb', line 1796

def off_session
  @off_session
end

Boolean representing whether an invoice is paid outside of Stripe. This will result in no charge being made. Defaults to ‘false`.



1798
1799
1800
# File 'lib/stripe/services/invoice_service.rb', line 1798

def paid_out_of_band
  @paid_out_of_band
end

#payment_methodObject

A PaymentMethod to be charged. The PaymentMethod must be the ID of a PaymentMethod belonging to the customer associated with the invoice being paid.



1800
1801
1802
# File 'lib/stripe/services/invoice_service.rb', line 1800

def payment_method
  @payment_method
end

#sourceObject

A payment source to be charged. The source must be the ID of a source belonging to the customer associated with the invoice being paid.



1802
1803
1804
# File 'lib/stripe/services/invoice_service.rb', line 1802

def source
  @source
end