Method: ActiveMerchant::Billing::BluePayGateway#recurring
- Defined in:
- lib/active_merchant/billing/gateways/blue_pay.rb
#recurring(money, payment_object, options = {}) ⇒ Object
Options
-
:rebill_start_date is a string that tells the gateway when to start the rebill. (REQUIRED) Has two valid formats: "YYYY-MM-DD HH:MM:SS" Hours, minutes, and seconds are optional. "XX UNITS" Relative date as explained below. Marked from the time of the transaction (i.e.: 10 DAYS, 1 MONTH, 1 YEAR)
-
:rebill_expression is the period of time in-between rebillings. (REQUIRED) It uses the same "XX UNITS" format as rebill_start_date, explained above. Optional parameters include:
-
rebill_cycles: Number of times to rebill. Don't send or set to nil for infinite rebillings (or until canceled).
-
rebill_amount: Amount to rebill. Defaults to amount of transaction for rebillings.
For example, to charge the customer $19.95 now and then charge $39.95 in 60 days every 3 months for 5 times, the options hash would be as follows: :rebill_start_date => '60 DAYS', :rebill_expression => '3 MONTHS', :rebill_cycles => '5', :rebill_amount => '39.95' A money object of 1995 cents would be passed into the 'money' parameter.
231 232 233 234 235 236 237 238 239 240 241 |
# File 'lib/active_merchant/billing/gateways/blue_pay.rb', line 231 def recurring(money, payment_object, = {}) ActiveMerchant.deprecated RECURRING_DEPRECATION_MESSAGE requires!(, :rebill_start_date, :rebill_expression) [:rebill] = true if money purchase(money, payment_object, ) else (money, payment_object, ) end end |