Skip to content

Instantly share code, notes, and snippets.

@FishOfPrey
Created April 28, 2016 01:43
Show Gist options
  • Save FishOfPrey/2e44344af0765a1eb9839df460bd0bb2 to your computer and use it in GitHub Desktop.
Save FishOfPrey/2e44344af0765a1eb9839df460bd0bb2 to your computer and use it in GitHub Desktop.
//Generated by FuseIT WSDL2Apex (http://www.fuseit.com/Solutions/SFDC-Explorer/Help-WSDL-Parser.aspx)
// Warning: PaymentType - All the XmlSchemaElements in '<xsd:choice>' element are added as members of the class. Choice Members: creditCard bankAccount
// Warning: PaymentMaskedType - All the XmlSchemaElements in '<xsd:choice>' element are added as members of the class. Choice Members: bankAccount creditCard tokenInformation
// Warning: ProfileTransactionType - All the XmlSchemaElements in '<xsd:choice>' element are added as members of the class. Choice Members: profileTransRefund profileTransCaptureOnly profileTransAuthOnly profileTransPriorAuthCapture profileTransVoid profileTransAuthCapture
//Methods Included: CreateCustomerProfile
//Methods Excluded: IsAlive, AuthenticateTest, ARBCreateSubscription, ARBUpdateSubscription, ARBCancelSubscription, ARBGetSubscriptionStatus, ARBGetSubscriptionList, ARBGetSubscription, CreateCustomerProfileFromTransaction, CreateCustomerPaymentProfile, CreateCustomerShippingAddress, GetCustomerProfile, GetCustomerPaymentProfile, GetCustomerPaymentProfileList, GetCustomerShippingAddress, UpdateCustomerProfile, UpdateCustomerPaymentProfile, UpdateCustomerShippingAddress, DeleteCustomerProfile, DeleteCustomerPaymentProfile, DeleteCustomerShippingAddress, CreateCustomerProfileTransaction, ValidateCustomerPaymentProfile, GetCustomerProfileIds, GetHostedProfilePage, UpdateSplitTenderGroup, GetTransactionDetails, GetSettledBatchList, GetBatchStatistics, GetTransactionList, GetUnsettledTransactionList
// Primary Port Class Name: ServiceSoap
public class apiAuthorizeNetSoapV1 {
public static DateTime parseDateTime(String nodeText){
String iso8601 = nodeText;
JSONParser parser = JSON.createParser( '{"t":"' + iso8601 + '"}');
parser.nextToken();
parser.nextValue();
DateTime dt = parser.getDateTimeValue();
//System.debug('dt: ' + dt);
return dt;
}
public class ArrayOfCustomerAddressType {
public apiAuthorizeNetSoapV1.CustomerAddressType[] CustomerAddressType;
private String[] CustomerAddressType_type_info = new String[]{'CustomerAddressType','https://api.authorize.net/soap/v1/','CustomerAddressType','0','-1','true'};
private String[] apex_schema_type_info = new String[]{'https://api.authorize.net/soap/v1/','true','false'};
private String[] field_order_type_info = new String[]{'CustomerAddressType'};
public ArrayOfCustomerAddressType(){
}
public ArrayOfCustomerAddressType(DOM.XmlNode responseNode){
Set<DOM.XmlNode> nodesParsed = new Set<DOM.XmlNode>();
Dom.XmlNode[] CustomerAddressTypeChildren = responseNode.getChildElements();
apiAuthorizeNetSoapV1.CustomerAddressType[] CustomerAddressTypeList = new List<apiAuthorizeNetSoapV1.CustomerAddressType>();
if(CustomerAddressTypeChildren == null || CustomerAddressTypeChildren.size() == 0){
this.CustomerAddressType = null;
} else{
for(DOM.XmlNode childNode : CustomerAddressTypeChildren){
if(childNode.GetName() == 'CustomerAddressType'){
apiAuthorizeNetSoapV1.CustomerAddressType Obj = new apiAuthorizeNetSoapV1.CustomerAddressType(childNode);
CustomerAddressTypeList.Add(Obj);
nodesParsed.add(childNode);
}
}
this.CustomerAddressType = CustomerAddressTypeList;
}
//System.debug(this.CustomerAddressType);
}
public void populateXmlNode(Dom.XmlNode outerNode){
apiAuthorizeNetSoapV1.CustomerAddressType[] CustomerAddressTypeObj = this.CustomerAddressType;
if(CustomerAddressTypeObj != null){
for(apiAuthorizeNetSoapV1.CustomerAddressType element: CustomerAddressTypeObj){
Dom.XmlNode CustomerAddressTypeNode = outerNode.addChildElement('CustomerAddressType', 'https://api.authorize.net/soap/v1/', '');
element.populateXmlNode(CustomerAddressTypeNode);
}
}
}
}
public class ArrayOfCustomerPaymentProfileType {
public apiAuthorizeNetSoapV1.CustomerPaymentProfileType[] CustomerPaymentProfileType;
private String[] CustomerPaymentProfileType_type_info = new String[]{'CustomerPaymentProfileType','https://api.authorize.net/soap/v1/','CustomerPaymentProfileType','0','-1','true'};
private String[] apex_schema_type_info = new String[]{'https://api.authorize.net/soap/v1/','true','false'};
private String[] field_order_type_info = new String[]{'CustomerPaymentProfileType'};
public ArrayOfCustomerPaymentProfileType(){
}
public ArrayOfCustomerPaymentProfileType(DOM.XmlNode responseNode){
Set<DOM.XmlNode> nodesParsed = new Set<DOM.XmlNode>();
Dom.XmlNode[] CustomerPaymentProfileTypeChildren = responseNode.getChildElements();
apiAuthorizeNetSoapV1.CustomerPaymentProfileType[] CustomerPaymentProfileTypeList = new List<apiAuthorizeNetSoapV1.CustomerPaymentProfileType>();
if(CustomerPaymentProfileTypeChildren == null || CustomerPaymentProfileTypeChildren.size() == 0){
this.CustomerPaymentProfileType = null;
} else{
for(DOM.XmlNode childNode : CustomerPaymentProfileTypeChildren){
if(childNode.GetName() == 'CustomerPaymentProfileType'){
apiAuthorizeNetSoapV1.CustomerPaymentProfileType Obj = new apiAuthorizeNetSoapV1.CustomerPaymentProfileType(childNode);
CustomerPaymentProfileTypeList.Add(Obj);
nodesParsed.add(childNode);
}
}
this.CustomerPaymentProfileType = CustomerPaymentProfileTypeList;
}
//System.debug(this.CustomerPaymentProfileType);
}
public void populateXmlNode(Dom.XmlNode outerNode){
apiAuthorizeNetSoapV1.CustomerPaymentProfileType[] CustomerPaymentProfileTypeObj = this.CustomerPaymentProfileType;
if(CustomerPaymentProfileTypeObj != null){
for(apiAuthorizeNetSoapV1.CustomerPaymentProfileType element: CustomerPaymentProfileTypeObj){
Dom.XmlNode CustomerPaymentProfileTypeNode = outerNode.addChildElement('CustomerPaymentProfileType', 'https://api.authorize.net/soap/v1/', '');
element.populateXmlNode(CustomerPaymentProfileTypeNode);
}
}
}
}
public class ArrayOfLong {
public Long[] long_x;
private String[] long_x_type_info = new String[]{'long','https://api.authorize.net/soap/v1/','long','0','-1','false'};
private String[] apex_schema_type_info = new String[]{'https://api.authorize.net/soap/v1/','true','false'};
private String[] field_order_type_info = new String[]{'long_x'};
public ArrayOfLong(){
}
public ArrayOfLong(DOM.XmlNode responseNode){
Set<DOM.XmlNode> nodesParsed = new Set<DOM.XmlNode>();
Long[] long_xList = new List<Long>();
if(responseNode.getChildElements() == null){
this.long_x = null;
} else{
for(DOM.XmlNode childNode: responseNode.getChildElements()){
if(childNode.GetName() == 'long_x'){
long_xList.Add((childNode == null || childNode.getAttributeValue('nil', 'http://www.w3.org/2001/XMLSchema-instance') == 'true') ? null : Long.valueOf(childNode.getText()));
nodesParsed.add(childNode);
}
}
this.long_x = long_xList;
}
//System.debug(this.long_x);
}
public void populateXmlNode(Dom.XmlNode outerNode){
if(this.long_x != null){
for(Long element: this.long_x){
Dom.XmlNode long_xNode = outerNode.addChildElement('long', 'https://api.authorize.net/soap/v1/', '');
long_xNode.addTextNode(String.valueOf(element));
}
}
}
}
public class ArrayOfMessagesTypeMessage {
public apiAuthorizeNetSoapV1.MessagesTypeMessage[] MessagesTypeMessage;
private String[] MessagesTypeMessage_type_info = new String[]{'MessagesTypeMessage','https://api.authorize.net/soap/v1/','MessagesTypeMessage','0','-1','true'};
private String[] apex_schema_type_info = new String[]{'https://api.authorize.net/soap/v1/','true','false'};
private String[] field_order_type_info = new String[]{'MessagesTypeMessage'};
public ArrayOfMessagesTypeMessage(){
}
public ArrayOfMessagesTypeMessage(DOM.XmlNode responseNode){
Set<DOM.XmlNode> nodesParsed = new Set<DOM.XmlNode>();
Dom.XmlNode[] MessagesTypeMessageChildren = responseNode.getChildElements();
apiAuthorizeNetSoapV1.MessagesTypeMessage[] MessagesTypeMessageList = new List<apiAuthorizeNetSoapV1.MessagesTypeMessage>();
if(MessagesTypeMessageChildren == null || MessagesTypeMessageChildren.size() == 0){
this.MessagesTypeMessage = null;
} else{
for(DOM.XmlNode childNode : MessagesTypeMessageChildren){
if(childNode.GetName() == 'MessagesTypeMessage'){
apiAuthorizeNetSoapV1.MessagesTypeMessage Obj = new apiAuthorizeNetSoapV1.MessagesTypeMessage(childNode);
MessagesTypeMessageList.Add(Obj);
nodesParsed.add(childNode);
}
}
this.MessagesTypeMessage = MessagesTypeMessageList;
}
//System.debug(this.MessagesTypeMessage);
}
public void populateXmlNode(Dom.XmlNode outerNode){
apiAuthorizeNetSoapV1.MessagesTypeMessage[] MessagesTypeMessageObj = this.MessagesTypeMessage;
if(MessagesTypeMessageObj != null){
for(apiAuthorizeNetSoapV1.MessagesTypeMessage element: MessagesTypeMessageObj){
Dom.XmlNode MessagesTypeMessageNode = outerNode.addChildElement('MessagesTypeMessage', 'https://api.authorize.net/soap/v1/', '');
element.populateXmlNode(MessagesTypeMessageNode);
}
}
}
}
public class ArrayOfString {
public String[] string_x;
private String[] string_x_type_info = new String[]{'string','https://api.authorize.net/soap/v1/','string','0','-1','true'};
private String[] apex_schema_type_info = new String[]{'https://api.authorize.net/soap/v1/','true','false'};
private String[] field_order_type_info = new String[]{'string_x'};
public ArrayOfString(){
}
public ArrayOfString(DOM.XmlNode responseNode){
Set<DOM.XmlNode> nodesParsed = new Set<DOM.XmlNode>();
String[] string_xList = new List<String>();
if(responseNode.getChildElements() == null){
this.string_x = null;
} else{
for(DOM.XmlNode childNode: responseNode.getChildElements()){
if(childNode.GetName() == 'string_x'){
string_xList.Add((childNode == null || childNode.getAttributeValue('nil', 'http://www.w3.org/2001/XMLSchema-instance') == 'true') ? null : String.valueOf(childNode.getText()));
nodesParsed.add(childNode);
}
}
this.string_x = string_xList;
}
//System.debug(this.string_x);
}
public void populateXmlNode(Dom.XmlNode outerNode){
if(this.string_x != null){
for(String element: this.string_x){
Dom.XmlNode string_xNode = outerNode.addChildElement('string', 'https://api.authorize.net/soap/v1/', '');
string_xNode.addTextNode(String.valueOf(element));
}
}
}
}
public class BankAccountType {
public String accountType;
public String nameOnAccount;
public String echeckType;
public String bankName;
private String[] accountType_type_info = new String[]{'accountType','https://api.authorize.net/soap/v1/','BankAccountTypeEnum','0','1','false'};
private String[] nameOnAccount_type_info = new String[]{'nameOnAccount','https://api.authorize.net/soap/v1/','string','0','1','false'};
private String[] echeckType_type_info = new String[]{'echeckType','https://api.authorize.net/soap/v1/','EcheckTypeEnum','0','1','false'};
private String[] bankName_type_info = new String[]{'bankName','https://api.authorize.net/soap/v1/','string','0','1','false'};
public String routingNumber;
public String accountNumber;
private String[] routingNumber_type_info = new String[]{'routingNumber','https://api.authorize.net/soap/v1/','string','0','1','false'};
private String[] accountNumber_type_info = new String[]{'accountNumber','https://api.authorize.net/soap/v1/','string','0','1','false'};
private String[] apex_schema_type_info = new String[]{'https://api.authorize.net/soap/v1/','true','false'};
private String[] field_order_type_info = new String[]{'accountType','nameOnAccount','echeckType','bankName','routingNumber','accountNumber'};
public BankAccountType(){
}
public BankAccountType(DOM.XmlNode responseNode){
Set<DOM.XmlNode> nodesParsed = new Set<DOM.XmlNode>();
DOM.XmlNode accountTypeNode = responseNode.getChildElement('accountType', 'https://api.authorize.net/soap/v1/');
this.accountType = (accountTypeNode == null) ? null : accountTypeNode.getText();
nodesParsed.add(accountTypeNode);
//System.debug(this.accountType);
DOM.XmlNode nameOnAccountNode = responseNode.getChildElement('nameOnAccount', 'https://api.authorize.net/soap/v1/');
this.nameOnAccount = (nameOnAccountNode == null) ? null : nameOnAccountNode.getText();
nodesParsed.add(nameOnAccountNode);
//System.debug(this.nameOnAccount);
DOM.XmlNode echeckTypeNode = responseNode.getChildElement('echeckType', 'https://api.authorize.net/soap/v1/');
this.echeckType = (echeckTypeNode == null) ? null : echeckTypeNode.getText();
nodesParsed.add(echeckTypeNode);
//System.debug(this.echeckType);
DOM.XmlNode bankNameNode = responseNode.getChildElement('bankName', 'https://api.authorize.net/soap/v1/');
this.bankName = (bankNameNode == null) ? null : bankNameNode.getText();
nodesParsed.add(bankNameNode);
//System.debug(this.bankName);
DOM.XmlNode routingNumberNode = responseNode.getChildElement('routingNumber', 'https://api.authorize.net/soap/v1/');
this.routingNumber = (routingNumberNode == null) ? null : routingNumberNode.getText();
nodesParsed.add(routingNumberNode);
//System.debug(this.routingNumber);
DOM.XmlNode accountNumberNode = responseNode.getChildElement('accountNumber', 'https://api.authorize.net/soap/v1/');
this.accountNumber = (accountNumberNode == null) ? null : accountNumberNode.getText();
nodesParsed.add(accountNumberNode);
//System.debug(this.accountNumber);
}
public void populateXmlNode(Dom.XmlNode outerNode){
Dom.XmlNode accountTypeNode = outerNode.addChildElement('accountType', 'https://api.authorize.net/soap/v1/', '');
accountTypeNode.addTextNode((this.accountType == null) ? '' : this.accountType);
Dom.XmlNode nameOnAccountNode = outerNode.addChildElement('nameOnAccount', 'https://api.authorize.net/soap/v1/', '');
nameOnAccountNode.addTextNode((this.nameOnAccount == null) ? '' : this.nameOnAccount);
Dom.XmlNode echeckTypeNode = outerNode.addChildElement('echeckType', 'https://api.authorize.net/soap/v1/', '');
echeckTypeNode.addTextNode((this.echeckType == null) ? '' : this.echeckType);
Dom.XmlNode bankNameNode = outerNode.addChildElement('bankName', 'https://api.authorize.net/soap/v1/', '');
bankNameNode.addTextNode((this.bankName == null) ? '' : this.bankName);
Dom.XmlNode routingNumberNode = outerNode.addChildElement('routingNumber', 'https://api.authorize.net/soap/v1/', '');
routingNumberNode.addTextNode((this.routingNumber == null) ? '' : this.routingNumber);
Dom.XmlNode accountNumberNode = outerNode.addChildElement('accountNumber', 'https://api.authorize.net/soap/v1/', '');
accountNumberNode.addTextNode((this.accountNumber == null) ? '' : this.accountNumber);
}
}
public class CreateCustomerProfile_element {
public apiAuthorizeNetSoapV1.MerchantAuthenticationType merchantAuthentication;
public apiAuthorizeNetSoapV1.CustomerProfileType profile;
public String validationMode;
private String[] merchantAuthentication_type_info = new String[]{'merchantAuthentication','https://api.authorize.net/soap/v1/','MerchantAuthenticationType','0','1','false'};
private String[] profile_type_info = new String[]{'profile','https://api.authorize.net/soap/v1/','CustomerProfileType','0','1','false'};
private String[] validationMode_type_info = new String[]{'validationMode','https://api.authorize.net/soap/v1/','ValidationModeEnum','1','1','false'};
private String[] apex_schema_type_info = new String[]{'https://api.authorize.net/soap/v1/','true','false'};
private String[] field_order_type_info = new String[]{'merchantAuthentication','profile','validationMode'};
public CreateCustomerProfile_element(){
}
public CreateCustomerProfile_element(apiAuthorizeNetSoapV1.MerchantAuthenticationType merchantAuthentication,apiAuthorizeNetSoapV1.CustomerProfileType profile,String validationMode){
this.merchantAuthentication = merchantAuthentication;
this.profile = profile;
this.validationMode = validationMode;
}
public void populateXmlNode(Dom.XmlNode outerNode){
//System.assertEquals('CreateCustomerProfile', outerNode.getName());
apiAuthorizeNetSoapV1.MerchantAuthenticationType merchantAuthenticationObj = this.merchantAuthentication;
Dom.XmlNode merchantAuthenticationNode = outerNode.addChildElement('merchantAuthentication', 'https://api.authorize.net/soap/v1/', '');
if(merchantAuthenticationObj != null){
merchantAuthenticationObj.populateXmlNode(merchantAuthenticationNode);
}
apiAuthorizeNetSoapV1.CustomerProfileType profileObj = this.profile;
Dom.XmlNode profileNode = outerNode.addChildElement('profile', 'https://api.authorize.net/soap/v1/', '');
if(profileObj != null){
profileObj.populateXmlNode(profileNode);
}
Dom.XmlNode validationModeNode = outerNode.addChildElement('validationMode', 'https://api.authorize.net/soap/v1/', '');
if(this.validationMode != null){
validationModeNode.addTextNode(this.validationMode);
}
}
}
public class CreateCustomerProfileResponse_element {
public apiAuthorizeNetSoapV1.CreateCustomerProfileResponseType CreateCustomerProfileResult;
private String[] CreateCustomerProfileResult_type_info = new String[]{'CreateCustomerProfileResult','https://api.authorize.net/soap/v1/','CreateCustomerProfileResponseType','0','1','false'};
private String[] apex_schema_type_info = new String[]{'https://api.authorize.net/soap/v1/','true','false'};
private String[] field_order_type_info = new String[]{'CreateCustomerProfileResult'};
public CreateCustomerProfileResponse_element(){
}
public CreateCustomerProfileResponse_element(DOM.XmlNode responseNode){
Set<DOM.XmlNode> nodesParsed = new Set<DOM.XmlNode>();
//System.assertEquals('CreateCustomerProfileResponse', responseNode.getName());
DOM.XmlNode CreateCustomerProfileResultNode = responseNode.getChildElement('CreateCustomerProfileResult', 'https://api.authorize.net/soap/v1/');
if(CreateCustomerProfileResultNode == null){
this.CreateCustomerProfileResult = null;
} else{
apiAuthorizeNetSoapV1.CreateCustomerProfileResponseType CreateCustomerProfileResultObj = new apiAuthorizeNetSoapV1.CreateCustomerProfileResponseType(CreateCustomerProfileResultNode);
nodesParsed.add(CreateCustomerProfileResultNode);
this.CreateCustomerProfileResult = CreateCustomerProfileResultObj;
}
//System.debug(this.CreateCustomerProfileResult);
}
}
public class CreateCustomerProfileResponseType {
public String resultCode;
public apiAuthorizeNetSoapV1.ArrayOfMessagesTypeMessage messages;
private String[] resultCode_type_info = new String[]{'resultCode','https://api.authorize.net/soap/v1/','MessageTypeEnum','1','1','false'};
private String[] messages_type_info = new String[]{'messages','https://api.authorize.net/soap/v1/','ArrayOfMessagesTypeMessage','0','1','false'};
public Long customerProfileId;
public apiAuthorizeNetSoapV1.ArrayOfLong customerPaymentProfileIdList;
public apiAuthorizeNetSoapV1.ArrayOfLong customerShippingAddressIdList;
public apiAuthorizeNetSoapV1.ArrayOfString validationDirectResponseList;
private String[] customerProfileId_type_info = new String[]{'customerProfileId','https://api.authorize.net/soap/v1/','long','1','1','false'};
private String[] customerPaymentProfileIdList_type_info = new String[]{'customerPaymentProfileIdList','https://api.authorize.net/soap/v1/','ArrayOfLong','0','1','false'};
private String[] customerShippingAddressIdList_type_info = new String[]{'customerShippingAddressIdList','https://api.authorize.net/soap/v1/','ArrayOfLong','0','1','false'};
private String[] validationDirectResponseList_type_info = new String[]{'validationDirectResponseList','https://api.authorize.net/soap/v1/','ArrayOfString','0','1','false'};
private String[] apex_schema_type_info = new String[]{'https://api.authorize.net/soap/v1/','true','false'};
private String[] field_order_type_info = new String[]{'resultCode','messages','customerProfileId','customerPaymentProfileIdList','customerShippingAddressIdList','validationDirectResponseList'};
public CreateCustomerProfileResponseType(){
}
public CreateCustomerProfileResponseType(DOM.XmlNode responseNode){
Set<DOM.XmlNode> nodesParsed = new Set<DOM.XmlNode>();
DOM.XmlNode resultCodeNode = responseNode.getChildElement('resultCode', 'https://api.authorize.net/soap/v1/');
this.resultCode = (resultCodeNode == null) ? null : resultCodeNode.getText();
nodesParsed.add(resultCodeNode);
//System.debug(this.resultCode);
DOM.XmlNode messagesNode = responseNode.getChildElement('messages', 'https://api.authorize.net/soap/v1/');
if(messagesNode == null){
this.messages = null;
} else{
apiAuthorizeNetSoapV1.ArrayOfMessagesTypeMessage messagesObj = new apiAuthorizeNetSoapV1.ArrayOfMessagesTypeMessage(messagesNode);
nodesParsed.add(messagesNode);
this.messages = messagesObj;
}
//System.debug(this.messages);
DOM.XmlNode customerProfileIdNode = responseNode.getChildElement('customerProfileId', 'https://api.authorize.net/soap/v1/');
this.customerProfileId = (customerProfileIdNode == null) ? null : Long.valueOf(customerProfileIdNode.getText());
nodesParsed.add(customerProfileIdNode);
//System.debug(this.customerProfileId);
DOM.XmlNode customerPaymentProfileIdListNode = responseNode.getChildElement('customerPaymentProfileIdList', 'https://api.authorize.net/soap/v1/');
if(customerPaymentProfileIdListNode == null){
this.customerPaymentProfileIdList = null;
} else{
apiAuthorizeNetSoapV1.ArrayOfLong customerPaymentProfileIdListObj = new apiAuthorizeNetSoapV1.ArrayOfLong(customerPaymentProfileIdListNode);
nodesParsed.add(customerPaymentProfileIdListNode);
this.customerPaymentProfileIdList = customerPaymentProfileIdListObj;
}
//System.debug(this.customerPaymentProfileIdList);
DOM.XmlNode customerShippingAddressIdListNode = responseNode.getChildElement('customerShippingAddressIdList', 'https://api.authorize.net/soap/v1/');
if(customerShippingAddressIdListNode == null){
this.customerShippingAddressIdList = null;
} else{
apiAuthorizeNetSoapV1.ArrayOfLong customerShippingAddressIdListObj = new apiAuthorizeNetSoapV1.ArrayOfLong(customerShippingAddressIdListNode);
nodesParsed.add(customerShippingAddressIdListNode);
this.customerShippingAddressIdList = customerShippingAddressIdListObj;
}
//System.debug(this.customerShippingAddressIdList);
DOM.XmlNode validationDirectResponseListNode = responseNode.getChildElement('validationDirectResponseList', 'https://api.authorize.net/soap/v1/');
if(validationDirectResponseListNode == null){
this.validationDirectResponseList = null;
} else{
apiAuthorizeNetSoapV1.ArrayOfString validationDirectResponseListObj = new apiAuthorizeNetSoapV1.ArrayOfString(validationDirectResponseListNode);
nodesParsed.add(validationDirectResponseListNode);
this.validationDirectResponseList = validationDirectResponseListObj;
}
//System.debug(this.validationDirectResponseList);
}
public void populateXmlNode(Dom.XmlNode outerNode){
Dom.XmlNode resultCodeNode = outerNode.addChildElement('resultCode', 'https://api.authorize.net/soap/v1/', '');
if(this.resultCode != null){
resultCodeNode.addTextNode(this.resultCode);
}
apiAuthorizeNetSoapV1.ArrayOfMessagesTypeMessage messagesObj = this.messages;
Dom.XmlNode messagesNode = outerNode.addChildElement('messages', 'https://api.authorize.net/soap/v1/', '');
if(messagesObj != null){
messagesObj.populateXmlNode(messagesNode);
}
Dom.XmlNode customerProfileIdNode = outerNode.addChildElement('customerProfileId', 'https://api.authorize.net/soap/v1/', '');
if(this.customerProfileId != null){
customerProfileIdNode.addTextNode(String.valueOf(this.customerProfileId));
}
apiAuthorizeNetSoapV1.ArrayOfLong customerPaymentProfileIdListObj = this.customerPaymentProfileIdList;
Dom.XmlNode customerPaymentProfileIdListNode = outerNode.addChildElement('customerPaymentProfileIdList', 'https://api.authorize.net/soap/v1/', '');
if(customerPaymentProfileIdListObj != null){
customerPaymentProfileIdListObj.populateXmlNode(customerPaymentProfileIdListNode);
}
apiAuthorizeNetSoapV1.ArrayOfLong customerShippingAddressIdListObj = this.customerShippingAddressIdList;
Dom.XmlNode customerShippingAddressIdListNode = outerNode.addChildElement('customerShippingAddressIdList', 'https://api.authorize.net/soap/v1/', '');
if(customerShippingAddressIdListObj != null){
customerShippingAddressIdListObj.populateXmlNode(customerShippingAddressIdListNode);
}
apiAuthorizeNetSoapV1.ArrayOfString validationDirectResponseListObj = this.validationDirectResponseList;
Dom.XmlNode validationDirectResponseListNode = outerNode.addChildElement('validationDirectResponseList', 'https://api.authorize.net/soap/v1/', '');
if(validationDirectResponseListObj != null){
validationDirectResponseListObj.populateXmlNode(validationDirectResponseListNode);
}
}
}
public class CreditCardType {
public String cardNumber;
public String expirationDate;
private String[] cardNumber_type_info = new String[]{'cardNumber','https://api.authorize.net/soap/v1/','string','0','1','false'};
private String[] expirationDate_type_info = new String[]{'expirationDate','https://api.authorize.net/soap/v1/','gYearMonth','0','1','false'};
public String cardCode;
private String[] cardCode_type_info = new String[]{'cardCode','https://api.authorize.net/soap/v1/','string','0','1','false'};
private String[] apex_schema_type_info = new String[]{'https://api.authorize.net/soap/v1/','true','false'};
private String[] field_order_type_info = new String[]{'cardNumber','expirationDate','cardCode'};
public CreditCardType(){
}
public CreditCardType(DOM.XmlNode responseNode){
Set<DOM.XmlNode> nodesParsed = new Set<DOM.XmlNode>();
DOM.XmlNode cardNumberNode = responseNode.getChildElement('cardNumber', 'https://api.authorize.net/soap/v1/');
this.cardNumber = (cardNumberNode == null) ? null : cardNumberNode.getText();
nodesParsed.add(cardNumberNode);
//System.debug(this.cardNumber);
DOM.XmlNode expirationDateNode = responseNode.getChildElement('expirationDate', 'https://api.authorize.net/soap/v1/');
this.expirationDate = (expirationDateNode == null) ? null : expirationDateNode.getText();
nodesParsed.add(expirationDateNode);
//System.debug(this.expirationDate);
DOM.XmlNode cardCodeNode = responseNode.getChildElement('cardCode', 'https://api.authorize.net/soap/v1/');
this.cardCode = (cardCodeNode == null) ? null : cardCodeNode.getText();
nodesParsed.add(cardCodeNode);
//System.debug(this.cardCode);
}
public void populateXmlNode(Dom.XmlNode outerNode){
Dom.XmlNode cardNumberNode = outerNode.addChildElement('cardNumber', 'https://api.authorize.net/soap/v1/', '');
cardNumberNode.addTextNode((this.cardNumber == null) ? '' : this.cardNumber);
Dom.XmlNode expirationDateNode = outerNode.addChildElement('expirationDate', 'https://api.authorize.net/soap/v1/', '');
expirationDateNode.addTextNode((this.expirationDate == null) ? '' : this.expirationDate);
Dom.XmlNode cardCodeNode = outerNode.addChildElement('cardCode', 'https://api.authorize.net/soap/v1/', '');
cardCodeNode.addTextNode((this.cardCode == null) ? '' : this.cardCode);
}
}
public class CustomerAddressType {
public String firstName;
public String lastName;
public String company;
public String address;
public String city;
public String state;
public String zip;
public String country;
private String[] firstName_type_info = new String[]{'firstName','https://api.authorize.net/soap/v1/','string','0','1','false'};
private String[] lastName_type_info = new String[]{'lastName','https://api.authorize.net/soap/v1/','string','0','1','false'};
private String[] company_type_info = new String[]{'company','https://api.authorize.net/soap/v1/','string','0','1','false'};
private String[] address_type_info = new String[]{'address','https://api.authorize.net/soap/v1/','string','0','1','false'};
private String[] city_type_info = new String[]{'city','https://api.authorize.net/soap/v1/','string','0','1','false'};
private String[] state_type_info = new String[]{'state','https://api.authorize.net/soap/v1/','string','0','1','false'};
private String[] zip_type_info = new String[]{'zip','https://api.authorize.net/soap/v1/','string','0','1','false'};
private String[] country_type_info = new String[]{'country','https://api.authorize.net/soap/v1/','string','0','1','false'};
public String phoneNumber;
public String faxNumber;
public String email;
private String[] phoneNumber_type_info = new String[]{'phoneNumber','https://api.authorize.net/soap/v1/','string','0','1','false'};
private String[] faxNumber_type_info = new String[]{'faxNumber','https://api.authorize.net/soap/v1/','string','0','1','false'};
private String[] email_type_info = new String[]{'email','https://api.authorize.net/soap/v1/','string','0','1','false'};
private String[] apex_schema_type_info = new String[]{'https://api.authorize.net/soap/v1/','true','false'};
private String[] field_order_type_info = new String[]{'firstName','lastName','company','address','city','state','zip','country','phoneNumber','faxNumber','email'};
public CustomerAddressType(){
}
public CustomerAddressType(DOM.XmlNode responseNode){
Set<DOM.XmlNode> nodesParsed = new Set<DOM.XmlNode>();
DOM.XmlNode firstNameNode = responseNode.getChildElement('firstName', 'https://api.authorize.net/soap/v1/');
this.firstName = (firstNameNode == null) ? null : firstNameNode.getText();
nodesParsed.add(firstNameNode);
//System.debug(this.firstName);
DOM.XmlNode lastNameNode = responseNode.getChildElement('lastName', 'https://api.authorize.net/soap/v1/');
this.lastName = (lastNameNode == null) ? null : lastNameNode.getText();
nodesParsed.add(lastNameNode);
//System.debug(this.lastName);
DOM.XmlNode companyNode = responseNode.getChildElement('company', 'https://api.authorize.net/soap/v1/');
this.company = (companyNode == null) ? null : companyNode.getText();
nodesParsed.add(companyNode);
//System.debug(this.company);
DOM.XmlNode addressNode = responseNode.getChildElement('address', 'https://api.authorize.net/soap/v1/');
this.address = (addressNode == null) ? null : addressNode.getText();
nodesParsed.add(addressNode);
//System.debug(this.address);
DOM.XmlNode cityNode = responseNode.getChildElement('city', 'https://api.authorize.net/soap/v1/');
this.city = (cityNode == null) ? null : cityNode.getText();
nodesParsed.add(cityNode);
//System.debug(this.city);
DOM.XmlNode stateNode = responseNode.getChildElement('state', 'https://api.authorize.net/soap/v1/');
this.state = (stateNode == null) ? null : stateNode.getText();
nodesParsed.add(stateNode);
//System.debug(this.state);
DOM.XmlNode zipNode = responseNode.getChildElement('zip', 'https://api.authorize.net/soap/v1/');
this.zip = (zipNode == null) ? null : zipNode.getText();
nodesParsed.add(zipNode);
//System.debug(this.zip);
DOM.XmlNode countryNode = responseNode.getChildElement('country', 'https://api.authorize.net/soap/v1/');
this.country = (countryNode == null) ? null : countryNode.getText();
nodesParsed.add(countryNode);
//System.debug(this.country);
DOM.XmlNode phoneNumberNode = responseNode.getChildElement('phoneNumber', 'https://api.authorize.net/soap/v1/');
this.phoneNumber = (phoneNumberNode == null) ? null : phoneNumberNode.getText();
nodesParsed.add(phoneNumberNode);
//System.debug(this.phoneNumber);
DOM.XmlNode faxNumberNode = responseNode.getChildElement('faxNumber', 'https://api.authorize.net/soap/v1/');
this.faxNumber = (faxNumberNode == null) ? null : faxNumberNode.getText();
nodesParsed.add(faxNumberNode);
//System.debug(this.faxNumber);
DOM.XmlNode emailNode = responseNode.getChildElement('email', 'https://api.authorize.net/soap/v1/');
this.email = (emailNode == null) ? null : emailNode.getText();
nodesParsed.add(emailNode);
//System.debug(this.email);
}
public void populateXmlNode(Dom.XmlNode outerNode){
Dom.XmlNode firstNameNode = outerNode.addChildElement('firstName', 'https://api.authorize.net/soap/v1/', '');
firstNameNode.addTextNode((this.firstName == null) ? '' : this.firstName);
Dom.XmlNode lastNameNode = outerNode.addChildElement('lastName', 'https://api.authorize.net/soap/v1/', '');
lastNameNode.addTextNode((this.lastName == null) ? '' : this.lastName);
Dom.XmlNode companyNode = outerNode.addChildElement('company', 'https://api.authorize.net/soap/v1/', '');
companyNode.addTextNode((this.company == null) ? '' : this.company);
Dom.XmlNode addressNode = outerNode.addChildElement('address', 'https://api.authorize.net/soap/v1/', '');
addressNode.addTextNode((this.address == null) ? '' : this.address);
Dom.XmlNode cityNode = outerNode.addChildElement('city', 'https://api.authorize.net/soap/v1/', '');
cityNode.addTextNode((this.city == null) ? '' : this.city);
Dom.XmlNode stateNode = outerNode.addChildElement('state', 'https://api.authorize.net/soap/v1/', '');
stateNode.addTextNode((this.state == null) ? '' : this.state);
Dom.XmlNode zipNode = outerNode.addChildElement('zip', 'https://api.authorize.net/soap/v1/', '');
zipNode.addTextNode((this.zip == null) ? '' : this.zip);
Dom.XmlNode countryNode = outerNode.addChildElement('country', 'https://api.authorize.net/soap/v1/', '');
countryNode.addTextNode((this.country == null) ? '' : this.country);
Dom.XmlNode phoneNumberNode = outerNode.addChildElement('phoneNumber', 'https://api.authorize.net/soap/v1/', '');
phoneNumberNode.addTextNode((this.phoneNumber == null) ? '' : this.phoneNumber);
Dom.XmlNode faxNumberNode = outerNode.addChildElement('faxNumber', 'https://api.authorize.net/soap/v1/', '');
faxNumberNode.addTextNode((this.faxNumber == null) ? '' : this.faxNumber);
Dom.XmlNode emailNode = outerNode.addChildElement('email', 'https://api.authorize.net/soap/v1/', '');
emailNode.addTextNode((this.email == null) ? '' : this.email);
}
}
public class CustomerPaymentProfileType {
public String customerType;
public apiAuthorizeNetSoapV1.CustomerAddressType billTo;
private String[] customerType_type_info = new String[]{'customerType','https://api.authorize.net/soap/v1/','CustomerTypeEnum','0','1','false'};
private String[] billTo_type_info = new String[]{'billTo','https://api.authorize.net/soap/v1/','CustomerAddressType','0','1','false'};
public apiAuthorizeNetSoapV1.PaymentType payment;
public apiAuthorizeNetSoapV1.DriversLicenseType driversLicense;
public String taxId;
private String[] payment_type_info = new String[]{'payment','https://api.authorize.net/soap/v1/','PaymentType','0','1','false'};
private String[] driversLicense_type_info = new String[]{'driversLicense','https://api.authorize.net/soap/v1/','DriversLicenseType','0','1','false'};
private String[] taxId_type_info = new String[]{'taxId','https://api.authorize.net/soap/v1/','string','0','1','false'};
private String[] apex_schema_type_info = new String[]{'https://api.authorize.net/soap/v1/','true','false'};
private String[] field_order_type_info = new String[]{'customerType','billTo','payment','driversLicense','taxId'};
public CustomerPaymentProfileType(){
}
public CustomerPaymentProfileType(DOM.XmlNode responseNode){
Set<DOM.XmlNode> nodesParsed = new Set<DOM.XmlNode>();
DOM.XmlNode customerTypeNode = responseNode.getChildElement('customerType', 'https://api.authorize.net/soap/v1/');
this.customerType = (customerTypeNode == null) ? null : customerTypeNode.getText();
nodesParsed.add(customerTypeNode);
//System.debug(this.customerType);
DOM.XmlNode billToNode = responseNode.getChildElement('billTo', 'https://api.authorize.net/soap/v1/');
if(billToNode == null){
this.billTo = null;
} else{
apiAuthorizeNetSoapV1.CustomerAddressType billToObj = new apiAuthorizeNetSoapV1.CustomerAddressType(billToNode);
nodesParsed.add(billToNode);
this.billTo = billToObj;
}
//System.debug(this.billTo);
DOM.XmlNode paymentNode = responseNode.getChildElement('payment', 'https://api.authorize.net/soap/v1/');
if(paymentNode == null){
this.payment = null;
} else{
apiAuthorizeNetSoapV1.PaymentType paymentObj = new apiAuthorizeNetSoapV1.PaymentType(paymentNode);
nodesParsed.add(paymentNode);
this.payment = paymentObj;
}
//System.debug(this.payment);
DOM.XmlNode driversLicenseNode = responseNode.getChildElement('driversLicense', 'https://api.authorize.net/soap/v1/');
if(driversLicenseNode == null){
this.driversLicense = null;
} else{
apiAuthorizeNetSoapV1.DriversLicenseType driversLicenseObj = new apiAuthorizeNetSoapV1.DriversLicenseType(driversLicenseNode);
nodesParsed.add(driversLicenseNode);
this.driversLicense = driversLicenseObj;
}
//System.debug(this.driversLicense);
DOM.XmlNode taxIdNode = responseNode.getChildElement('taxId', 'https://api.authorize.net/soap/v1/');
this.taxId = (taxIdNode == null) ? null : taxIdNode.getText();
nodesParsed.add(taxIdNode);
//System.debug(this.taxId);
}
public void populateXmlNode(Dom.XmlNode outerNode){
Dom.XmlNode customerTypeNode = outerNode.addChildElement('customerType', 'https://api.authorize.net/soap/v1/', '');
customerTypeNode.addTextNode((this.customerType == null) ? '' : this.customerType);
apiAuthorizeNetSoapV1.CustomerAddressType billToObj = this.billTo;
Dom.XmlNode billToNode = outerNode.addChildElement('billTo', 'https://api.authorize.net/soap/v1/', '');
if(billToObj != null){
billToObj.populateXmlNode(billToNode);
}
apiAuthorizeNetSoapV1.PaymentType paymentObj = this.payment;
Dom.XmlNode paymentNode = outerNode.addChildElement('payment', 'https://api.authorize.net/soap/v1/', '');
if(paymentObj != null){
paymentObj.populateXmlNode(paymentNode);
}
apiAuthorizeNetSoapV1.DriversLicenseType driversLicenseObj = this.driversLicense;
Dom.XmlNode driversLicenseNode = outerNode.addChildElement('driversLicense', 'https://api.authorize.net/soap/v1/', '');
if(driversLicenseObj != null){
driversLicenseObj.populateXmlNode(driversLicenseNode);
}
Dom.XmlNode taxIdNode = outerNode.addChildElement('taxId', 'https://api.authorize.net/soap/v1/', '');
taxIdNode.addTextNode((this.taxId == null) ? '' : this.taxId);
}
}
public class CustomerProfileType {
public String merchantCustomerId;
public String description;
public String email;
private String[] merchantCustomerId_type_info = new String[]{'merchantCustomerId','https://api.authorize.net/soap/v1/','string','0','1','false'};
private String[] description_type_info = new String[]{'description','https://api.authorize.net/soap/v1/','string','0','1','false'};
private String[] email_type_info = new String[]{'email','https://api.authorize.net/soap/v1/','string','0','1','false'};
public apiAuthorizeNetSoapV1.ArrayOfCustomerPaymentProfileType paymentProfiles;
public apiAuthorizeNetSoapV1.ArrayOfCustomerAddressType shipToList;
private String[] paymentProfiles_type_info = new String[]{'paymentProfiles','https://api.authorize.net/soap/v1/','ArrayOfCustomerPaymentProfileType','0','1','false'};
private String[] shipToList_type_info = new String[]{'shipToList','https://api.authorize.net/soap/v1/','ArrayOfCustomerAddressType','0','1','false'};
private String[] apex_schema_type_info = new String[]{'https://api.authorize.net/soap/v1/','true','false'};
private String[] field_order_type_info = new String[]{'merchantCustomerId','description','email','paymentProfiles','shipToList'};
public CustomerProfileType(){
}
public CustomerProfileType(DOM.XmlNode responseNode){
Set<DOM.XmlNode> nodesParsed = new Set<DOM.XmlNode>();
DOM.XmlNode merchantCustomerIdNode = responseNode.getChildElement('merchantCustomerId', 'https://api.authorize.net/soap/v1/');
this.merchantCustomerId = (merchantCustomerIdNode == null) ? null : merchantCustomerIdNode.getText();
nodesParsed.add(merchantCustomerIdNode);
//System.debug(this.merchantCustomerId);
DOM.XmlNode descriptionNode = responseNode.getChildElement('description', 'https://api.authorize.net/soap/v1/');
this.description = (descriptionNode == null) ? null : descriptionNode.getText();
nodesParsed.add(descriptionNode);
//System.debug(this.description);
DOM.XmlNode emailNode = responseNode.getChildElement('email', 'https://api.authorize.net/soap/v1/');
this.email = (emailNode == null) ? null : emailNode.getText();
nodesParsed.add(emailNode);
//System.debug(this.email);
DOM.XmlNode paymentProfilesNode = responseNode.getChildElement('paymentProfiles', 'https://api.authorize.net/soap/v1/');
if(paymentProfilesNode == null){
this.paymentProfiles = null;
} else{
apiAuthorizeNetSoapV1.ArrayOfCustomerPaymentProfileType paymentProfilesObj = new apiAuthorizeNetSoapV1.ArrayOfCustomerPaymentProfileType(paymentProfilesNode);
nodesParsed.add(paymentProfilesNode);
this.paymentProfiles = paymentProfilesObj;
}
//System.debug(this.paymentProfiles);
DOM.XmlNode shipToListNode = responseNode.getChildElement('shipToList', 'https://api.authorize.net/soap/v1/');
if(shipToListNode == null){
this.shipToList = null;
} else{
apiAuthorizeNetSoapV1.ArrayOfCustomerAddressType shipToListObj = new apiAuthorizeNetSoapV1.ArrayOfCustomerAddressType(shipToListNode);
nodesParsed.add(shipToListNode);
this.shipToList = shipToListObj;
}
//System.debug(this.shipToList);
}
public void populateXmlNode(Dom.XmlNode outerNode){
Dom.XmlNode merchantCustomerIdNode = outerNode.addChildElement('merchantCustomerId', 'https://api.authorize.net/soap/v1/', '');
merchantCustomerIdNode.addTextNode((this.merchantCustomerId == null) ? '' : this.merchantCustomerId);
Dom.XmlNode descriptionNode = outerNode.addChildElement('description', 'https://api.authorize.net/soap/v1/', '');
descriptionNode.addTextNode((this.description == null) ? '' : this.description);
Dom.XmlNode emailNode = outerNode.addChildElement('email', 'https://api.authorize.net/soap/v1/', '');
emailNode.addTextNode((this.email == null) ? '' : this.email);
apiAuthorizeNetSoapV1.ArrayOfCustomerPaymentProfileType paymentProfilesObj = this.paymentProfiles;
Dom.XmlNode paymentProfilesNode = outerNode.addChildElement('paymentProfiles', 'https://api.authorize.net/soap/v1/', '');
if(paymentProfilesObj != null){
paymentProfilesObj.populateXmlNode(paymentProfilesNode);
}
apiAuthorizeNetSoapV1.ArrayOfCustomerAddressType shipToListObj = this.shipToList;
Dom.XmlNode shipToListNode = outerNode.addChildElement('shipToList', 'https://api.authorize.net/soap/v1/', '');
if(shipToListObj != null){
shipToListObj.populateXmlNode(shipToListNode);
}
}
}
public class DriversLicenseType {
public String state;
private String[] state_type_info = new String[]{'state','https://api.authorize.net/soap/v1/','string','0','1','false'};
public String number_x;
public String dateOfBirth;
private String[] number_x_type_info = new String[]{'number','https://api.authorize.net/soap/v1/','string','0','1','false'};
private String[] dateOfBirth_type_info = new String[]{'dateOfBirth','https://api.authorize.net/soap/v1/','string','0','1','false'};
private String[] apex_schema_type_info = new String[]{'https://api.authorize.net/soap/v1/','true','false'};
private String[] field_order_type_info = new String[]{'state','number_x','dateOfBirth'};
public DriversLicenseType(){
}
public DriversLicenseType(DOM.XmlNode responseNode){
Set<DOM.XmlNode> nodesParsed = new Set<DOM.XmlNode>();
DOM.XmlNode stateNode = responseNode.getChildElement('state', 'https://api.authorize.net/soap/v1/');
this.state = (stateNode == null) ? null : stateNode.getText();
nodesParsed.add(stateNode);
//System.debug(this.state);
DOM.XmlNode number_xNode = responseNode.getChildElement('number', 'https://api.authorize.net/soap/v1/');
this.number_x = (number_xNode == null) ? null : number_xNode.getText();
nodesParsed.add(number_xNode);
//System.debug(this.number_x);
DOM.XmlNode dateOfBirthNode = responseNode.getChildElement('dateOfBirth', 'https://api.authorize.net/soap/v1/');
this.dateOfBirth = (dateOfBirthNode == null) ? null : dateOfBirthNode.getText();
nodesParsed.add(dateOfBirthNode);
//System.debug(this.dateOfBirth);
}
public void populateXmlNode(Dom.XmlNode outerNode){
Dom.XmlNode stateNode = outerNode.addChildElement('state', 'https://api.authorize.net/soap/v1/', '');
stateNode.addTextNode((this.state == null) ? '' : this.state);
Dom.XmlNode number_xNode = outerNode.addChildElement('number', 'https://api.authorize.net/soap/v1/', '');
number_xNode.addTextNode((this.number_x == null) ? '' : this.number_x);
Dom.XmlNode dateOfBirthNode = outerNode.addChildElement('dateOfBirth', 'https://api.authorize.net/soap/v1/', '');
dateOfBirthNode.addTextNode((this.dateOfBirth == null) ? '' : this.dateOfBirth);
}
}
public class MerchantAuthenticationType {
public String name;
public String transactionKey;
private String[] name_type_info = new String[]{'name','https://api.authorize.net/soap/v1/','string','0','1','false'};
private String[] transactionKey_type_info = new String[]{'transactionKey','https://api.authorize.net/soap/v1/','string','0','1','false'};
private String[] apex_schema_type_info = new String[]{'https://api.authorize.net/soap/v1/','true','false'};
private String[] field_order_type_info = new String[]{'name','transactionKey'};
public MerchantAuthenticationType(){
}
public MerchantAuthenticationType(DOM.XmlNode responseNode){
Set<DOM.XmlNode> nodesParsed = new Set<DOM.XmlNode>();
DOM.XmlNode nameNode = responseNode.getChildElement('name', 'https://api.authorize.net/soap/v1/');
this.name = (nameNode == null) ? null : nameNode.getText();
nodesParsed.add(nameNode);
//System.debug(this.name);
DOM.XmlNode transactionKeyNode = responseNode.getChildElement('transactionKey', 'https://api.authorize.net/soap/v1/');
this.transactionKey = (transactionKeyNode == null) ? null : transactionKeyNode.getText();
nodesParsed.add(transactionKeyNode);
//System.debug(this.transactionKey);
}
public void populateXmlNode(Dom.XmlNode outerNode){
Dom.XmlNode nameNode = outerNode.addChildElement('name', 'https://api.authorize.net/soap/v1/', '');
nameNode.addTextNode((this.name == null) ? '' : this.name);
Dom.XmlNode transactionKeyNode = outerNode.addChildElement('transactionKey', 'https://api.authorize.net/soap/v1/', '');
transactionKeyNode.addTextNode((this.transactionKey == null) ? '' : this.transactionKey);
}
}
public class MessagesTypeMessage {
public String code;
public String text;
private String[] code_type_info = new String[]{'code','https://api.authorize.net/soap/v1/','string','0','1','false'};
private String[] text_type_info = new String[]{'text','https://api.authorize.net/soap/v1/','string','0','1','false'};
private String[] apex_schema_type_info = new String[]{'https://api.authorize.net/soap/v1/','true','false'};
private String[] field_order_type_info = new String[]{'code','text'};
public MessagesTypeMessage(){
}
public MessagesTypeMessage(DOM.XmlNode responseNode){
Set<DOM.XmlNode> nodesParsed = new Set<DOM.XmlNode>();
DOM.XmlNode codeNode = responseNode.getChildElement('code', 'https://api.authorize.net/soap/v1/');
this.code = (codeNode == null) ? null : codeNode.getText();
nodesParsed.add(codeNode);
//System.debug(this.code);
DOM.XmlNode textNode = responseNode.getChildElement('text', 'https://api.authorize.net/soap/v1/');
this.text = (textNode == null) ? null : textNode.getText();
nodesParsed.add(textNode);
//System.debug(this.text);
}
public void populateXmlNode(Dom.XmlNode outerNode){
Dom.XmlNode codeNode = outerNode.addChildElement('code', 'https://api.authorize.net/soap/v1/', '');
codeNode.addTextNode((this.code == null) ? '' : this.code);
Dom.XmlNode textNode = outerNode.addChildElement('text', 'https://api.authorize.net/soap/v1/', '');
textNode.addTextNode((this.text == null) ? '' : this.text);
}
}
// Warning: PaymentType - All the XmlSchemaElements in '<xsd:choice>' element are added as members of the class. Choice Members: creditCard bankAccount
public class PaymentType {
public apiAuthorizeNetSoapV1.CreditCardType creditCard;
public apiAuthorizeNetSoapV1.BankAccountType bankAccount;
private String[] creditCard_type_info = new String[]{'creditCard','https://api.authorize.net/soap/v1/','CreditCardType','0','1','false'};
private String[] bankAccount_type_info = new String[]{'bankAccount','https://api.authorize.net/soap/v1/','BankAccountType','0','1','false'};
private String[] apex_schema_type_info = new String[]{'https://api.authorize.net/soap/v1/','true','false'};
private String[] field_order_type_info = new String[]{'creditCard','bankAccount'};
public PaymentType(){
}
public PaymentType(DOM.XmlNode responseNode){
Set<DOM.XmlNode> nodesParsed = new Set<DOM.XmlNode>();
DOM.XmlNode creditCardNode = responseNode.getChildElement('creditCard', 'https://api.authorize.net/soap/v1/');
if(creditCardNode == null){
this.creditCard = null;
} else{
apiAuthorizeNetSoapV1.CreditCardType creditCardObj = new apiAuthorizeNetSoapV1.CreditCardType(creditCardNode);
nodesParsed.add(creditCardNode);
this.creditCard = creditCardObj;
}
//System.debug(this.creditCard);
DOM.XmlNode bankAccountNode = responseNode.getChildElement('bankAccount', 'https://api.authorize.net/soap/v1/');
if(bankAccountNode == null){
this.bankAccount = null;
} else{
apiAuthorizeNetSoapV1.BankAccountType bankAccountObj = new apiAuthorizeNetSoapV1.BankAccountType(bankAccountNode);
nodesParsed.add(bankAccountNode);
this.bankAccount = bankAccountObj;
}
//System.debug(this.bankAccount);
}
public void populateXmlNode(Dom.XmlNode outerNode){
apiAuthorizeNetSoapV1.CreditCardType creditCardObj = this.creditCard;
Dom.XmlNode creditCardNode = outerNode.addChildElement('creditCard', 'https://api.authorize.net/soap/v1/', '');
if(creditCardObj != null){
creditCardObj.populateXmlNode(creditCardNode);
}
apiAuthorizeNetSoapV1.BankAccountType bankAccountObj = this.bankAccount;
Dom.XmlNode bankAccountNode = outerNode.addChildElement('bankAccount', 'https://api.authorize.net/soap/v1/', '');
if(bankAccountObj != null){
bankAccountObj.populateXmlNode(bankAccountNode);
}
}
}
public class ServiceSoap {
public String endpoint_x = 'https://api.authorize.net/soap/v1/Service.asmx';
public Map<String,String> inputHttpHeaders_x;
public Map<String,String> outputHttpHeaders_x;
public String clientCertName_x;
public String clientCert_x;
public String clientCertPasswd_x;
public Integer timeout_x;
private String[] ns_map_type_info = new String[]{'https://api.authorize.net/soap/v1/','apiAuthorizeNetSoapV1'};
public apiAuthorizeNetSoapV1.CreateCustomerProfileResponseType CreateCustomerProfile(apiAuthorizeNetSoapV1.MerchantAuthenticationType merchantAuthentication,apiAuthorizeNetSoapV1.CustomerProfileType profile,String validationMode) {
apiAuthorizeNetSoapV1.CreateCustomerProfile_element request_x = new apiAuthorizeNetSoapV1.CreateCustomerProfile_element();
apiAuthorizeNetSoapV1.CreateCustomerProfileResponse_element response_x;
request_x.merchantAuthentication = merchantAuthentication;
request_x.profile = profile;
request_x.validationMode = validationMode;
Map<String, apiAuthorizeNetSoapV1.CreateCustomerProfileResponse_element> response_map_x = new Map<String, apiAuthorizeNetSoapV1.CreateCustomerProfileResponse_element>();
response_map_x.put('response_x', response_x);
WebServiceCallout.invoke(
this,
request_x,
response_map_x,
new String[]{endpoint_x,
'https://api.authorize.net/soap/v1/CreateCustomerProfile',
'https://api.authorize.net/soap/v1/',
'CreateCustomerProfile',
'https://api.authorize.net/soap/v1/',
'CreateCustomerProfileResponse',
'apiAuthorizeNetSoapV1.CreateCustomerProfileResponse_element'}
);
response_x = response_map_x.get('response_x');
return response_x.CreateCustomerProfileResult;
}
private DOM.XmlNode populateDoc(DOM.Document doc){
String env = 'http://schemas.xmlsoap.org/soap/envelope/';
String xsi = 'http://www.w3.org/2001/XMLSchema-instance';
String xsd = 'http://www.w3.org/2001/XMLSchema';
DOM.XmlNode envelope = doc.createRootElement('Envelope', env, 'env');
envelope.setNamespace('xsd', xsd);
envelope.setNamespace('xsi', xsi);
DOM.XmlNode header = envelope.addChildElement('Header', env, '');
AddHeader(header);
//System.debug(doc.toXmlString());
DOM.XmlNode body = envelope.addChildElement('Body', env, '');
return body;
}
private void AddHeader(DOM.XmlNode header){
}
public apiAuthorizeNetSoapV1.CreateCustomerProfileResponseType CreateCustomerProfile_Http(apiAuthorizeNetSoapV1.MerchantAuthenticationType merchantAuthentication,apiAuthorizeNetSoapV1.CustomerProfileType profile,String validationMode) {
DOM.Document doc = new DOM.Document();
DOM.XmlNode body = populateDoc(doc);
DOM.XmlNode methodNode = body.addChildElement('CreateCustomerProfile', 'https://api.authorize.net/soap/v1/', '');
apiAuthorizeNetSoapV1.CreateCustomerProfile_element request_x = new apiAuthorizeNetSoapV1.CreateCustomerProfile_element(merchantAuthentication,profile,validationMode);
request_x.populateXmlNode(methodNode);
HttpRequest req = new HttpRequest();
req.setEndpoint(endpoint_x);
req.setMethod('POST');
req.setHeader('Content-Type', 'text/xml; charset=UTF-8');
req.setHeader('SOAPAction', 'https://api.authorize.net/soap/v1/CreateCustomerProfile');
req.setBodyDocument(doc);
//System.debug(req.getBody());
Http http = new Http();
HTTPResponse res = http.send(req);
//System.debug(res.getBody());
Dom.Document responseDoc = res.getBodyDocument();
Dom.XmlNode rootNode = responseDoc.getRootElement();
Dom.XmlNode bodyNode = rootNode.getChildElement('Body','http://schemas.xmlsoap.org/soap/envelope/');
Dom.XmlNode CreateCustomerProfileResponseNode = bodyNode.getChildElement('CreateCustomerProfileResponse', 'https://api.authorize.net/soap/v1/');
apiAuthorizeNetSoapV1.CreateCustomerProfileResponse_element response_x = new apiAuthorizeNetSoapV1.CreateCustomerProfileResponse_element(CreateCustomerProfileResponseNode);
return response_x.CreateCustomerProfileResult;
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment