Class: Magpie::ChinabankModel
- Inherits:
-
Object
- Object
- Magpie::ChinabankModel
- Defined in:
- lib/models/chinabank.rb
Instance Attribute Summary collapse
-
#remark1 ⇒ Object
Returns the value of attribute remark1.
-
#remark2 ⇒ Object
Returns the value of attribute remark2.
-
#v_amount ⇒ Object
Returns the value of attribute v_amount.
-
#v_md5info ⇒ Object
Returns the value of attribute v_md5info.
-
#v_mid ⇒ Object
Returns the value of attribute v_mid.
-
#v_moneytype ⇒ Object
Returns the value of attribute v_moneytype.
-
#v_oid ⇒ Object
Returns the value of attribute v_oid.
-
#v_url ⇒ Object
Returns the value of attribute v_url.
Instance Method Summary collapse
- #invalid_sign? ⇒ Boolean
- #notify ⇒ Object
-
#notify_url ⇒ Object
商家系统用来处理网银支付结果的url.
- #partner ⇒ Object
- #sign ⇒ Object
Methods included from Mouse
#account, included, #key, #missing_partner?
Methods included from Goose
#errors, included, #initialize, #valid?, #validating
Instance Attribute Details
#remark1 ⇒ Object
Returns the value of attribute remark1.
11 12 13 |
# File 'lib/models/chinabank.rb', line 11 def remark1 @remark1 end |
#remark2 ⇒ Object
Returns the value of attribute remark2.
11 12 13 |
# File 'lib/models/chinabank.rb', line 11 def remark2 @remark2 end |
#v_amount ⇒ Object
Returns the value of attribute v_amount.
11 12 13 |
# File 'lib/models/chinabank.rb', line 11 def v_amount @v_amount end |
#v_md5info ⇒ Object
Returns the value of attribute v_md5info.
11 12 13 |
# File 'lib/models/chinabank.rb', line 11 def v_md5info @v_md5info end |
#v_mid ⇒ Object
Returns the value of attribute v_mid.
11 12 13 |
# File 'lib/models/chinabank.rb', line 11 def v_mid @v_mid end |
#v_moneytype ⇒ Object
Returns the value of attribute v_moneytype.
11 12 13 |
# File 'lib/models/chinabank.rb', line 11 def v_moneytype @v_moneytype end |
#v_oid ⇒ Object
Returns the value of attribute v_oid.
11 12 13 |
# File 'lib/models/chinabank.rb', line 11 def v_oid @v_oid end |
#v_url ⇒ Object
Returns the value of attribute v_url.
11 12 13 |
# File 'lib/models/chinabank.rb', line 11 def v_url @v_url end |
Instance Method Details
#invalid_sign? ⇒ Boolean
23 24 25 26 27 28 |
# File 'lib/models/chinabank.rb', line 23 def invalid_sign? text = @attributes["v_amount"]+@attributes["v_moneytype"]+@attributes["v_oid"]+@attributes["v_mid"]+@attributes["v_url"]+self.key self.sign.upcase == Digest::MD5.hexdigest(text).upcase ? false : true rescue => e true end |
#notify ⇒ Object
43 44 45 46 47 48 49 50 51 52 53 54 |
# File 'lib/models/chinabank.rb', line 43 def notify @notify ||= { "v_oid" => v_oid, "v_pstatus" => v_pstatus, "v_amount" => v_amount, "v_pstring" => v_pstring, "v_pmode" => v_pmode, "v_moneytype" => v_moneytype, "v_md5str" => notify_sign, "remark1" => remark1, "remark2" => remark2 }.delete_if { |k, v| v.to_s.length == 0} end |
#notify_url ⇒ Object
商家系统用来处理网银支付结果的url
39 40 41 |
# File 'lib/models/chinabank.rb', line 39 def notify_url self.v_url end |
#partner ⇒ Object
34 35 36 |
# File 'lib/models/chinabank.rb', line 34 def partner self.v_mid end |
#sign ⇒ Object
30 31 32 |
# File 'lib/models/chinabank.rb', line 30 def sign self.v_md5info end |