Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public PageReference doDirectPayment()
- {
- HttpRequest httpRequest = new HttpRequest();
- httpRequest.setEndpoint('https:/VinProviderxxxx.php');
- String body = 'id=01123999999198&key=xxxxxxx&vin=1GNSKHE34BRxxxxxxx&mode=test&user=vxxxxxx&pass=slll4250&format=xml';
- httpRequest.setBody(body);
- httpRequest.setMethod('GET');
- Http htt = new hTTP();
- HttpResponse httpRe = htt.send(httpRequest);
- system.debug(httpRe.geTbody());
- String re = httpRe.geTbody();
- Dom.Document doc = httpRe.getBodyDocument();
- Dom.XMLNode address = doc.getRootElement();
- String clean= address.getChildElement('clean', null).getText();
- String vinDate= address.getChildElement('date', null).getText();
- String state = address.getChildElement('specs', null).getText();
- // print out specific elements
- System.debug('address: ' + address);
- System.debug('state: ' + state);
- system.debug('result'+re);
- for(Dom.XMLNode child : address.getChildElements()) {
- if(child.getName() == 'specs'){
- System.debug('******'+child.getText());
- }
- }
- Vehicle__c ve =[select Name,Id,Vin_Audit_Response__c,Year__c from Vehicle__c where id =: vehicleId];
- ve.Vin_Audit_Response__c=re;
- // ve.Year__c =sYear;
- }
Add Comment
Please, Sign In to add comment