Method: Klarna::Checkout::Order.create_recurring

Defined in:
lib/klarna/checkout/order.rb

.create_recurring(locale:, order_lines:, order_amount:, order_tax_amount:, purchase_currency:, recurring_token:) ⇒ Object

For creating an order, using a recurring_token



29
30
31
32
33
34
35
36
37
38
39
40
41
42
# File 'lib/klarna/checkout/order.rb', line 29

def self.create_recurring(locale:, order_lines:, order_amount:, order_tax_amount:, purchase_currency:, recurring_token:)
  if recurring_token.nil?
    raise Klarna::Checkout::Errors::OrderValidationError.new('Argument missing', 'missing_recurring_token')
  end

  create_recurring_order(
    locale: locale,
    order_lines: order_lines,
    order_amount: order_amount,
    order_tax_amount: order_tax_amount,
    purchase_currency: purchase_currency,
    recurring_token: recurring_token
  )
end