cancel
Showing results for 
Search instead for 
Did you mean: 

Populating XML Template

@Aaron,

 

When you helped me earlier, you included this...

 

//modify the template to add apropriate values
$xml->merchantAuthentication->addChild('name',$loginId);
$xml->merchantAuthentication->addChild('transactionKey',$transactionKey);
//add the payment information from the information that was posted to this script
$xml->creditCard->addChild('cardNumber',$cardNumber);
$xml->creditCard->addChild('expirationDate',$expirationDate);
$xml->creditCard->addChild('cardCode',$cardCode);

 

Questions:

1.) Why do you have to use "addChild" to populate the XML template?

 

Why can't you just type in values like...

 

<merchantAuthentication>
<name>$loginID</name>
<transactionKey>$transactionKey</transactionKey>
</merchantAuthentication>


<creditCard>
<cardNumber>$cardNumber</cardNumber>
and so on...
</creditCard>

 

 

2.) Where do I find out which "tags" in the XML tree are required?

 

Is it just what I infer from your earlier explanation?

 

 

Thanks,

 

 

Sally

 

ssimons
Contributor
1 REPLY 1

@ssimons wrote:

 

Questions:

1.) Why do you have to use "addChild" to populate the XML template?

 

Why can't you just type in values like...

 


 

Whatever works for you. There's no "right" way, just whichever way ends up sending a valid XML request to our server.

 


@ssimons wrote:

 

 

2.) Where do I find out which "tags" in the XML tree are required?

  


 

Our API reference guide is here.

 

Aaron
All Star