Sha256: 20c830b5fde3e5ed5fa12dd01d5d1edcf67fa393f9f8169299d9c33616c45c03

Contents?: true

Size: 412 Bytes

Versions: 4

Compression:

Stored size: 412 Bytes

Contents

module Workarea
  decorate Order, with: :afterpay do
    decorated do
      field :afterpay_token, type: String

      index({ afterpay_token: 1}, { background: true })
    end

    def afterpay_location
      currency = total_price.currency.iso_code
      location = Afterpay.config[:currency_country_map][currency.to_sym]
      return unless location.present?

      location.to_sym.downcase
    end
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
workarea-afterpay-2.1.2 app/models/workarea/order.decorator
workarea-afterpay-2.1.1 app/models/workarea/order.decorator
workarea-afterpay-2.1.0 app/models/workarea/order.decorator
workarea-afterpay-2.0.2 app/models/workarea/order.decorator