cancel
Showing results for 
Search instead for 
Did you mean: 

TOKEN RECEIVED NEXT STEPS ?

I receive my token just fine, what are the next steps to set up the form fields for the post to

https://apitest.authorize.net/xml/v1/request.api

 

Do I call certain API's, a little confused by the docs on this REST interface?  

 

When I call :

$lineItem1 = new AnetAPI\LineItemType();

$lineItem1->setItemId($item_id);

...

$an_tranobj->addToLineItems($lineItem1);

Is this really generating the XML to be sent.

 

Do I need to use the API to correctly generate the XML for AN to accept it?

 

I have had a working version som SIM for over 8 years and the conversion is causing lots of problems, I use REST interfaces on other interfaces and they usually create a code example of a start to finish, I have looked at the ones on GitHub, but they all seem to assume facts not in evidence!

 

I am hoping one of you experts can lend me a hand on this.

 

Jim

 

 

 

jmd804500
Contributor
12 REPLIES 12

@jmd804500 

 

The API does the conversion for you when you set those objects. You do not have to use any special encoding or formatting that you wouldn't ordinarily use in your application. You still have to supply elements of the right type.  So $transactionRequest->setLineItems() will expect an array. But beyond doing type matching like this, it's business as usual.

 

As far as sending pure XML, it works.  I have never done it but you can. I personally find it much easier to use the SDK package, but if that works for you you can surely do it. 

Renaissance
All Star

Thanks for the feed back,

currently when my page returns I just get two

 

Order Summary

 

with two buttons

 

any Ideas? is there a typical order to call the API in?

 

So you are saying that when you call an Accept Hosted Payment Form you get a form that has only those fields?

Also:

 

Code:

function add_line_item($item_id,$name,$desc,$qty,$unit_price,$taxalbe=0)
    {
           $lineItem1 = new AnetAPI\LineItemType();
           $lineItem1->setItemId($item_id);
           $lineItem1->setName($name);
           $lineItem1->setDescription($desc);
           $lineItem1->setQuantity($qty);
           $lineItem1->setUnitPrice($unit_price);
           $lineItem1->setTaxable(0); // 1 Yes 0 for no
           $this->lineItems_ary[$this->liinc++] = $lineItem1;
     }

 

$an_tran_obj->setLineItems($this->lineItems_ary);

 

 

ERROR: E00003 The element 'lineItem' in namespace 'AnetApi/xml/v1/sche
ma/AnetApiSchema.xsd' has invalid child element 'quantity' in namespace 'AnetApi/xml/v1/schema/AnetApiSchema.xsd'. List of possible elements expected: 'itemId' in namespace 'Ane
tApi/xml/v1/schema/AnetApiSchema.xsd'

Yes

So for your form you need to add settings to the hosted payment form. There are a bunch of them. Here is an example snippet of code that will get the email address field to populate.

 

$setting4->setSettingName("hostedPaymentCustomerOptions");
$setting4->setSettingValue( "{\"showEmail\": true, \"requiredEmail\": true}");

 

You can add several values to any setting, given that the setting supports that value. 

Is there by chance a   list of these somewhere I could review or a typical list that people set?

 

Yes in the API docs for the hosted form.  

 

Here is a good place to start. 

 

https://developer.authorize.net/api/reference/features/accept_hosted.html

 

 

I think there are some also in the main API reference. Click the API tab at the top of this forum and then go to the link on the right for "Accept Suite".

That error reponse you are getting isn't something I can figure out, as I am not familiar with that syntax. Is that coldfusion you are using?