Class: Onepay::AlipayRequest
- Inherits:
-
Object
- Object
- Onepay::AlipayRequest
- Defined in:
- lib/onepay/request/alipay.rb
Constant Summary collapse
- GATEWAY_URL =
'https://openapi.alipay.com/gateway.do?'.freeze
Instance Attribute Summary collapse
-
#order_id ⇒ Object
Returns the value of attribute order_id.
-
#title ⇒ Object
Returns the value of attribute title.
-
#total_fee ⇒ Object
Returns the value of attribute total_fee.
Instance Method Summary collapse
Instance Attribute Details
#order_id ⇒ Object
Returns the value of attribute order_id.
8 9 10 |
# File 'lib/onepay/request/alipay.rb', line 8 def order_id @order_id end |
#title ⇒ Object
Returns the value of attribute title.
8 9 10 |
# File 'lib/onepay/request/alipay.rb', line 8 def title @title end |
#total_fee ⇒ Object
Returns the value of attribute total_fee.
8 9 10 |
# File 'lib/onepay/request/alipay.rb', line 8 def total_fee @total_fee end |
Instance Method Details
#url ⇒ Object
10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 |
# File 'lib/onepay/request/alipay.rb', line 10 def url alipay_client = Alipay::Client.new( url: GATEWAY_URL, app_id: Onepay.config['alipay']['app_id'], app_private_key: Onepay.config['alipay']['private_key'], alipay_public_key: Onepay.config['alipay']['public_key'] ) alipay_client.page_execute_url( method: 'alipay.trade.wap.pay', notify_url: Onepay.config['alipay']['notify_url'], biz_content: { out_trade_no: @order_id, product_code: 'QUICK_WAP_WAY', total_amount: @total_fee, subject: @title }.to_json, timestamp: Time.now.strftime('%Y-%m-%d %H:%M:%S') ) end |