Module: GMO::Payment::ShopAPIMethods
- Included in:
- ShopAPI
- Defined in:
- lib/gmo/shop_api.rb
Instance Attribute Summary collapse
-
#host ⇒ Object
readonly
Returns the value of attribute host.
-
#shop_id ⇒ Object
readonly
Returns the value of attribute shop_id.
-
#shop_pass ⇒ Object
readonly
Returns the value of attribute shop_pass.
Instance Method Summary collapse
-
#alter_tran(options = {}) ⇒ Object
2.14.2.1.決済変更 仮売上の決済に対して実売上を行います。尚、実行時に仮売上時との金額チェックを行います。 /payment/AlterTran.idPass ShopID ShopPass AccessID 取引ID AccessPass 取引パスワード JobCd 処理区分 “SALES” Amount 利用金額 AccessID AccessPass Forward Approve TranID TranDate example ### gmo.alter_tran({ access_id: “a41d83f1f4c908baeda04e6dc03e300c”, access_pass: “d72eca02e28c88f98b9341a33ba46d5d”, job_cd: “SALES”, amount: 100 }) “AccessPass”=>“cc0093ca8758c6616fa0ab9bf6a43e8d”, “Forward”=>“2a99662”, “Approve”=>“6284199”, “TranID”=>“1302140555111111111111193536”, “TranDate”=>“20130215110651”.
-
#change_tran(options = {}) ⇒ Object
2.15.2.1.金額変更 決済が完了した取引に対して金額の変更を行います。 AccessID AccessPass Forward Approve TranID TranDate example ### gmo.change_tran({ access_id: “a41d83f1f4c908baeda04e6dc03e300c”, access_pass: “d72eca02e28c88f98b9341a33ba46d5d”, JobCd: 100, Amount: 100 }).
-
#entry_tran(options = {}) ⇒ Object
2.1.2.1.取引登録 これ以降の決済取引で必要となる取引 ID と取引パスワードの発行を行い、取引を開始します。 ItemCode Tax TdFlag TdTenantName AccessID AccessPass ErrCode ErrInfo example ### gmo.entry_tran({ order_id: 100, job_cd: “AUTH”, amount: 100 }) “AccessPass”=>“d72eca02e28c88f98b9341a33ba46d5d”.
-
#entry_tran_cvs(options = {}) ⇒ Object
【コンビニ払い】 2.1.2.1.
-
#exec_tran(options = {}) ⇒ Object
2.2.2.2.決済実行 指定されたサイトに会員を登録します。 return ACS OrderID Forward Method PayTimes Approve TranID TranDate CheckString ClientField1 ClientField2 ClientField3 ACS OrderID Forward Method PayTimes Approve TranID CheckString ClientField1 ClientField2 ClientField3 example ### gmo.exec_tran({ order_id: 100, access_id: “a41d83f1f4c908baeda04e6dc03e300c”, access_pass: “d72eca02e28c88f98b9341a33ba46d5d”, method: 1, pay_times: 1, card_no: “4111111111111111”, expire: “1405”, #format YYMM client_field1: “client_field1” }) “OrderID”=>“100”, “Forward”=>“2a99662”, “Method”=>“1”, “PayTimes”=>“”, “Approve”=>“6294780”, “TranID”=>“1302160543111111111111192829”, “TranDate”=>“20130216054346”, “CheckString”=>“3e455a2168fefc90dbb7db7ef7b0fe82”, “ClientField1”=>“client_field1”, “ClientField2”=>“”, “ClientField3”=>“”.
-
#exec_tran_cvs(options = {}) ⇒ Object
【コンビニ払い】 2.1.2.2.
- #initialize(options = {}) ⇒ Object
-
#search_trade(options = {}) ⇒ Object
2.16.2.1.取引状態参照 指定したオーダーID の取引情報を取得します。.
-
#search_trade_multi(options = {}) ⇒ Object
13.1.2.1.取引状態参照 指定したオーダーIDの取引情報を取得します。.
Instance Attribute Details
#host ⇒ Object (readonly)
Returns the value of attribute host.
25 26 27 |
# File 'lib/gmo/shop_api.rb', line 25 def host @host end |
#shop_id ⇒ Object (readonly)
Returns the value of attribute shop_id.
25 26 27 |
# File 'lib/gmo/shop_api.rb', line 25 def shop_id @shop_id end |
#shop_pass ⇒ Object (readonly)
Returns the value of attribute shop_pass.
25 26 27 |
# File 'lib/gmo/shop_api.rb', line 25 def shop_pass @shop_pass end |
Instance Method Details
#alter_tran(options = {}) ⇒ Object
2.14.2.1.決済変更 仮売上の決済に対して実売上を行います。尚、実行時に仮売上時との金額チェックを行います。 /payment/AlterTran.idPass ShopID ShopPass AccessID 取引ID AccessPass 取引パスワード JobCd 処理区分 “SALES” Amount 利用金額 AccessID AccessPass Forward Approve TranID TranDate example ### gmo.alter_tran(
access_id: "a41d83f1f4c908baeda04e6dc03e300c",
access_pass: "d72eca02e28c88f98b9341a33ba46d5d",
job_cd: "SALES",
amount: 100
) “AccessPass”=>“cc0093ca8758c6616fa0ab9bf6a43e8d”, “Forward”=>“2a99662”, “Approve”=>“6284199”, “TranID”=>“1302140555111111111111193536”, “TranDate”=>“20130215110651”
167 168 169 170 171 172 |
# File 'lib/gmo/shop_api.rb', line 167 def alter_tran( = {}) name = "AlterTran.idPass" required = [:access_id, :access_pass, :job_cd] (required, ) post_request name, end |
#change_tran(options = {}) ⇒ Object
2.15.2.1.金額変更 決済が完了した取引に対して金額の変更を行います。 AccessID AccessPass Forward Approve TranID TranDate example ### gmo.change_tran(
access_id: "a41d83f1f4c908baeda04e6dc03e300c",
access_pass: "d72eca02e28c88f98b9341a33ba46d5d",
JobCd: 100,
Amount: 100
)
190 191 192 193 194 195 |
# File 'lib/gmo/shop_api.rb', line 190 def change_tran( = {}) name = "ChangeTran.idPass" required = [:access_id, :access_pass, :job_cd, :amount] (required, ) post_request name, end |
#entry_tran(options = {}) ⇒ Object
2.1.2.1.取引登録 これ以降の決済取引で必要となる取引 ID と取引パスワードの発行を行い、取引を開始します。 ItemCode Tax TdFlag TdTenantName AccessID AccessPass ErrCode ErrInfo example ### gmo.entry_tran(
order_id: 100,
job_cd: "AUTH",
amount: 100
) “AccessPass”=>“d72eca02e28c88f98b9341a33ba46d5d”
45 46 47 48 49 50 51 |
# File 'lib/gmo/shop_api.rb', line 45 def entry_tran( = {}) name = "EntryTran.idPass" required = [:order_id, :job_cd] required << :amount if [:job_cd] && [:job_cd] != "CHECK" (required, ) post_request name, end |
#entry_tran_cvs(options = {}) ⇒ Object
【コンビニ払い】
2.1.2.1. 取引登録
これ以降の決済取引で必要となる取引IDと取引パスワードの発行を行い、取引を開始します。
57 58 59 60 61 62 |
# File 'lib/gmo/shop_api.rb', line 57 def entry_tran_cvs( = {}) name = "EntryTranCvs.idPass" required = [:order_id, :amount] (required, ) post_request name, end |
#exec_tran(options = {}) ⇒ Object
2.2.2.2.決済実行 指定されたサイトに会員を登録します。 return ACS OrderID Forward Method PayTimes Approve TranID TranDate CheckString ClientField1 ClientField2 ClientField3 ACS OrderID Forward Method PayTimes Approve TranID CheckString ClientField1 ClientField2 ClientField3 example ### gmo.exec_tran(
order_id: 100,
access_id: "a41d83f1f4c908baeda04e6dc03e300c",
access_pass: "d72eca02e28c88f98b9341a33ba46d5d",
method: 1,
pay_times: 1,
card_no: "4111111111111111",
expire: "1405", #format YYMM
client_field1: "client_field1"
) “OrderID”=>“100”, “Forward”=>“2a99662”, “Method”=>“1”, “PayTimes”=>“”, “Approve”=>“6294780”, “TranID”=>“1302160543111111111111192829”, “TranDate”=>“20130216054346”, “CheckString”=>“3e455a2168fefc90dbb7db7ef7b0fe82”, “ClientField1”=>“client_field1”, “ClientField2”=>“”, “ClientField3”=>“”
103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 |
# File 'lib/gmo/shop_api.rb', line 103 def exec_tran( = {}) name = "ExecTran.idPass" if [:client_field1] || [:client_field2] || [:client_field3] [:client_field_flg] = "1" else [:client_field_flg] = "0" end [:device_category] = "0" # args = { # "AccessID" => options[:access_id], # "AccessPass" => options[:access_pass], # "OrderID" => options[:order_id], # "Method" => options[:method], # "PayTimes" => options[:pay_times], # "CardNo" => options[:card_no], # "Expire" => options[:expire], # "HttpAccept" => options[:http_accept], # "HttpUserAgent" => options[:http_ua], # "DeviceCategory" => "0", # "ClientField1" => options[:client_field1], # "ClientField2" => options[:client_field2], # "ClientField3" => options[:client_field3], # "ClientFieldFlag" => client_field_flg # } required = [:access_id, :access_pass, :order_id, :card_no, :expire] (required, ) post_request name, end |
#exec_tran_cvs(options = {}) ⇒ Object
【コンビニ払い】 2.1.2.2. 決済実行 お客様が入力した情報で後続の決済センターと通信を行い決済を実施し、結果を返します。
136 137 138 139 140 141 |
# File 'lib/gmo/shop_api.rb', line 136 def exec_tran_cvs( = {}) name = "ExecTranCvs.idPass" required = [:access_id, :access_pass, :order_id, :convenience, :customer_name, :tel_no, :receipts_disp_11, :receipts_disp_12, :receipts_disp_13] (required, ) post_request name, end |
#initialize(options = {}) ⇒ Object
17 18 19 20 21 22 23 24 |
# File 'lib/gmo/shop_api.rb', line 17 def initialize( = {}) @shop_id = [:shop_id] @shop_pass = [:shop_pass] @host = [:host] unless @shop_id && @shop_pass && @host raise ArgumentError, "Initialize must receive a hash with :shop_id, :shop_pass and either :host! (received #{.inspect})" end end |
#search_trade(options = {}) ⇒ Object
2.16.2.1.取引状態参照 指定したオーダーID の取引情報を取得します。
199 200 201 202 203 204 |
# File 'lib/gmo/shop_api.rb', line 199 def search_trade( = {}) name = "SearchTrade.idPass" required = [:order_id] (required, ) post_request name, end |
#search_trade_multi(options = {}) ⇒ Object
13.1.2.1.取引状態参照 指定したオーダーIDの取引情報を取得します。
208 209 210 211 212 213 |
# File 'lib/gmo/shop_api.rb', line 208 def search_trade_multi( = {}) name = "SearchTradeMulti.idPass" required = [:order_id, :pay_type] (required, ) post_request name, end |