add auth_token

This commit is contained in:
Moe Su
2017-06-13 19:01:14 +06:30
parent a600c233d5
commit 3db3b8c7e7
3 changed files with 4 additions and 3 deletions

View File

@@ -28,9 +28,10 @@ class Origami::PaymentsController < BaseOrigamiController
memberaction = MembershipAction.find_by_membership_type("get_all_member_account")
merchant_uid = memberaction.merchant_account_id.to_s
auth_token = memberaction.auth_token.to_s
url = membership.gateway_url.to_s + memberaction.gateway_url.to_s
response = HTTParty.get(url, :body => { membership_id: @customer.membership_id,merchant_uid:merchant_uid}.to_json,
response = HTTParty.get(url, :body => { membership_id: @customer.membership_id,merchant_uid:merchant_uid,auth_token:auth_token}.to_json,
:headers => {
'Content-Type' => 'application/json',
'Accept' => 'application/json'

View File

@@ -256,10 +256,10 @@ class SalePayment < ApplicationRecord
membership = MembershipSetting.find_by_membership_type("paypar_url")
memberaction = MembershipAction.find_by_membership_type("rebate")
campaign_type_id = memberaction.additional_parameter["campaign_type_id"]
app_token = membership.auth_token.to_s
auth_token = memberaction.auth_token.to_s
url = membership.gateway_url.to_s + memberaction.gateway_url.to_s
response = HTTParty.post(url, :body => { generic_customer_id:generic_customer_id ,total_amount: total_amount,campaign_type_id: campaign_type_id,
receipt_no: receipt_no}.to_json,
receipt_no: receipt_no,auth_token:auth_token}.to_json,
:headers => {
'Content-Type' => 'application/json',
'Accept' => 'application/json'

BIN
dump.rdb

Binary file not shown.