update scrll and member transaction

This commit is contained in:
Aung Myo
2017-07-03 17:44:26 +06:30
parent e3477fd268
commit 8aa12406db
19 changed files with 91 additions and 77 deletions

View File

@@ -46,7 +46,7 @@ class Customer < ApplicationRecord
end
def self.get_membership_transactions(customer)
def self.get_membership_transactions(customer,receipt_no = nil)
membership = MembershipSetting.find_by_membership_type("paypar_url")
memberaction = MembershipAction.find_by_membership_type("get_member_transactions")
merchant_uid = memberaction.merchant_account_id.to_s
@@ -55,13 +55,17 @@ class Customer < ApplicationRecord
# urltest =self.url_exist?(url)
begin
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'
},
:timeout => 10
)
response = HTTParty.get(url,
:body => { membership_id: customer.membership_id,
receipt_no:receipt_no,
merchant_uid:merchant_uid,auth_token:auth_token
}.to_json,
:headers => {
'Content-Type' => 'application/json',
'Accept' => 'application/json'
},
:timeout => 10
)
rescue Net::OpenTimeout
response = { status: false , message: "Server Time out"}