Sha256: 2f3ecdc6880642023251d1a58361876c8dbb57bcbc829b9f15c602d4c71eddbf
Contents?: true
Size: 1.56 KB
Versions: 11
Compression:
Stored size: 1.56 KB
Contents
module IdealMollie # # Object representing a "Order" object with attributes provided by Mollie # # @example # Order.new({ # :transaction_id => "c9f93e5c2bd6c1e7c5bee5c5580c6f83", # :amount => "1000", # :currency => "EUR", # :url => "https://www.abnamro.nl/nl/ideal/identification.do?randomizedstring=8433910909&trxid=30000217841224", # :message => "Your iDEAL-payment has successfully been setup. Your customer should visit the given URL to make the payment" # }) # # @note The amount is always specified in *cents*. So 10,00 EUR would be 1000. class Order # @return [String] A unique id generated by Mollie. attr_accessor :transaction_id # @return [int] The amount of money for the transaction. attr_accessor :amount # @return [String] The currency for the transaction. attr_accessor :currency # @return [String] The url to the bank, to complete payment. attr_accessor :url # @return [String] A message with additional information about the Order. attr_accessor :message # # Initializer to transform a +Hash+ into an Order object # # @param [Hash] values def initialize(values=nil) return if values.nil? @transaction_id = values["transaction_id"].to_s if values.has_key?("transaction_id") @amount = values["amount"].to_i if values.has_key?("amount") @currency = values["currency"].to_s if values.has_key?("currency") @url = values["URL"].to_s if values.has_key?("URL") @message = values["message"].to_s if values.has_key?("message") end end end
Version data entries
11 entries across 11 versions & 1 rubygems