Created
July 12, 2011 13:06
-
-
Save d11wtq/1077938 to your computer and use it in GitHub Desktop.
DataMapper example showing a few different legacy support features
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module Commerce | |
class Refund | |
include DataMapper::Resource | |
include Defaults | |
PENDING = 'pending' | |
SUCCESSFUL = 'successful' | |
DECLINED = 'declined' | |
ERROR = 'error' | |
property :id, Serial | |
property :amount, Decimal, :precision => 6, :scale => 2 | |
property :merchant_fee, Decimal, :precision => 6, :scale => 2, :field => 'merchantfee' | |
property :status, String, :set => [PENDING, SUCCESSFUL, DECLINED, ERROR] | |
property :gateway_key, String, :field => 'gatewaykey' | |
property :backend_id, String, :field => 'backendid' | |
property :error_code, String, :field => 'errorcode' | |
property :error_message, Text, :field => 'errormessage' | |
property :created_at, EpochTime, :field => 'timecreated' | |
property :updated_at, EpochTime, :field => 'timemodified' | |
belongs_to :payment, | |
'Commerce::Payment' | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment