| | |
| | | insert traLog; |
| | | } |
| | | // confirm tx transaction |
| | | @future(callout =true) |
| | | public static void confirmTrans(String module,Integer isSuccess, String sfRecordId ,String transId ,String token,String transUrl,String idList){ |
| | | |
| | | public static void confirmTrans(String module,Integer isSuccess, String sfRecordId ,String transId ,String token,String transUrl,List<idList> idList){ |
| | | Boolean result =false; |
| | | Transaction_Log__c traLog = new Transaction_Log__c(); |
| | | traLog.Module__c = 'Confirm Transaction '+module; |
| | |
| | | TransactionRequestBody requestBody =new TransactionRequestBody(); |
| | | requestBody.isSuccess=isSuccess; |
| | | requestBody.sfRecordId=sfRecordId; |
| | | // requestBody.idList=idList; |
| | | requestBody.idList=(List < idList >)JSON.deserialize(idList,List < idList > .class); |
| | | requestBody.idList=idList; |
| | | requestBody.txId =transId; |
| | | request.setBody(JSON.serialize(requestBody)); |
| | | traLog.Request__c =JSON.serialize(requestBody); |
| | | system.debug('request---'+request.tostring()); |
| | | HttpResponse response = http.send(request); |
| | | system.debug('confirm result--'+response.getBody()); |
| | |
| | | public static PIIntegration getPIIntegrationInfo(String sobjectType){ |
| | | PIIntegration piIntegration = new PIIntegration(); |
| | | //查询url |
| | | System.debug('thhsobjectType = ' + sobjectType); |
| | | PI_Policy_Configuration__c config = [SELECT Full_New_URL__c,Full_Search_URL__c,Full_Update_URL__c,Full_Undelete_URL__c,Full_Read_URL__c,Full_Delete_URL__c,Full_View_Unified_Contact_URL__c,TransactionURL__c FROM PI_Policy_Configuration__c WHERE Sobject_Type__c =:sobjectType]; |
| | | System.debug('config = ' + config); |
| | | System.debug('thhconfig = ' + config); |
| | | |
| | | //获取appid和appsecret |
| | | AWS_Integration_Info__mdt awsConfiguration = [SELECT App_Id__c,Max_Query_Number__c,Token_URL__c,App_Secret__c,Host_URL__c FROM AWS_Integration_Info__mdt WHERE DeveloperName = 'AWS_Default_Configuration']; |
| | |
| | | request.setEndpoint(url); |
| | | request.setMethod('GET'); |
| | | HttpResponse response = http.send(request); |
| | | system.debug('response.getBody()='+response.getBody()); |
| | | Map<String, Object> results = (Map<String, Object>) JSON.deserializeUntyped(response.getBody()); |
| | | token = (String)results.get('object'); |
| | | System.debug('token = ' + token); |