Module: Klarna::Checkout::Operations::CreateRecurring

Included in:
Klarna::Checkout::Order
Defined in:
lib/klarna/checkout/operations/create_recurring.rb

Instance Method Summary collapse

Instance Method Details

#create_recurring_order(locale:, order_lines:, order_amount:, order_tax_amount:, purchase_currency:, recurring_token:) ⇒ Object



7
8
9
10
11
12
13
14
15
16
17
18
# File 'lib/klarna/checkout/operations/create_recurring.rb', line 7

def create_recurring_order(locale:, order_lines:, order_amount:, order_tax_amount:, purchase_currency:, recurring_token:)
  payload = {
    locale: locale,
    order_lines: order_lines,
    order_amount: order_amount,
    order_tax_amount: order_tax_amount,
    purchase_currency: purchase_currency,
    auto_capture: true
  }

  JSON.parse(request(payload.to_json, recurring_token))
end