Authorize.net Accept Hosted Redirect Method

classic Classic list List threaded Threaded
13 messages Options
Reply | Threaded
Open this post in threaded view
|

Authorize.net Accept Hosted Redirect Method

Mike Ealy-2
I'm working through the steps to move from Authorize.net SIM method to
Accept Hosted Redirect Method. I'm using Lasso 8.5 on MacOS 10.11.6.

The first step is to request a Form Validation Token. I tried using
include_URL but it produces an Authorize error code saying the name of the
requested API method is invalid. This may be because TLS in not supported by
include_URL.

[Include_URL: 'https://apitest.authorize.net/xml/v1/request.api',
-POSTParams='<xml><getHostedPaymentPageRequest
xmlns="AnetApi/xml/v1/schema/AnetApiSchema.xsd">
    <merchantAuthentication>
        <name>SANDBOX_API_LOGIN_ID</name>
        <transactionKey>SANDBOX_API_TRANSACTION_KEY</transactionKey>
    </merchantAuthentication>
    <transactionRequest>
        <transactionType>authCaptureTransaction</transactionType>
        <amount>20.00</amount>
    </transactionRequest>
</getHostedPaymentPageRequest></xml>']

Reading the archives it looks like using curl is a better option. I've tried
this but I can't seem to get the syntax right.

[shell('curl -X POST https://apitest.authorize.net/xml/v1/request.api
--header 'content-type: text/xml' --data '$xml_content')]

How do I pass this xml into curl and submit it to
https://apitest.authorize.net/xml/v1/request.api?

Thanks,
Mike Ealy



#############################################################

This message is sent to you because you are subscribed to
  the mailing list Lasso [hidden email]
Official list archives available at http://www.lassotalk.com
To unsubscribe, E-mail to: <[hidden email]>
Send administrative queries to  <[hidden email]>
Reply | Threaded
Open this post in threaded view
|

Re: Authorize.net Accept Hosted Redirect Method

stevepiercy
What's the error code and message?

A similar example that does work can be gleaned from my tag.

https://github.com/stevepiercy/AuthorizeNet_AIM/blob/master/AuthorizeNet_AIM.inc#L193

--steve


On 2/27/19 at 12:03 PM, [hidden email] (Mike Ealy) pronounced:

> I'm working through the steps to move from Authorize.net SIM method to
> Accept Hosted Redirect Method. I'm using Lasso 8.5 on MacOS 10.11.6.
>
> The first step is to request a Form Validation Token. I tried using
> include_URL but it produces an Authorize error code saying the name of the
> requested API method is invalid. This may be because TLS in not supported by
> include_URL.
>
> [Include_URL: 'https://apitest.authorize.net/xml/v1/request.api',
> -POSTParams='<xml><getHostedPaymentPageRequest
> xmlns="AnetApi/xml/v1/schema/AnetApiSchema.xsd">
>     <merchantAuthentication>
>         <name>SANDBOX_API_LOGIN_ID</name>
>         <transactionKey>SANDBOX_API_TRANSACTION_KEY</transactionKey>
>     </merchantAuthentication>
>     <transactionRequest>
>         <transactionType>authCaptureTransaction</transactionType>
>         <amount>20.00</amount>
>     </transactionRequest>
> </getHostedPaymentPageRequest></xml>']
>
> Reading the archives it looks like using curl is a better option. I've tried
> this but I can't seem to get the syntax right.
>
> [shell('curl -X POST https://apitest.authorize.net/xml/v1/request.api
> --header 'content-type: text/xml' --data '$xml_content')]
>
> How do I pass this xml into curl and submit it to
> https://apitest.authorize.net/xml/v1/request.api?
>
> Thanks,
> Mike Ealy
>
>
>
> #############################################################
>
> This message is sent to you because you are subscribed to
>   the mailing list Lasso [hidden email]
> Official list archives available at http://www.lassotalk.com
> To unsubscribe, E-mail to: <[hidden email]>
> Send administrative queries to  <[hidden email]>

-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
Steve Piercy              Website Builder              Eugene, OR
<[hidden email]>               <http://www.stevepiercy.com/>


#############################################################

This message is sent to you because you are subscribed to
  the mailing list Lasso [hidden email]
Official list archives available at http://www.lassotalk.com
To unsubscribe, E-mail to: <[hidden email]>
Send administrative queries to  <[hidden email]>
Reply | Threaded
Open this post in threaded view
|

Re: Authorize.net Accept Hosted Redirect Method

Mike Ealy-2
$ curl -X POST https://apitest.authorize.net/xml/v1/request.api --header
'content-type: text/xml' --data '<xml><getHostedPaymentPageRequest
xmlns="AnetApi/xml/v1/schema/AnetApiSchema.xsd"><merchantAuthentication><nam
e>SANDBOX_API_LOGIN_ID</name><transactionKey>SANDBOX_API_TRANSACTION_KEY</tr
ansactionKey></merchantAuthentication><transactionRequest><transactionType>a
uthCaptureTransaction</transactionType><amount>20.00</amount></transactionRe
quest></getHostedPaymentPageRequest></xml>'

Produces:
<?xml version="1.0" encoding="utf-8"?><ErrorResponse
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns="AnetApi/xml/v1/schema/AnetApiSchema.xsd"><messages><resultCode>Error<
/resultCode><message><code>E00004</code><text>The name of the requested API
method is invalid.</text></message></messages></ErrorResponse>

 
https://developer.authorize.net/api/reference/responseCodes.html?code=E00004

Code: E00004
Explanation: The name of the requested API method is invalid.
Description: The name of the root node of the XML request is the API method
being called. It is not valid.
 
I'll take a look at the syntax in your tag. Thanks, Steve.

Mike


> What's the error code and message?
>
> A similar example that does work can be gleaned from my tag.
>
> https://github.com/stevepiercy/AuthorizeNet_AIM/blob/master/AuthorizeNet_AIM.i
> nc#L193
>
> --steve
>
>
> On 2/27/19 at 12:03 PM, [hidden email] (Mike Ealy) pronounced:
>
>> I'm working through the steps to move from Authorize.net SIM method to
>> Accept Hosted Redirect Method. I'm using Lasso 8.5 on MacOS 10.11.6.
>>
>> The first step is to request a Form Validation Token. I tried using
>> include_URL but it produces an Authorize error code saying the name of the
>> requested API method is invalid. This may be because TLS in not supported by
>> include_URL.
>>
>> [Include_URL: 'https://apitest.authorize.net/xml/v1/request.api',
>> -POSTParams='<xml><getHostedPaymentPageRequest
>> xmlns="AnetApi/xml/v1/schema/AnetApiSchema.xsd">
>>     <merchantAuthentication>
>>         <name>SANDBOX_API_LOGIN_ID</name>
>>         <transactionKey>SANDBOX_API_TRANSACTION_KEY</transactionKey>
>>     </merchantAuthentication>
>>     <transactionRequest>
>>         <transactionType>authCaptureTransaction</transactionType>
>>         <amount>20.00</amount>
>>     </transactionRequest>
>> </getHostedPaymentPageRequest></xml>']
>>
>> Reading the archives it looks like using curl is a better option. I've tried
>> this but I can't seem to get the syntax right.
>>
>> [shell('curl -X POST https://apitest.authorize.net/xml/v1/request.api
>> --header 'content-type: text/xml' --data '$xml_content')]
>>
>> How do I pass this xml into curl and submit it to
>> https://apitest.authorize.net/xml/v1/request.api?
>>
>> Thanks,
>> Mike Ealy
>>
>>
>>
>> #############################################################
>>
>> This message is sent to you because you are subscribed to
>>   the mailing list Lasso [hidden email]
>> Official list archives available at http://www.lassotalk.com
>> To unsubscribe, E-mail to: <[hidden email]>
>> Send administrative queries to  <[hidden email]>
>
> -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
> Steve Piercy              Website Builder              Eugene, OR
> <[hidden email]>               <http://www.stevepiercy.com/>
>
>
> #############################################################
>
> This message is sent to you because you are subscribed to
>   the mailing list Lasso [hidden email]
> Official list archives available at http://www.lassotalk.com
> To unsubscribe, E-mail to: <[hidden email]>
> Send administrative queries to  <[hidden email]>



#############################################################

This message is sent to you because you are subscribed to
  the mailing list Lasso [hidden email]
Official list archives available at http://www.lassotalk.com
To unsubscribe, E-mail to: <[hidden email]>
Send administrative queries to  <[hidden email]>
Reply | Threaded
Open this post in threaded view
|

Re: Authorize.net Accept Hosted Redirect Method

stevepiercy
You have several mistakes with quote marks and the --header argument.  Try this:

    shell("curl -X POST https://apitest.authorize.net/xml/v1/request.api \
            --header Content-Type: application/xml \
            --data " + $xml_content)

Tip: try doing this from a terminal first to speed up development without Lasso getting in the way.

    export xml="<my crazy long xml>"
    curl -X POST https://apitest.authorize.net/xml/v1/request.api \
            --header Content-Type: application/xml \
            --data $xml

--steve


On 2/27/19 at 2:24 PM, [hidden email] (Mike Ealy) pronounced:

> $ curl -X POST https://apitest.authorize.net/xml/v1/request.api --header
> 'content-type: text/xml' --data '<xml><getHostedPaymentPageRequest
> xmlns="AnetApi/xml/v1/schema/AnetApiSchema.xsd"><merchantAuthentication><nam
> e>SANDBOX_API_LOGIN_ID</name><transactionKey>SANDBOX_API_TRANSACTION_KEY</tr
> ansactionKey></merchantAuthentication><transactionRequest><transactionType>a
> uthCaptureTransaction</transactionType><amount>20.00</amount></transactionRe
> quest></getHostedPaymentPageRequest></xml>'
>
> Produces:
> <?xml version="1.0" encoding="utf-8"?><ErrorResponse
> xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
> xmlns:xsd="http://www.w3.org/2001/XMLSchema"
> xmlns="AnetApi/xml/v1/schema/AnetApiSchema.xsd"><messages><resultCode>Error<
> /resultCode><message><code>E00004</code><text>The name of the requested API
> method is invalid.</text></message></messages></ErrorResponse>
>
>  
> https://developer.authorize.net/api/reference/responseCodes.html?code=E00004
>
> Code: E00004
> Explanation: The name of the requested API method is invalid.
> Description: The name of the root node of the XML request is the API method
> being called. It is not valid.
>  
> I'll take a look at the syntax in your tag. Thanks, Steve.
>
> Mike
>
>
> > What's the error code and message?
> >
> > A similar example that does work can be gleaned from my tag.
> >
> > https://github.com/stevepiercy/AuthorizeNet_AIM/blob/master/AuthorizeNet_AIM.i
> > nc#L193
> >
> > --steve
> >
> >
> > On 2/27/19 at 12:03 PM, [hidden email] (Mike Ealy) pronounced:
> >
> >> I'm working through the steps to move from Authorize.net SIM method to
> >> Accept Hosted Redirect Method. I'm using Lasso 8.5 on MacOS 10.11.6.
> >>
> >> The first step is to request a Form Validation Token. I tried using
> >> include_URL but it produces an Authorize error code saying the name of the
> >> requested API method is invalid. This may be because TLS in not supported by
> >> include_URL.
> >>
> >> [Include_URL: 'https://apitest.authorize.net/xml/v1/request.api',
> >> -POSTParams='<xml><getHostedPaymentPageRequest
> >> xmlns="AnetApi/xml/v1/schema/AnetApiSchema.xsd">
> >>     <merchantAuthentication>
> >>         <name>SANDBOX_API_LOGIN_ID</name>
> >>         <transactionKey>SANDBOX_API_TRANSACTION_KEY</transactionKey>
> >>     </merchantAuthentication>
> >>     <transactionRequest>
> >>         <transactionType>authCaptureTransaction</transactionType>
> >>         <amount>20.00</amount>
> >>     </transactionRequest>
> >> </getHostedPaymentPageRequest></xml>']
> >>
> >> Reading the archives it looks like using curl is a better option. I've tried
> >> this but I can't seem to get the syntax right.
> >>
> >> [shell('curl -X POST https://apitest.authorize.net/xml/v1/request.api
> >> --header 'content-type: text/xml' --data '$xml_content')]
> >>
> >> How do I pass this xml into curl and submit it to
> >> https://apitest.authorize.net/xml/v1/request.api?
> >>
> >> Thanks,
> >> Mike Ealy
> >>
> >>
> >>
> >> #############################################################
> >>
> >> This message is sent to you because you are subscribed to
> >>   the mailing list Lasso [hidden email]
> >> Official list archives available at http://www.lassotalk.com
> >> To unsubscribe, E-mail to: <[hidden email]>
> >> Send administrative queries to  <[hidden email]>
> >
> > -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
> > Steve Piercy              Website Builder              Eugene, OR
> > <[hidden email]>               <http://www.stevepiercy.com/>
> >
> >
> > #############################################################
> >
> > This message is sent to you because you are subscribed to
> >   the mailing list Lasso [hidden email]
> > Official list archives available at http://www.lassotalk.com
> > To unsubscribe, E-mail to: <[hidden email]>
> > Send administrative queries to  <[hidden email]>
>
>
>
> #############################################################
>
> This message is sent to you because you are subscribed to
>   the mailing list Lasso [hidden email]
> Official list archives available at http://www.lassotalk.com
> To unsubscribe, E-mail to: <[hidden email]>
> Send administrative queries to  <[hidden email]>

-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
Steve Piercy              Website Builder              Eugene, OR
<[hidden email]>               <http://www.stevepiercy.com/>


#############################################################

This message is sent to you because you are subscribed to
  the mailing list Lasso [hidden email]
Official list archives available at http://www.lassotalk.com
To unsubscribe, E-mail to: <[hidden email]>
Send administrative queries to  <[hidden email]>
Reply | Threaded
Open this post in threaded view
|

Re: Authorize.net Accept Hosted Redirect Method

stevepiercy
Ack.  I did not properly quote the header value.

    shell('curl -X POST https://apitest.authorize.net/xml/v1/request.api \
            --header "Content-Type: application/xml" \
            --data ' + $xml_content)


    export xml="<my crazy long xml>"
    curl -X POST https://apitest.authorize.net/xml/v1/request.api \
            --header "Content-Type: application/xml" \
            --data $xml

Also check for proper quoting of --data argument.

--steve


On 2/27/19 at 12:01 PM, [hidden email] (Steve Piercy - Website Builder) pronounced:

> You have several mistakes with quote marks and the --header argument.  Try this:
>
>     shell("curl -X POST https://apitest.authorize.net/xml/v1/request.api \
>             --header Content-Type: application/xml \
>             --data " + $xml_content)
>
> Tip: try doing this from a terminal first to speed up development without Lasso getting in
> the way.
>
>     export xml="<my crazy long xml>"
>     curl -X POST https://apitest.authorize.net/xml/v1/request.api \
>             --header Content-Type: application/xml \
>             --data $xml
>
> --steve
>
>
> On 2/27/19 at 2:24 PM, [hidden email] (Mike Ealy) pronounced:
>
> > $ curl -X POST https://apitest.authorize.net/xml/v1/request.api --header
> > 'content-type: text/xml' --data '<xml><getHostedPaymentPageRequest
> > xmlns="AnetApi/xml/v1/schema/AnetApiSchema.xsd"><merchantAuthentication><nam
> > e>SANDBOX_API_LOGIN_ID</name><transactionKey>SANDBOX_API_TRANSACTION_KEY</tr
> > ansactionKey></merchantAuthentication><transactionRequest><transactionType>a
> > uthCaptureTransaction</transactionType><amount>20.00</amount></transactionRe
> > quest></getHostedPaymentPageRequest></xml>'
> >
> > Produces:
> > <?xml version="1.0" encoding="utf-8"?><ErrorResponse
> > xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
> > xmlns:xsd="http://www.w3.org/2001/XMLSchema"
> > xmlns="AnetApi/xml/v1/schema/AnetApiSchema.xsd"><messages><resultCode>Error<
> > /resultCode><message><code>E00004</code><text>The name of the requested API
> > method is invalid.</text></message></messages></ErrorResponse>
> >
> >  
> > https://developer.authorize.net/api/reference/responseCodes.html?code=E00004
> >
> > Code: E00004
> > Explanation: The name of the requested API method is invalid.
> > Description: The name of the root node of the XML request is the API method
> > being called. It is not valid.
> >  
> > I'll take a look at the syntax in your tag. Thanks, Steve.
> >
> > Mike
> >
> >
> > > What's the error code and message?
> > >
> > > A similar example that does work can be gleaned from my tag.
> > >
> > > https://github.com/stevepiercy/AuthorizeNet_AIM/blob/master/AuthorizeNet_AIM.i
> > > nc#L193
> > >
> > > --steve
> > >
> > >
> > > On 2/27/19 at 12:03 PM, [hidden email] (Mike Ealy) pronounced:
> > >
> > >> I'm working through the steps to move from Authorize.net SIM method to
> > >> Accept Hosted Redirect Method. I'm using Lasso 8.5 on MacOS 10.11.6.
> > >>
> > >> The first step is to request a Form Validation Token. I tried using
> > >> include_URL but it produces an Authorize error code saying the name of the
> > >> requested API method is invalid. This may be because TLS in not supported by
> > >> include_URL.
> > >>
> > >> [Include_URL: 'https://apitest.authorize.net/xml/v1/request.api',
> > >> -POSTParams='<xml><getHostedPaymentPageRequest
> > >> xmlns="AnetApi/xml/v1/schema/AnetApiSchema.xsd">
> > >>     <merchantAuthentication>
> > >>         <name>SANDBOX_API_LOGIN_ID</name>
> > >>         <transactionKey>SANDBOX_API_TRANSACTION_KEY</transactionKey>
> > >>     </merchantAuthentication>
> > >>     <transactionRequest>
> > >>         <transactionType>authCaptureTransaction</transactionType>
> > >>         <amount>20.00</amount>
> > >>     </transactionRequest>
> > >> </getHostedPaymentPageRequest></xml>']
> > >>
> > >> Reading the archives it looks like using curl is a better option. I've tried
> > >> this but I can't seem to get the syntax right.
> > >>
> > >> [shell('curl -X POST https://apitest.authorize.net/xml/v1/request.api
> > >> --header 'content-type: text/xml' --data '$xml_content')]
> > >>
> > >> How do I pass this xml into curl and submit it to
> > >> https://apitest.authorize.net/xml/v1/request.api?
> > >>
> > >> Thanks,
> > >> Mike Ealy
> > >>
> > >>
> > >>
> > >> #############################################################
> > >>
> > >> This message is sent to you because you are subscribed to
> > >>   the mailing list Lasso [hidden email]
> > >> Official list archives available at http://www.lassotalk.com
> > >> To unsubscribe, E-mail to: <[hidden email]>
> > >> Send administrative queries to  <[hidden email]>
> > >
> > > -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
> > > Steve Piercy              Website Builder              Eugene, OR
> > > <[hidden email]>               <http://www.stevepiercy.com/>
> > >
> > >
> > > #############################################################
> > >
> > > This message is sent to you because you are subscribed to
> > >   the mailing list Lasso [hidden email]
> > > Official list archives available at http://www.lassotalk.com
> > > To unsubscribe, E-mail to: <[hidden email]>
> > > Send administrative queries to  <[hidden email]>
> >
> >
> >
> > #############################################################
> >
> > This message is sent to you because you are subscribed to
> >   the mailing list Lasso [hidden email]
> > Official list archives available at http://www.lassotalk.com
> > To unsubscribe, E-mail to: <[hidden email]>
> > Send administrative queries to  <[hidden email]>
>
> -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
> Steve Piercy              Website Builder              Eugene, OR
> <[hidden email]>               <http://www.stevepiercy.com/>
>
>
> #############################################################
>
> This message is sent to you because you are subscribed to
>   the mailing list Lasso [hidden email]
> Official list archives available at http://www.lassotalk.com
> To unsubscribe, E-mail to: <[hidden email]>
> Send administrative queries to  <[hidden email]>

-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
Steve Piercy              Website Builder              Eugene, OR
<[hidden email]>               <http://www.stevepiercy.com/>


#############################################################

This message is sent to you because you are subscribed to
  the mailing list Lasso [hidden email]
Official list archives available at http://www.lassotalk.com
To unsubscribe, E-mail to: <[hidden email]>
Send administrative queries to  <[hidden email]>
Reply | Threaded
Open this post in threaded view
|

Re: Authorize.net Accept Hosted Redirect Method

Mike Ealy-2
This works in terminal:

curl -X POST https://apitest.authorize.net/xml/v1/request.api --header
'Content-Type: application/xml' --data '<getHostedPaymentPageRequest
xmlns="AnetApi/xml/v1/schema/AnetApiSchema.xsd"><merchantAuthentication><nam
e>SANDBOX_API_LOGIN_ID</name><transactionKey>SANDBOX_API_TRANSACTION_KEY</tr
ansactionKey></merchantAuthentication><transactionRequest><transactionType>a
uthCaptureTransaction</transactionType><amount>20.00</amount></transactionRe
quest></getHostedPaymentPageRequest>'

Result:
<?xml version="1.0" encoding="utf-8"?><getHostedPaymentPageResponse
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns="AnetApi/xml/v1/schema/AnetApiSchema.xsd"><messages><resultCode>Ok</re
sultCode><message><code>I00001</code><text>Successful.</text></message></mes
sages><token>y56C8lnp...U1Y4ZMgM4QnG</token></getHostedPaymentPageResponse>


When I try to serve it in Lasso 8.5 I get an error.

[shell('curl -X POST https://apitest.authorize.net/xml/v1/request.api \
    --header "Content-Type: application/xml" \
    --data ' + <getHostedPaymentPageRequest
xmlns="AnetApi/xml/v1/schema/AnetApiSchema.xsd"><merchantAuthentication><nam
e>SANDBOX_API_LOGIN_ID</name><transactionKey>SANDBOX_API_TRANSACTION_KEY</tr
ansactionKey></merchantAuthentication><transactionRequest><transactionType>a
uthCaptureTransaction</transactionType><amount>20.00</amount></transactionRe
quest></getHostedPaymentPageRequest>')]

Expected: a tag name but got: "shell('curl -X POST
https://apitest.authorize.net/xml/v1/request.api --header "Content-Type:
application/xml" --data ' + <get...
at: Unterminated quoted literal on line 1 at position 1.





> Ack.  I did not properly quote the header value.
>
>     shell('curl -X POST https://apitest.authorize.net/xml/v1/request.api \
>             --header "Content-Type: application/xml" \
>             --data ' + $xml_content)
>
>
>     export xml="<my crazy long xml>"
>     curl -X POST https://apitest.authorize.net/xml/v1/request.api \
>             --header "Content-Type: application/xml" \
>             --data $xml
>
> Also check for proper quoting of --data argument.
>
> --steve
>
>
> On 2/27/19 at 12:01 PM, [hidden email] (Steve Piercy - Website Builder)
> pronounced:
>
>> You have several mistakes with quote marks and the --header argument.  Try
>> this:
>>
>>     shell("curl -X POST https://apitest.authorize.net/xml/v1/request.api \
>>             --header Content-Type: application/xml \
>>             --data " + $xml_content)
>>
>> Tip: try doing this from a terminal first to speed up development without
>> Lasso getting in
>> the way.
>>
>>     export xml="<my crazy long xml>"
>>     curl -X POST https://apitest.authorize.net/xml/v1/request.api \
>>             --header Content-Type: application/xml \
>>             --data $xml
>>
>> --steve
>>
>>
>> On 2/27/19 at 2:24 PM, [hidden email] (Mike Ealy) pronounced:
>>
>>> $ curl -X POST https://apitest.authorize.net/xml/v1/request.api --header
>>> 'content-type: text/xml' --data '<xml><getHostedPaymentPageRequest
>>> xmlns="AnetApi/xml/v1/schema/AnetApiSchema.xsd"><merchantAuthentication><nam
>>> e>SANDBOX_API_LOGIN_ID</name><transactionKey>SANDBOX_API_TRANSACTION_KEY</tr
>>> ansactionKey></merchantAuthentication><transactionRequest><transactionType>a
>>> uthCaptureTransaction</transactionType><amount>20.00</amount></transactionRe
>>> quest></getHostedPaymentPageRequest></xml>'
>>>
>>> Produces:
>>> <?xml version="1.0" encoding="utf-8"?><ErrorResponse
>>> xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
>>> xmlns:xsd="http://www.w3.org/2001/XMLSchema"
>>> xmlns="AnetApi/xml/v1/schema/AnetApiSchema.xsd"><messages><resultCode>Error<
>>> /resultCode><message><code>E00004</code><text>The name of the requested API
>>> method is invalid.</text></message></messages></ErrorResponse>
>>>
>>>  
>>> https://developer.authorize.net/api/reference/responseCodes.html?code=E00004
>>>
>>> Code: E00004
>>> Explanation: The name of the requested API method is invalid.
>>> Description: The name of the root node of the XML request is the API method
>>> being called. It is not valid.
>>>  
>>> I'll take a look at the syntax in your tag. Thanks, Steve.
>>>
>>> Mike
>>>
>>>
>>>> What's the error code and message?
>>>>
>>>> A similar example that does work can be gleaned from my tag.
>>>>
>>>> https://github.com/stevepiercy/AuthorizeNet_AIM/blob/master/AuthorizeNet_AI
>>>> M.i
>>>> nc#L193
>>>>
>>>> --steve
>>>>
>>>>
>>>> On 2/27/19 at 12:03 PM, [hidden email] (Mike Ealy) pronounced:
>>>>
>>>>> I'm working through the steps to move from Authorize.net SIM method to
>>>>> Accept Hosted Redirect Method. I'm using Lasso 8.5 on MacOS 10.11.6.
>>>>>
>>>>> The first step is to request a Form Validation Token. I tried using
>>>>> include_URL but it produces an Authorize error code saying the name of the
>>>>> requested API method is invalid. This may be because TLS in not supported
>>>>> by
>>>>> include_URL.
>>>>>
>>>>> [Include_URL: 'https://apitest.authorize.net/xml/v1/request.api',
>>>>> -POSTParams='<xml><getHostedPaymentPageRequest
>>>>> xmlns="AnetApi/xml/v1/schema/AnetApiSchema.xsd">
>>>>>     <merchantAuthentication>
>>>>>         <name>SANDBOX_API_LOGIN_ID</name>
>>>>>         <transactionKey>SANDBOX_API_TRANSACTION_KEY</transactionKey>
>>>>>     </merchantAuthentication>
>>>>>     <transactionRequest>
>>>>>         <transactionType>authCaptureTransaction</transactionType>
>>>>>         <amount>20.00</amount>
>>>>>     </transactionRequest>
>>>>> </getHostedPaymentPageRequest></xml>']
>>>>>
>>>>> Reading the archives it looks like using curl is a better option. I've
>>>>> tried
>>>>> this but I can't seem to get the syntax right.
>>>>>
>>>>> [shell('curl -X POST https://apitest.authorize.net/xml/v1/request.api
>>>>> --header 'content-type: text/xml' --data '$xml_content')]
>>>>>
>>>>> How do I pass this xml into curl and submit it to
>>>>> https://apitest.authorize.net/xml/v1/request.api?
>>>>>
>>>>> Thanks,
>>>>> Mike Ealy
>>>>>
>>>>>
>>>>>
>>>>> #############################################################
>>>>>
>>>>> This message is sent to you because you are subscribed to
>>>>>   the mailing list Lasso [hidden email]
>>>>> Official list archives available at http://www.lassotalk.com
>>>>> To unsubscribe, E-mail to: <[hidden email]>
>>>>> Send administrative queries to  <[hidden email]>
>>>>
>>>> -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
>>>> Steve Piercy              Website Builder              Eugene, OR
>>>> <[hidden email]>               <http://www.stevepiercy.com/>
>>>>
>>>>
>>>> #############################################################
>>>>
>>>> This message is sent to you because you are subscribed to
>>>>   the mailing list Lasso [hidden email]
>>>> Official list archives available at http://www.lassotalk.com
>>>> To unsubscribe, E-mail to: <[hidden email]>
>>>> Send administrative queries to  <[hidden email]>
>>>
>>>
>>>
>>> #############################################################
>>>
>>> This message is sent to you because you are subscribed to
>>>   the mailing list Lasso [hidden email]
>>> Official list archives available at http://www.lassotalk.com
>>> To unsubscribe, E-mail to: <[hidden email]>
>>> Send administrative queries to  <[hidden email]>
>>
>> -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
>> Steve Piercy              Website Builder              Eugene, OR
>> <[hidden email]>               <http://www.stevepiercy.com/>
>>
>>
>> #############################################################
>>
>> This message is sent to you because you are subscribed to
>>   the mailing list Lasso [hidden email]
>> Official list archives available at http://www.lassotalk.com
>> To unsubscribe, E-mail to: <[hidden email]>
>> Send administrative queries to  <[hidden email]>
>
> -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
> Steve Piercy              Website Builder              Eugene, OR
> <[hidden email]>               <http://www.stevepiercy.com/>
>
>
> #############################################################
>
> This message is sent to you because you are subscribed to
>   the mailing list Lasso [hidden email]
> Official list archives available at http://www.lassotalk.com
> To unsubscribe, E-mail to: <[hidden email]>
> Send administrative queries to  <[hidden email]>



#############################################################

This message is sent to you because you are subscribed to
  the mailing list Lasso [hidden email]
Official list archives available at http://www.lassotalk.com
To unsubscribe, E-mail to: <[hidden email]>
Send administrative queries to  <[hidden email]>
Reply | Threaded
Open this post in threaded view
|

Re: Authorize.net Accept Hosted Redirect Method

Carl Ketterling
Looks like you missed a single ' just after “— data”

Not sure where you were supposed to have ' and " , but I noticed you changed single to double when you moved from shell to Lasso.  I know you did this because you needed to use single quotes in Lasso.  Since I’m uncomfortable with quotes on the command line, I try to keep them the same … so I would test the curl command with double-quotes before putting that command in Lasso within single-quotes.

Carl


> On Feb 27, 2019, at 3:42 PM, Mike Ealy <[hidden email]> wrote:
>
> This works in terminal:
>
> curl -X POST https://apitest.authorize.net/xml/v1/request.api --header
> 'Content-Type: application/xml' --data '<getHostedPaymentPageRequest
> xmlns="AnetApi/xml/v1/schema/AnetApiSchema.xsd"><merchantAuthentication><nam
> e>SANDBOX_API_LOGIN_ID</name><transactionKey>SANDBOX_API_TRANSACTION_KEY</tr
> ansactionKey></merchantAuthentication><transactionRequest><transactionType>a
> uthCaptureTransaction</transactionType><amount>20.00</amount></transactionRe
> quest></getHostedPaymentPageRequest>'
>
> Result:
> <?xml version="1.0" encoding="utf-8"?><getHostedPaymentPageResponse
> xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
> xmlns:xsd="http://www.w3.org/2001/XMLSchema"
> xmlns="AnetApi/xml/v1/schema/AnetApiSchema.xsd"><messages><resultCode>Ok</re
> sultCode><message><code>I00001</code><text>Successful.</text></message></mes
> sages><token>y56C8lnp...U1Y4ZMgM4QnG</token></getHostedPaymentPageResponse>
>
>
> When I try to serve it in Lasso 8.5 I get an error.
>
> [shell('curl -X POST https://apitest.authorize.net/xml/v1/request.api \
>    --header "Content-Type: application/xml" \
>    --data ' + <getHostedPaymentPageRequest
> xmlns="AnetApi/xml/v1/schema/AnetApiSchema.xsd"><merchantAuthentication><nam
> e>SANDBOX_API_LOGIN_ID</name><transactionKey>SANDBOX_API_TRANSACTION_KEY</tr
> ansactionKey></merchantAuthentication><transactionRequest><transactionType>a
> uthCaptureTransaction</transactionType><amount>20.00</amount></transactionRe
> quest></getHostedPaymentPageRequest>')]
>
> Expected: a tag name but got: "shell('curl -X POST
> https://apitest.authorize.net/xml/v1/request.api --header "Content-Type:
> application/xml" --data ' + <get...
> at: Unterminated quoted literal on line 1 at position 1.
>
>
>
>
>
>> Ack.  I did not properly quote the header value.
>>
>>    shell('curl -X POST https://apitest.authorize.net/xml/v1/request.api \
>>            --header "Content-Type: application/xml" \
>>            --data ' + $xml_content)
>>
>>
>>    export xml="<my crazy long xml>"
>>    curl -X POST https://apitest.authorize.net/xml/v1/request.api \
>>            --header "Content-Type: application/xml" \
>>            --data $xml
>>
>> Also check for proper quoting of --data argument.
>>
>> --steve
>>
>>
>> On 2/27/19 at 12:01 PM, [hidden email] (Steve Piercy - Website Builder)
>> pronounced:
>>
>>> You have several mistakes with quote marks and the --header argument.  Try
>>> this:
>>>
>>>    shell("curl -X POST https://apitest.authorize.net/xml/v1/request.api \
>>>            --header Content-Type: application/xml \
>>>            --data " + $xml_content)
>>>
>>> Tip: try doing this from a terminal first to speed up development without
>>> Lasso getting in
>>> the way.
>>>
>>>    export xml="<my crazy long xml>"
>>>    curl -X POST https://apitest.authorize.net/xml/v1/request.api \
>>>            --header Content-Type: application/xml \
>>>            --data $xml
>>>
>>> --steve
>>>
>>>
>>> On 2/27/19 at 2:24 PM, [hidden email] (Mike Ealy) pronounced:
>>>
>>>> $ curl -X POST https://apitest.authorize.net/xml/v1/request.api --header
>>>> 'content-type: text/xml' --data '<xml><getHostedPaymentPageRequest
>>>> xmlns="AnetApi/xml/v1/schema/AnetApiSchema.xsd"><merchantAuthentication><nam
>>>> e>SANDBOX_API_LOGIN_ID</name><transactionKey>SANDBOX_API_TRANSACTION_KEY</tr
>>>> ansactionKey></merchantAuthentication><transactionRequest><transactionType>a
>>>> uthCaptureTransaction</transactionType><amount>20.00</amount></transactionRe
>>>> quest></getHostedPaymentPageRequest></xml>'
>>>>
>>>> Produces:
>>>> <?xml version="1.0" encoding="utf-8"?><ErrorResponse
>>>> xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
>>>> xmlns:xsd="http://www.w3.org/2001/XMLSchema"
>>>> xmlns="AnetApi/xml/v1/schema/AnetApiSchema.xsd"><messages><resultCode>Error<
>>>> /resultCode><message><code>E00004</code><text>The name of the requested API
>>>> method is invalid.</text></message></messages></ErrorResponse>
>>>>
>>>>
>>>> https://developer.authorize.net/api/reference/responseCodes.html?code=E00004
>>>>
>>>> Code: E00004
>>>> Explanation: The name of the requested API method is invalid.
>>>> Description: The name of the root node of the XML request is the API method
>>>> being called. It is not valid.
>>>>
>>>> I'll take a look at the syntax in your tag. Thanks, Steve.
>>>>
>>>> Mike
>>>>
>>>>
>>>>> What's the error code and message?
>>>>>
>>>>> A similar example that does work can be gleaned from my tag.
>>>>>
>>>>> https://github.com/stevepiercy/AuthorizeNet_AIM/blob/master/AuthorizeNet_AI
>>>>> M.i
>>>>> nc#L193
>>>>>
>>>>> --steve
>>>>>
>>>>>
>>>>> On 2/27/19 at 12:03 PM, [hidden email] (Mike Ealy) pronounced:
>>>>>
>>>>>> I'm working through the steps to move from Authorize.net SIM method to
>>>>>> Accept Hosted Redirect Method. I'm using Lasso 8.5 on MacOS 10.11.6.
>>>>>>
>>>>>> The first step is to request a Form Validation Token. I tried using
>>>>>> include_URL but it produces an Authorize error code saying the name of the
>>>>>> requested API method is invalid. This may be because TLS in not supported
>>>>>> by
>>>>>> include_URL.
>>>>>>
>>>>>> [Include_URL: 'https://apitest.authorize.net/xml/v1/request.api',
>>>>>> -POSTParams='<xml><getHostedPaymentPageRequest
>>>>>> xmlns="AnetApi/xml/v1/schema/AnetApiSchema.xsd">
>>>>>>    <merchantAuthentication>
>>>>>>        <name>SANDBOX_API_LOGIN_ID</name>
>>>>>>        <transactionKey>SANDBOX_API_TRANSACTION_KEY</transactionKey>
>>>>>>    </merchantAuthentication>
>>>>>>    <transactionRequest>
>>>>>>        <transactionType>authCaptureTransaction</transactionType>
>>>>>>        <amount>20.00</amount>
>>>>>>    </transactionRequest>
>>>>>> </getHostedPaymentPageRequest></xml>']
>>>>>>
>>>>>> Reading the archives it looks like using curl is a better option. I've
>>>>>> tried
>>>>>> this but I can't seem to get the syntax right.
>>>>>>
>>>>>> [shell('curl -X POST https://apitest.authorize.net/xml/v1/request.api
>>>>>> --header 'content-type: text/xml' --data '$xml_content')]
>>>>>>
>>>>>> How do I pass this xml into curl and submit it to
>>>>>> https://apitest.authorize.net/xml/v1/request.api?
>>>>>>
>>>>>> Thanks,
>>>>>> Mike Ealy
>>>>>>
>>>>>>
>>>>>>
>>>>>> #############################################################
>>>>>>
>>>>>> This message is sent to you because you are subscribed to
>>>>>>  the mailing list Lasso [hidden email]
>>>>>> Official list archives available at http://www.lassotalk.com
>>>>>> To unsubscribe, E-mail to: <[hidden email]>
>>>>>> Send administrative queries to  <[hidden email]>
>>>>>
>>>>> -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
>>>>> Steve Piercy              Website Builder              Eugene, OR
>>>>> <[hidden email]>               <http://www.stevepiercy.com/>
>>>>>
>>>>>
>>>>> #############################################################
>>>>>
>>>>> This message is sent to you because you are subscribed to
>>>>>  the mailing list Lasso [hidden email]
>>>>> Official list archives available at http://www.lassotalk.com
>>>>> To unsubscribe, E-mail to: <[hidden email]>
>>>>> Send administrative queries to  <[hidden email]>
>>>>
>>>>
>>>>
>>>> #############################################################
>>>>
>>>> This message is sent to you because you are subscribed to
>>>>  the mailing list Lasso [hidden email]
>>>> Official list archives available at http://www.lassotalk.com
>>>> To unsubscribe, E-mail to: <[hidden email]>
>>>> Send administrative queries to  <[hidden email]>
>>>
>>> -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
>>> Steve Piercy              Website Builder              Eugene, OR
>>> <[hidden email]>               <http://www.stevepiercy.com/>
>>>
>>>
>>> #############################################################
>>>
>>> This message is sent to you because you are subscribed to
>>>  the mailing list Lasso [hidden email]
>>> Official list archives available at http://www.lassotalk.com
>>> To unsubscribe, E-mail to: <[hidden email]>
>>> Send administrative queries to  <[hidden email]>
>>
>> -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
>> Steve Piercy              Website Builder              Eugene, OR
>> <[hidden email]>               <http://www.stevepiercy.com/>
>>
>>
>> #############################################################
>>
>> This message is sent to you because you are subscribed to
>>  the mailing list Lasso [hidden email]
>> Official list archives available at http://www.lassotalk.com
>> To unsubscribe, E-mail to: <[hidden email]>
>> Send administrative queries to  <[hidden email]>
>
>
>
> #############################################################
>
> This message is sent to you because you are subscribed to
>  the mailing list Lasso [hidden email]
> Official list archives available at http://www.lassotalk.com
> To unsubscribe, E-mail to: <[hidden email]>
> Send administrative queries to  <[hidden email]>


#############################################################

This message is sent to you because you are subscribed to
  the mailing list Lasso [hidden email]
Official list archives available at http://www.lassotalk.com
To unsubscribe, E-mail to: <[hidden email]>
Send administrative queries to  <[hidden email]>
Reply | Threaded
Open this post in threaded view
|

Re: Authorize.net Accept Hosted Redirect Method

stevepiercy
In reply to this post by Mike Ealy-2
The error message is pretty helpful.

> Unterminated quoted literal on line 1 at position 1.

Try this:

[
    local('myxml') = '<getHostedPaymentPageRequest
    xmlns="AnetApi/xml/v1/schema/AnetApiSchema.xsd"><merchantAuthentication><nam
    e>SANDBOX_API_LOGIN_ID</name><transactionKey>SANDBOX_API_TRANSACTION_KEY</tr
    ansactionKey></merchantAuthentication><transactionRequest><transactionType>a
    uthCaptureTransaction</transactionType><amount>20.00</amount></transactionRe
    quest></getHostedPaymentPageRequest>';

    shell('curl -X POST https://apitest.authorize.net/xml/v1/request.api \
        --header "Content-Type: application/xml" \
        --data ' + #myxml);
]

--steve


On 2/27/19 at 4:42 PM, [hidden email] (Mike Ealy) pronounced:

> This works in terminal:
>
> curl -X POST https://apitest.authorize.net/xml/v1/request.api --header
> 'Content-Type: application/xml' --data '<getHostedPaymentPageRequest
> xmlns="AnetApi/xml/v1/schema/AnetApiSchema.xsd"><merchantAuthentication><nam
> e>SANDBOX_API_LOGIN_ID</name><transactionKey>SANDBOX_API_TRANSACTION_KEY</tr
> ansactionKey></merchantAuthentication><transactionRequest><transactionType>a
> uthCaptureTransaction</transactionType><amount>20.00</amount></transactionRe
> quest></getHostedPaymentPageRequest>'
>
> Result:
> <?xml version="1.0" encoding="utf-8"?><getHostedPaymentPageResponse
> xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
> xmlns:xsd="http://www.w3.org/2001/XMLSchema"
> xmlns="AnetApi/xml/v1/schema/AnetApiSchema.xsd"><messages><resultCode>Ok</re
> sultCode><message><code>I00001</code><text>Successful.</text></message></mes
> sages><token>y56C8lnp...U1Y4ZMgM4QnG</token></getHostedPaymentPageResponse>
>
>
> When I try to serve it in Lasso 8.5 I get an error.
>
> [shell('curl -X POST https://apitest.authorize.net/xml/v1/request.api \
>     --header "Content-Type: application/xml" \
>     --data ' + <getHostedPaymentPageRequest
> xmlns="AnetApi/xml/v1/schema/AnetApiSchema.xsd"><merchantAuthentication><nam
> e>SANDBOX_API_LOGIN_ID</name><transactionKey>SANDBOX_API_TRANSACTION_KEY</tr
> ansactionKey></merchantAuthentication><transactionRequest><transactionType>a
> uthCaptureTransaction</transactionType><amount>20.00</amount></transactionRe
> quest></getHostedPaymentPageRequest>')]
>
> Expected: a tag name but got: "shell('curl -X POST
> https://apitest.authorize.net/xml/v1/request.api --header "Content-Type:
> application/xml" --data ' + <get...
> at: Unterminated quoted literal on line 1 at position 1.
>
>
>
>
>
> > Ack.  I did not properly quote the header value.
> >
> >     shell('curl -X POST https://apitest.authorize.net/xml/v1/request.api \
> >             --header "Content-Type: application/xml" \
> >             --data ' + $xml_content)
> >
> >
> >     export xml="<my crazy long xml>"
> >     curl -X POST https://apitest.authorize.net/xml/v1/request.api \
> >             --header "Content-Type: application/xml" \
> >             --data $xml
> >
> > Also check for proper quoting of --data argument.
> >
> > --steve
> >
> >
> > On 2/27/19 at 12:01 PM, [hidden email] (Steve Piercy - Website Builder)
> > pronounced:
> >
> >> You have several mistakes with quote marks and the --header argument.  Try
> >> this:
> >>
> >>     shell("curl -X POST https://apitest.authorize.net/xml/v1/request.api \
> >>             --header Content-Type: application/xml \
> >>             --data " + $xml_content)
> >>
> >> Tip: try doing this from a terminal first to speed up development without
> >> Lasso getting in
> >> the way.
> >>
> >>     export xml="<my crazy long xml>"
> >>     curl -X POST https://apitest.authorize.net/xml/v1/request.api \
> >>             --header Content-Type: application/xml \
> >>             --data $xml
> >>
> >> --steve
> >>
> >>
> >> On 2/27/19 at 2:24 PM, [hidden email] (Mike Ealy) pronounced:
> >>
> >>> $ curl -X POST https://apitest.authorize.net/xml/v1/request.api --header
> >>> 'content-type: text/xml' --data '<xml><getHostedPaymentPageRequest
> >>> xmlns="AnetApi/xml/v1/schema/AnetApiSchema.xsd"><merchantAuthentication><nam
> >>> e>SANDBOX_API_LOGIN_ID</name><transactionKey>SANDBOX_API_TRANSACTION_KEY</tr
> >>> ansactionKey></merchantAuthentication><transactionRequest><transactionType>a
> >>> uthCaptureTransaction</transactionType><amount>20.00</amount></transactionRe
> >>> quest></getHostedPaymentPageRequest></xml>'
> >>>
> >>> Produces:
> >>> <?xml version="1.0" encoding="utf-8"?><ErrorResponse
> >>> xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
> >>> xmlns:xsd="http://www.w3.org/2001/XMLSchema"
> >>> xmlns="AnetApi/xml/v1/schema/AnetApiSchema.xsd"><messages><resultCode>Error<
> >>> /resultCode><message><code>E00004</code><text>The name of the requested API
> >>> method is invalid.</text></message></messages></ErrorResponse>
> >>>
> >>>  
> >>> https://developer.authorize.net/api/reference/responseCodes.html?code=E00004
> >>>
> >>> Code: E00004
> >>> Explanation: The name of the requested API method is invalid.
> >>> Description: The name of the root node of the XML request is the API method
> >>> being called. It is not valid.
> >>>  
> >>> I'll take a look at the syntax in your tag. Thanks, Steve.
> >>>
> >>> Mike
> >>>
> >>>
> >>>> What's the error code and message?
> >>>>
> >>>> A similar example that does work can be gleaned from my tag.
> >>>>
> >>>> https://github.com/stevepiercy/AuthorizeNet_AIM/blob/master/AuthorizeNet_AI
> >>>> M.i
> >>>> nc#L193
> >>>>
> >>>> --steve
> >>>>
> >>>>
> >>>> On 2/27/19 at 12:03 PM, [hidden email] (Mike Ealy) pronounced:
> >>>>
> >>>>> I'm working through the steps to move from Authorize.net SIM method to
> >>>>> Accept Hosted Redirect Method. I'm using Lasso 8.5 on MacOS 10.11.6.
> >>>>>
> >>>>> The first step is to request a Form Validation Token. I tried using
> >>>>> include_URL but it produces an Authorize error code saying the name of the
> >>>>> requested API method is invalid. This may be because TLS in not supported
> >>>>> by
> >>>>> include_URL.
> >>>>>
> >>>>> [Include_URL: 'https://apitest.authorize.net/xml/v1/request.api',
> >>>>> -POSTParams='<xml><getHostedPaymentPageRequest
> >>>>> xmlns="AnetApi/xml/v1/schema/AnetApiSchema.xsd">
> >>>>>     <merchantAuthentication>
> >>>>>         <name>SANDBOX_API_LOGIN_ID</name>
> >>>>>         <transactionKey>SANDBOX_API_TRANSACTION_KEY</transactionKey>
> >>>>>     </merchantAuthentication>
> >>>>>     <transactionRequest>
> >>>>>         <transactionType>authCaptureTransaction</transactionType>
> >>>>>         <amount>20.00</amount>
> >>>>>     </transactionRequest>
> >>>>> </getHostedPaymentPageRequest></xml>']
> >>>>>
> >>>>> Reading the archives it looks like using curl is a better option. I've
> >>>>> tried
> >>>>> this but I can't seem to get the syntax right.
> >>>>>
> >>>>> [shell('curl -X POST https://apitest.authorize.net/xml/v1/request.api
> >>>>> --header 'content-type: text/xml' --data '$xml_content')]
> >>>>>
> >>>>> How do I pass this xml into curl and submit it to
> >>>>> https://apitest.authorize.net/xml/v1/request.api?
> >>>>>
> >>>>> Thanks,
> >>>>> Mike Ealy
> >>>>>
> >>>>>
> >>>>>
> >>>>> #############################################################
> >>>>>
> >>>>> This message is sent to you because you are subscribed to
> >>>>>   the mailing list Lasso [hidden email]
> >>>>> Official list archives available at http://www.lassotalk.com
> >>>>> To unsubscribe, E-mail to: <[hidden email]>
> >>>>> Send administrative queries to  <[hidden email]>
> >>>>
> >>>> -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
> >>>> Steve Piercy              Website Builder              Eugene, OR
> >>>> <[hidden email]>               <http://www.stevepiercy.com/>
> >>>>
> >>>>
> >>>> #############################################################
> >>>>
> >>>> This message is sent to you because you are subscribed to
> >>>>   the mailing list Lasso [hidden email]
> >>>> Official list archives available at http://www.lassotalk.com
> >>>> To unsubscribe, E-mail to: <[hidden email]>
> >>>> Send administrative queries to  <[hidden email]>
> >>>
> >>>
> >>>
> >>> #############################################################
> >>>
> >>> This message is sent to you because you are subscribed to
> >>>   the mailing list Lasso [hidden email]
> >>> Official list archives available at http://www.lassotalk.com
> >>> To unsubscribe, E-mail to: <[hidden email]>
> >>> Send administrative queries to  <[hidden email]>
> >>
> >> -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
> >> Steve Piercy              Website Builder              Eugene, OR
> >> <[hidden email]>               <http://www.stevepiercy.com/>
> >>
> >>
> >> #############################################################
> >>
> >> This message is sent to you because you are subscribed to
> >>   the mailing list Lasso [hidden email]
> >> Official list archives available at http://www.lassotalk.com
> >> To unsubscribe, E-mail to: <[hidden email]>
> >> Send administrative queries to  <[hidden email]>
> >
> > -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
> > Steve Piercy              Website Builder              Eugene, OR
> > <[hidden email]>               <http://www.stevepiercy.com/>
> >
> >
> > #############################################################
> >
> > This message is sent to you because you are subscribed to
> >   the mailing list Lasso [hidden email]
> > Official list archives available at http://www.lassotalk.com
> > To unsubscribe, E-mail to: <[hidden email]>
> > Send administrative queries to  <[hidden email]>
>
>
>
> #############################################################
>
> This message is sent to you because you are subscribed to
>   the mailing list Lasso [hidden email]
> Official list archives available at http://www.lassotalk.com
> To unsubscribe, E-mail to: <[hidden email]>
> Send administrative queries to  <[hidden email]>

-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
Steve Piercy              Website Builder              Eugene, OR
<[hidden email]>               <http://www.stevepiercy.com/>


#############################################################

This message is sent to you because you are subscribed to
  the mailing list Lasso [hidden email]
Official list archives available at http://www.lassotalk.com
To unsubscribe, E-mail to: <[hidden email]>
Send administrative queries to  <[hidden email]>
Reply | Threaded
Open this post in threaded view
|

Re: Authorize.net Accept Hosted Redirect Method

Mike Ealy-2
This:
[
    local('myxml') = '<getHostedPaymentPageRequest
xmlns="AnetApi/xml/v1/schema/AnetApiSchema.xsd"><merchantAuthentication><nam
e>SANDBOX_API_LOGIN_ID</name><transactionKey>SANDBOX_API_TRANSACTION_KEY</tr
ansactionKey></merchantAuthentication><transactionRequest><transactionType>a
uthCaptureTransaction</transactionType><amount>20.00</amount></transactionRe
quest></getHostedPaymentPageRequest>';
   
    shell('curl -X POST https://apitest.authorize.net/xml/v1/request.api \
        --header "Content-Type: application/xml" \
        --data ' + #myxml);
]

Returns this:
/bin/bash: -c: line 0: syntax error near unexpected token `<' /bin/bash: -c:
line 0: `cd ///Library/.../pathToFile/; curl -X POST
https://apitest.authorize.net/xml/v1/request.api --header "Content-Type:
application/xml" --data <getHostedPaymentPageRequest
xmlns="AnetApi/xml/v1/schema/AnetApiSchema.xsd"><merchantAuthentication><nam
e>SANDBOX_API_LOGIN_ID</name><transactionKey>SANDBOX_API_TRANSACTION_KEY</tr
ansactionKey></merchantAuthentication><transactionRequest><transactionType>a
uthCaptureTransaction</transactionType><amount>20.00</amount></transactionRe
quest></getHostedPaymentPageRequest>'



> The error message is pretty helpful.
>
>> Unterminated quoted literal on line 1 at position 1.
>
> Try this:
>
> [
>     local('myxml') = '<getHostedPaymentPageRequest
>    
> xmlns="AnetApi/xml/v1/schema/AnetApiSchema.xsd"><merchantAuthentication><nam
>    
> e>SANDBOX_API_LOGIN_ID</name><transactionKey>SANDBOX_API_TRANSACTION_KEY</tr
>    
> ansactionKey></merchantAuthentication><transactionRequest><transactionType>a
>    
> uthCaptureTransaction</transactionType><amount>20.00</amount></transactionRe
>     quest></getHostedPaymentPageRequest>';
>
>     shell('curl -X POST https://apitest.authorize.net/xml/v1/request.api \
>         --header "Content-Type: application/xml" \
>         --data ' + #myxml);
> ]
>
> --steve
>
>
> On 2/27/19 at 4:42 PM, [hidden email] (Mike Ealy) pronounced:
>
>> This works in terminal:
>>
>> curl -X POST https://apitest.authorize.net/xml/v1/request.api --header
>> 'Content-Type: application/xml' --data '<getHostedPaymentPageRequest
>> xmlns="AnetApi/xml/v1/schema/AnetApiSchema.xsd"><merchantAuthentication><nam
>> e>SANDBOX_API_LOGIN_ID</name><transactionKey>SANDBOX_API_TRANSACTION_KEY</tr
>> ansactionKey></merchantAuthentication><transactionRequest><transactionType>a
>> uthCaptureTransaction</transactionType><amount>20.00</amount></transactionRe
>> quest></getHostedPaymentPageRequest>'
>>
>> Result:
>> <?xml version="1.0" encoding="utf-8"?><getHostedPaymentPageResponse
>> xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
>> xmlns:xsd="http://www.w3.org/2001/XMLSchema"
>> xmlns="AnetApi/xml/v1/schema/AnetApiSchema.xsd"><messages><resultCode>Ok</re
>> sultCode><message><code>I00001</code><text>Successful.</text></message></mes
>> sages><token>y56C8lnp...U1Y4ZMgM4QnG</token></getHostedPaymentPageResponse>
>>
>>
>> When I try to serve it in Lasso 8.5 I get an error.
>>
>> [shell('curl -X POST https://apitest.authorize.net/xml/v1/request.api \
>>     --header "Content-Type: application/xml" \
>>     --data ' + <getHostedPaymentPageRequest
>> xmlns="AnetApi/xml/v1/schema/AnetApiSchema.xsd"><merchantAuthentication><nam
>> e>SANDBOX_API_LOGIN_ID</name><transactionKey>SANDBOX_API_TRANSACTION_KEY</tr
>> ansactionKey></merchantAuthentication><transactionRequest><transactionType>a
>> uthCaptureTransaction</transactionType><amount>20.00</amount></transactionRe
>> quest></getHostedPaymentPageRequest>')]
>>
>> Expected: a tag name but got: "shell('curl -X POST
>> https://apitest.authorize.net/xml/v1/request.api --header "Content-Type:
>> application/xml" --data ' + <get...
>> at: Unterminated quoted literal on line 1 at position 1.
>>
>>
>>
>>
>>
>>> Ack.  I did not properly quote the header value.
>>>
>>>     shell('curl -X POST https://apitest.authorize.net/xml/v1/request.api \
>>>             --header "Content-Type: application/xml" \
>>>             --data ' + $xml_content)
>>>
>>>
>>>     export xml="<my crazy long xml>"
>>>     curl -X POST https://apitest.authorize.net/xml/v1/request.api \
>>>             --header "Content-Type: application/xml" \
>>>             --data $xml
>>>
>>> Also check for proper quoting of --data argument.
>>>
>>> --steve
>>>
>>>
>>> On 2/27/19 at 12:01 PM, [hidden email] (Steve Piercy - Website Builder)
>>> pronounced:
>>>
>>>> You have several mistakes with quote marks and the --header argument.  Try
>>>> this:
>>>>
>>>>     shell("curl -X POST https://apitest.authorize.net/xml/v1/request.api \
>>>>             --header Content-Type: application/xml \
>>>>             --data " + $xml_content)
>>>>
>>>> Tip: try doing this from a terminal first to speed up development without
>>>> Lasso getting in
>>>> the way.
>>>>
>>>>     export xml="<my crazy long xml>"
>>>>     curl -X POST https://apitest.authorize.net/xml/v1/request.api \
>>>>             --header Content-Type: application/xml \
>>>>             --data $xml
>>>>
>>>> --steve
>>>>
>>>>
>>>> On 2/27/19 at 2:24 PM, [hidden email] (Mike Ealy) pronounced:
>>>>
>>>>> $ curl -X POST https://apitest.authorize.net/xml/v1/request.api --header
>>>>> 'content-type: text/xml' --data '<xml><getHostedPaymentPageRequest
>>>>> xmlns="AnetApi/xml/v1/schema/AnetApiSchema.xsd"><merchantAuthentication><n
>>>>> am
>>>>> e>SANDBOX_API_LOGIN_ID</name><transactionKey>SANDBOX_API_TRANSACTION_KEY</
>>>>> tr
>>>>> ansactionKey></merchantAuthentication><transactionRequest><transactionType
>>>>> >a
>>>>> uthCaptureTransaction</transactionType><amount>20.00</amount></transaction
>>>>> Re
>>>>> quest></getHostedPaymentPageRequest></xml>'
>>>>>
>>>>> Produces:
>>>>> <?xml version="1.0" encoding="utf-8"?><ErrorResponse
>>>>> xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
>>>>> xmlns:xsd="http://www.w3.org/2001/XMLSchema"
>>>>> xmlns="AnetApi/xml/v1/schema/AnetApiSchema.xsd"><messages><resultCode>Erro
>>>>> r<
>>>>> /resultCode><message><code>E00004</code><text>The name of the requested
>>>>> API
>>>>> method is invalid.</text></message></messages></ErrorResponse>
>>>>>
>>>>>  
>>>>> https://developer.authorize.net/api/reference/responseCodes.html?code=E000
>>>>> 04
>>>>>
>>>>> Code: E00004
>>>>> Explanation: The name of the requested API method is invalid.
>>>>> Description: The name of the root node of the XML request is the API
>>>>> method
>>>>> being called. It is not valid.
>>>>>  
>>>>> I'll take a look at the syntax in your tag. Thanks, Steve.
>>>>>
>>>>> Mike
>>>>>
>>>>>
>>>>>> What's the error code and message?
>>>>>>
>>>>>> A similar example that does work can be gleaned from my tag.
>>>>>>
>>>>>> https://github.com/stevepiercy/AuthorizeNet_AIM/blob/master/AuthorizeNet_
>>>>>> AI
>>>>>> M.i
>>>>>> nc#L193
>>>>>>
>>>>>> --steve
>>>>>>
>>>>>>
>>>>>> On 2/27/19 at 12:03 PM, [hidden email] (Mike Ealy) pronounced:
>>>>>>
>>>>>>> I'm working through the steps to move from Authorize.net SIM method to
>>>>>>> Accept Hosted Redirect Method. I'm using Lasso 8.5 on MacOS 10.11.6.
>>>>>>>
>>>>>>> The first step is to request a Form Validation Token. I tried using
>>>>>>> include_URL but it produces an Authorize error code saying the name of
>>>>>>> the
>>>>>>> requested API method is invalid. This may be because TLS in not
>>>>>>> supported
>>>>>>> by
>>>>>>> include_URL.
>>>>>>>
>>>>>>> [Include_URL: 'https://apitest.authorize.net/xml/v1/request.api',
>>>>>>> -POSTParams='<xml><getHostedPaymentPageRequest
>>>>>>> xmlns="AnetApi/xml/v1/schema/AnetApiSchema.xsd">
>>>>>>>     <merchantAuthentication>
>>>>>>>         <name>SANDBOX_API_LOGIN_ID</name>
>>>>>>>         <transactionKey>SANDBOX_API_TRANSACTION_KEY</transactionKey>
>>>>>>>     </merchantAuthentication>
>>>>>>>     <transactionRequest>
>>>>>>>         <transactionType>authCaptureTransaction</transactionType>
>>>>>>>         <amount>20.00</amount>
>>>>>>>     </transactionRequest>
>>>>>>> </getHostedPaymentPageRequest></xml>']
>>>>>>>
>>>>>>> Reading the archives it looks like using curl is a better option. I've
>>>>>>> tried
>>>>>>> this but I can't seem to get the syntax right.
>>>>>>>
>>>>>>> [shell('curl -X POST https://apitest.authorize.net/xml/v1/request.api
>>>>>>> --header 'content-type: text/xml' --data '$xml_content')]
>>>>>>>
>>>>>>> How do I pass this xml into curl and submit it to
>>>>>>> https://apitest.authorize.net/xml/v1/request.api?
>>>>>>>
>>>>>>> Thanks,
>>>>>>> Mike Ealy
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>> #############################################################
>>>>>>>
>>>>>>> This message is sent to you because you are subscribed to
>>>>>>>   the mailing list Lasso [hidden email]
>>>>>>> Official list archives available at http://www.lassotalk.com
>>>>>>> To unsubscribe, E-mail to: <[hidden email]>
>>>>>>> Send administrative queries to  <[hidden email]>
>>>>>>
>>>>>> -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
>>>>>> Steve Piercy              Website Builder              Eugene, OR
>>>>>> <[hidden email]>               <http://www.stevepiercy.com/>
>>>>>>
>>>>>>
>>>>>> #############################################################
>>>>>>
>>>>>> This message is sent to you because you are subscribed to
>>>>>>   the mailing list Lasso [hidden email]
>>>>>> Official list archives available at http://www.lassotalk.com
>>>>>> To unsubscribe, E-mail to: <[hidden email]>
>>>>>> Send administrative queries to  <[hidden email]>
>>>>>
>>>>>
>>>>>
>>>>> #############################################################
>>>>>
>>>>> This message is sent to you because you are subscribed to
>>>>>   the mailing list Lasso [hidden email]
>>>>> Official list archives available at http://www.lassotalk.com
>>>>> To unsubscribe, E-mail to: <[hidden email]>
>>>>> Send administrative queries to  <[hidden email]>
>>>>
>>>> -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
>>>> Steve Piercy              Website Builder              Eugene, OR
>>>> <[hidden email]>               <http://www.stevepiercy.com/>
>>>>
>>>>
>>>> #############################################################
>>>>
>>>> This message is sent to you because you are subscribed to
>>>>   the mailing list Lasso [hidden email]
>>>> Official list archives available at http://www.lassotalk.com
>>>> To unsubscribe, E-mail to: <[hidden email]>
>>>> Send administrative queries to  <[hidden email]>
>>>
>>> -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
>>> Steve Piercy              Website Builder              Eugene, OR
>>> <[hidden email]>               <http://www.stevepiercy.com/>
>>>
>>>
>>> #############################################################
>>>
>>> This message is sent to you because you are subscribed to
>>>   the mailing list Lasso [hidden email]
>>> Official list archives available at http://www.lassotalk.com
>>> To unsubscribe, E-mail to: <[hidden email]>
>>> Send administrative queries to  <[hidden email]>
>>
>>
>>
>> #############################################################
>>
>> This message is sent to you because you are subscribed to
>>   the mailing list Lasso [hidden email]
>> Official list archives available at http://www.lassotalk.com
>> To unsubscribe, E-mail to: <[hidden email]>
>> Send administrative queries to  <[hidden email]>
>
> -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
> Steve Piercy              Website Builder              Eugene, OR
> <[hidden email]>               <http://www.stevepiercy.com/>
>
>
> #############################################################
>
> This message is sent to you because you are subscribed to
>   the mailing list Lasso [hidden email]
> Official list archives available at http://www.lassotalk.com
> To unsubscribe, E-mail to: <[hidden email]>
> Send administrative queries to  <[hidden email]>



#############################################################

This message is sent to you because you are subscribed to
  the mailing list Lasso [hidden email]
Official list archives available at http://www.lassotalk.com
To unsubscribe, E-mail to: <[hidden email]>
Send administrative queries to  <[hidden email]>
Reply | Threaded
Open this post in threaded view
|

Re: Authorize.net Accept Hosted Redirect Method

stevepiercy
The error message almost always gives you a good hint.

>/bin/bash: -c: line 0: syntax error near unexpected token `<' /bin/bash: -c:

As I remarked earlier:

>>> Also check for proper quoting of --data argument.

Try this.

>--data "' + #myxml + '"');

Else just fiddle around with the quote marks until you get it
right and always check the error messages.

--steve


On 2/28/19 at 6:40 AM, [hidden email] (Mike Ealy) pronounced:

>This:
>[
>local('myxml') = '<getHostedPaymentPageRequest
>xmlns="AnetApi/xml/v1/schema/AnetApiSchema.xsd"><merchantAuthentication><nam
>e>SANDBOX_API_LOGIN_ID</name><transactionKey>SANDBOX_API_TRANSACTION_KEY</tr
>ansactionKey></merchantAuthentication><transactionRequest><transactionType>a
>uthCaptureTransaction</transactionType><amount>20.00</amount></transactionRe
>quest></getHostedPaymentPageRequest>';
>
>shell('curl -X POST https://apitest.authorize.net/xml/v1/request.api \
>--header "Content-Type: application/xml" \
>--data ' + #myxml);
>]
>
>Returns this:
>/bin/bash: -c: line 0: syntax error near unexpected token `<' /bin/bash: -c:
>line 0: `cd ///Library/.../pathToFile/; curl -X POST
>https://apitest.authorize.net/xml/v1/request.api --header "Content-Type:
>application/xml" --data <getHostedPaymentPageRequest
>xmlns="AnetApi/xml/v1/schema/AnetApiSchema.xsd"><merchantAuthentication><nam
>e>SANDBOX_API_LOGIN_ID</name><transactionKey>SANDBOX_API_TRANSACTION_KEY</tr
>ansactionKey></merchantAuthentication><transactionRequest><transactionType>a
>uthCaptureTransaction</transactionType><amount>20.00</amount></transactionRe
>quest></getHostedPaymentPageRequest>'
>
>
>
>>The error message is pretty helpful.
>>
>>> Unterminated quoted literal on line 1 at position 1.
>>
>>Try this:
>>
>>[
>>local('myxml') = '<getHostedPaymentPageRequest
>>
>>xmlns="AnetApi/xml/v1/schema/AnetApiSchema.xsd"><merchantAuthentication><nam
>>
>>e>SANDBOX_API_LOGIN_ID</name><transactionKey>SANDBOX_API_TRANSACTION_KEY</tr
>>
>>ansactionKey></merchantAuthentication><transactionRequest><transactionType>a
>>
>>uthCaptureTransaction</transactionType><amount>20.00</amount></transactionRe
>>quest></getHostedPaymentPageRequest>';
>>
>>shell('curl -X POST https://apitest.authorize.net/xml/v1/request.api \
>>--header "Content-Type: application/xml" \
>>--data ' + #myxml);
>>]
>>
>>--steve
>>
>>
>>On 2/27/19 at 4:42 PM, [hidden email] (Mike Ealy) pronounced:
>>
>>> This works in terminal:
>>>   curl -X POST
>>>https://apitest.authorize.net/xml/v1/request.api --header
>>> 'Content-Type: application/xml' --data '<getHostedPaymentPageRequest
>>> xmlns="AnetApi/xml/v1/schema/AnetApiSchema.xsd"><merchantAuthentication><nam
>>> e>SANDBOX_API_LOGIN_ID</name><transactionKey>SANDBOX_API_TRANSACTION_KEY</tr
>>> ansactionKey></merchantAuthentication><transactionRequest><transactionType>a
>>> uthCaptureTransaction</transactionType><amount>20.00</amount></transactionRe
>>> quest></getHostedPaymentPageRequest>'
>>>   Result:
>>> <?xml version="1.0" encoding="utf-8"?><getHostedPaymentPageResponse
>>> xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
>>> xmlns:xsd="http://www.w3.org/2001/XMLSchema"
>>> xmlns="AnetApi/xml/v1/schema/AnetApiSchema.xsd"><messages><resultCode>Ok</re
>>> sultCode><message><code>I00001</code><text>Successful.</text></message></mes
>>> sages><token>y56C8lnp...U1Y4ZMgM4QnG</token></getHostedPaymentPageResponse>
>>>    When I try to serve it in Lasso 8.5 I get an error.
>>>   [shell('curl -X POST
>>>https://apitest.authorize.net/xml/v1/request.api \
>>>     --header "Content-Type: application/xml" \
>>>     --data ' + <getHostedPaymentPageRequest
>>> xmlns="AnetApi/xml/v1/schema/AnetApiSchema.xsd"><merchantAuthentication><nam
>>> e>SANDBOX_API_LOGIN_ID</name><transactionKey>SANDBOX_API_TRANSACTION_KEY</tr
>>> ansactionKey></merchantAuthentication><transactionRequest><transactionType>a
>>> uthCaptureTransaction</transactionType><amount>20.00</amount></transactionRe
>>> quest></getHostedPaymentPageRequest>')]
>>>   Expected: a tag name but got: "shell('curl -X POST
>>> https://apitest.authorize.net/xml/v1/request.api --header "Content-Type:
>>> application/xml" --data ' + <get...
>>> at: Unterminated quoted literal on line 1 at position 1.
>>>    
>>>> Ack.  I did not properly quote the header value.
>>>>       shell('curl -X POST
>>>>https://apitest.authorize.net/xml/v1/request.api \
>>>>             --header "Content-Type: application/xml" \
>>>>             --data ' + $xml_content)
>>>>        export xml="<my crazy long xml>"
>>>>     curl -X POST https://apitest.authorize.net/xml/v1/request.api \
>>>>             --header "Content-Type: application/xml" \
>>>>             --data $xml
>>>>   Also check for proper quoting of --data argument.
>>>>   --steve
>>>>    On 2/27/19 at 12:01 PM, [hidden email] (Steve
>>>>Piercy - Website Builder)
>>>> pronounced:
>>>>
>>>>> You have several mistakes with quote marks and the --header argument.  Try
>>>>> this:
>>>>>       shell("curl -X POST
>>>>>https://apitest.authorize.net/xml/v1/request.api \
>>>>>             --header Content-Type: application/xml \
>>>>>             --data " + $xml_content)
>>>>>   Tip: try doing this from a terminal first to speed up
>>>>>development without
>>>>> Lasso getting in
>>>>> the way.
>>>>>       export xml="<my crazy long xml>"
>>>>>     curl -X POST https://apitest.authorize.net/xml/v1/request.api \
>>>>>             --header Content-Type: application/xml \
>>>>>             --data $xml
>>>>>   --steve
>>>>>    On 2/27/19 at 2:24 PM, [hidden email] (Mike
>>>>>Ealy) pronounced:
>>>>>
>>>>>> $ curl -X POST https://apitest.authorize.net/xml/v1/request.api --header
>>>>>> 'content-type: text/xml' --data '<xml><getHostedPaymentPageRequest
>>>>>> xmlns="AnetApi/xml/v1/schema/AnetApiSchema.xsd"><merchantAuthentication><n
>>>>>> am
>>>>>> e>SANDBOX_API_LOGIN_ID</name><transactionKey>SANDBOX_API_TRANSACTION_KEY</
>>>>>> tr
>>>>>> ansactionKey></merchantAuthentication><transactionRequest><transactionType
>>>>>> >a
>>>>>> uthCaptureTransaction</transactionType><amount>20.00</amount></transaction
>>>>>> Re
>>>>>> quest></getHostedPaymentPageRequest></xml>'
>>>>>>   Produces:
>>>>>> <?xml version="1.0" encoding="utf-8"?><ErrorResponse
>>>>>> xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
>>>>>> xmlns:xsd="http://www.w3.org/2001/XMLSchema"
>>>>>> xmlns="AnetApi/xml/v1/schema/AnetApiSchema.xsd"><messages><resultCode>Erro
>>>>>> r<
>>>>>> /resultCode><message><code>E00004</code><text>The name of the requested
>>>>>> API
>>>>>> method is invalid.</text></message></messages></ErrorResponse>
>>>>>>     https://developer.authorize.net/api/reference/responseCodes.html?code=E000
>>>>>> 04
>>>>>>   Code: E00004  Explanation: The name of the requested
>>>>>>API method is invalid.
>>>>>> Description: The name of the root node of the XML request is the API
>>>>>> method
>>>>>> being called. It is not valid.
>>>>>>    I'll take a look at the syntax in your tag. Thanks, Steve.
>>>>>>   Mike
>>>>>>  
>>>>>>> What's the error code and message?
>>>>>>>   A similar example that does work can be gleaned from
>>>>>>>my tag.
>>>>>>>   https://github.com/stevepiercy/AuthorizeNet_AIM/blob/master/AuthorizeNet_
>>>>>>> AI
>>>>>>> M.i
>>>>>>> nc#L193
>>>>>>>   --steve
>>>>>>>    On 2/27/19 at 12:03 PM, [hidden email]
>>>>>>>(Mike Ealy) pronounced:
>>>>>>>
>>>>>>>> I'm working through the steps to move from Authorize.net SIM method to
>>>>>>>> Accept Hosted Redirect Method. I'm using Lasso 8.5 on MacOS 10.11.6.
>>>>>>>>   The first step is to request a Form Validation Token.
>>>>>>>>I tried using
>>>>>>>> include_URL but it produces an Authorize error code saying the name of
>>>>>>>> the
>>>>>>>> requested API method is invalid. This may be because TLS in not
>>>>>>>> supported
>>>>>>>> by
>>>>>>>> include_URL.
>>>>>>>>   [Include_URL: 'https://apitest.authorize.net/xml/v1/request.api',
>>>>>>>> -POSTParams='<xml><getHostedPaymentPageRequest
>>>>>>>> xmlns="AnetApi/xml/v1/schema/AnetApiSchema.xsd">
>>>>>>>>     <merchantAuthentication>
>>>>>>>>         <name>SANDBOX_API_LOGIN_ID</name>
>>>>>>>>         <transactionKey>SANDBOX_API_TRANSACTION_KEY</transactionKey>
>>>>>>>>     </merchantAuthentication>
>>>>>>>>     <transactionRequest>
>>>>>>>>         <transactionType>authCaptureTransaction</transactionType>
>>>>>>>>         <amount>20.00</amount>
>>>>>>>>     </transactionRequest>
>>>>>>>> </getHostedPaymentPageRequest></xml>']
>>>>>>>>   Reading the archives it looks like using curl is a
>>>>>>>>better option. I've
>>>>>>>> tried
>>>>>>>> this but I can't seem to get the syntax right.
>>>>>>>>   [shell('curl -X POST https://apitest.authorize.net/xml/v1/request.api
>>>>>>>> --header 'content-type: text/xml' --data '$xml_content')]
>>>>>>>>   How do I pass this xml into curl and submit it to
>>>>>>>> https://apitest.authorize.net/xml/v1/request.api?
>>>>>>>>   Thanks,
>>>>>>>> Mike Ealy
>>>>>>>>     #############################################################
>>>>>>>>   This message is sent to you because you are
>>>>>>>>subscribed to
>>>>>>>>   the mailing list Lasso [hidden email]
>>>>>>>> Official list archives available at http://www.lassotalk.com
>>>>>>>> To unsubscribe, E-mail to: <[hidden email]>
>>>>>>>> Send administrative queries to  <[hidden email]>
>>>>>>>   -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
>>>>>>>-- -- -- --
>>>>>>> Steve Piercy              Website Builder              Eugene, OR
>>>>>>> <[hidden email]>               <http://www.stevepiercy.com/>
>>>>>>>    #############################################################
>>>>>>>   This message is sent to you because you are subscribed to
>>>>>>>   the mailing list Lasso [hidden email]
>>>>>>> Official list archives available at http://www.lassotalk.com
>>>>>>> To unsubscribe, E-mail to: <[hidden email]>
>>>>>>> Send administrative queries to  <[hidden email]>
>>>>>>     #############################################################
>>>>>>   This message is sent to you because you are subscribed to
>>>>>>   the mailing list Lasso [hidden email]
>>>>>> Official list archives available at http://www.lassotalk.com
>>>>>> To unsubscribe, E-mail to: <[hidden email]>
>>>>>> Send administrative queries to  <[hidden email]>
>>>>>   -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
>>>>>-- -- --
>>>>> Steve Piercy              Website Builder              Eugene, OR
>>>>> <[hidden email]>               <http://www.stevepiercy.com/>
>>>>>    #############################################################
>>>>>   This message is sent to you because you are subscribed to
>>>>>   the mailing list Lasso [hidden email]
>>>>> Official list archives available at http://www.lassotalk.com
>>>>> To unsubscribe, E-mail to: <[hidden email]>
>>>>> Send administrative queries to  <[hidden email]>
>>>>   -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
>>>>-- -- --
>>>> Steve Piercy              Website Builder              Eugene, OR
>>>> <[hidden email]>               <http://www.stevepiercy.com/>
>>>>    #############################################################
>>>>   This message is sent to you because you are subscribed to
>>>>   the mailing list Lasso [hidden email]
>>>> Official list archives available at http://www.lassotalk.com
>>>> To unsubscribe, E-mail to: <[hidden email]>
>>>> Send administrative queries to  <[hidden email]>
>>>     #############################################################
>>>   This message is sent to you because you are subscribed to
>>>   the mailing list Lasso [hidden email]
>>> Official list archives available at http://www.lassotalk.com
>>> To unsubscribe, E-mail to: <[hidden email]>
>>> Send administrative queries to  <[hidden email]>
>>
>>-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
>>Steve Piercy              Website Builder              Eugene, OR
>><[hidden email]>               <http://www.stevepiercy.com/>
>>
>>
>>#############################################################
>>
>>This message is sent to you because you are subscribed to
>>the mailing list Lasso [hidden email]
>>Official list archives available at http://www.lassotalk.com
>>To unsubscribe, E-mail to: <[hidden email]>
>>Send administrative queries to  <[hidden email]>
>
>
>
>#############################################################
>
>This message is sent to you because you are subscribed to
>the mailing list Lasso [hidden email]
>Official list archives available at http://www.lassotalk.com
>To unsubscribe, E-mail to: <[hidden email]>
>Send administrative queries to  <[hidden email]>

-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
Steve Piercy              Website Builder              Eugene, OR
<[hidden email]>               <http://www.stevepiercy.com/>


#############################################################

This message is sent to you because you are subscribed to
  the mailing list Lasso [hidden email]
Official list archives available at http://www.lassotalk.com
To unsubscribe, E-mail to: <[hidden email]>
Send administrative queries to  <[hidden email]>
Reply | Threaded
Open this post in threaded view
|

Re: Authorize.net Accept Hosted Redirect Method

Mike Ealy-2
This worked. Note the '"' when setting myxml.

[
    local('myxml') = '<getHostedPaymentPageRequest
xmlns='"'AnetApi/xml/v1/schema/AnetApiSchema.xsd'"'><merchantAuthentication>
<name>SANDBOX_API_LOGIN_ID</name><transactionKey>SANDBOX_API_TRANSACTION_KEY
</transactionKey></merchantAuthentication><transactionRequest><transactionTy
pe>authCaptureTransaction</transactionType><amount>20.00</amount></transacti
onRequest></getHostedPaymentPageRequest>';
   
    shell('curl -X POST https://apitest.authorize.net/xml/v1/request.api \
        --header "Content-Type: application/xml" \
        --data "' + #myxml + '"');
]

Thanks so much guys, especially Steve. Now on to the next step.



> The error message almost always gives you a good hint.
>
>> /bin/bash: -c: line 0: syntax error near unexpected token `<' /bin/bash: -c:
>
> As I remarked earlier:
>
>>>> Also check for proper quoting of --data argument.
>
> Try this.
>
>> --data "' + #myxml + '"');
>
> Else just fiddle around with the quote marks until you get it
> right and always check the error messages.
>
> --steve
>
>
> On 2/28/19 at 6:40 AM, [hidden email] (Mike Ealy) pronounced:
>
>> This:
>> [
>> local('myxml') = '<getHostedPaymentPageRequest
>> xmlns="AnetApi/xml/v1/schema/AnetApiSchema.xsd"><merchantAuthentication><nam
>> e>SANDBOX_API_LOGIN_ID</name><transactionKey>SANDBOX_API_TRANSACTION_KEY</tr
>> ansactionKey></merchantAuthentication><transactionRequest><transactionType>a
>> uthCaptureTransaction</transactionType><amount>20.00</amount></transactionRe
>> quest></getHostedPaymentPageRequest>';
>>
>> shell('curl -X POST https://apitest.authorize.net/xml/v1/request.api \
>> --header "Content-Type: application/xml" \
>> --data ' + #myxml);
>> ]
>>
>> Returns this:
>> /bin/bash: -c: line 0: syntax error near unexpected token `<' /bin/bash: -c:
>> line 0: `cd ///Library/.../pathToFile/; curl -X POST
>> https://apitest.authorize.net/xml/v1/request.api --header "Content-Type:
>> application/xml" --data <getHostedPaymentPageRequest
>> xmlns="AnetApi/xml/v1/schema/AnetApiSchema.xsd"><merchantAuthentication><nam
>> e>SANDBOX_API_LOGIN_ID</name><transactionKey>SANDBOX_API_TRANSACTION_KEY</tr
>> ansactionKey></merchantAuthentication><transactionRequest><transactionType>a
>> uthCaptureTransaction</transactionType><amount>20.00</amount></transactionRe
>> quest></getHostedPaymentPageRequest>'
>>
>>
>>
>>> The error message is pretty helpful.
>>>
>>>> Unterminated quoted literal on line 1 at position 1.
>>>
>>> Try this:
>>>
>>> [
>>> local('myxml') = '<getHostedPaymentPageRequest
>>>
>>> xmlns="AnetApi/xml/v1/schema/AnetApiSchema.xsd"><merchantAuthentication><nam
>>>
>>> e>SANDBOX_API_LOGIN_ID</name><transactionKey>SANDBOX_API_TRANSACTION_KEY</tr
>>>
>>> ansactionKey></merchantAuthentication><transactionRequest><transactionType>a
>>>
>>> uthCaptureTransaction</transactionType><amount>20.00</amount></transactionRe
>>> quest></getHostedPaymentPageRequest>';
>>>
>>> shell('curl -X POST https://apitest.authorize.net/xml/v1/request.api \
>>> --header "Content-Type: application/xml" \
>>> --data ' + #myxml);
>>> ]
>>>
>>> --steve
>>>
>>>
>>> On 2/27/19 at 4:42 PM, [hidden email] (Mike Ealy) pronounced:
>>>
>>>> This works in terminal:
>>>>   curl -X POST
>>>> https://apitest.authorize.net/xml/v1/request.api --header
>>>> 'Content-Type: application/xml' --data '<getHostedPaymentPageRequest
>>>>
xmlns="AnetApi/xml/v1/schema/AnetApiSchema.xsd"><merchantAuthentication><na>>>>
m
>>>>
e>SANDBOX_API_LOGIN_ID</name><transactionKey>SANDBOX_API_TRANSACTION_KEY</t>>>>
r
>>>>
ansactionKey></merchantAuthentication><transactionRequest><transactionType>>>>>
a
>>>>
uthCaptureTransaction</transactionType><amount>20.00</amount></transactionR>>>>
e
>>>> quest></getHostedPaymentPageRequest>'
>>>>   Result:
>>>> <?xml version="1.0" encoding="utf-8"?><getHostedPaymentPageResponse
>>>> xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
>>>> xmlns:xsd="http://www.w3.org/2001/XMLSchema"
>>>>
xmlns="AnetApi/xml/v1/schema/AnetApiSchema.xsd"><messages><resultCode>Ok</r>>>>
e
>>>>
sultCode><message><code>I00001</code><text>Successful.</text></message></me>>>>
s
>>>> sages><token>y56C8lnp...U1Y4ZMgM4QnG</token></getHostedPaymentPageResponse>
>>>>    When I try to serve it in Lasso 8.5 I get an error.
>>>>   [shell('curl -X POST
>>>> https://apitest.authorize.net/xml/v1/request.api \
>>>>     --header "Content-Type: application/xml" \
>>>>     --data ' + <getHostedPaymentPageRequest
>>>>
xmlns="AnetApi/xml/v1/schema/AnetApiSchema.xsd"><merchantAuthentication><na>>>>
m
>>>>
e>SANDBOX_API_LOGIN_ID</name><transactionKey>SANDBOX_API_TRANSACTION_KEY</t>>>>
r
>>>>
ansactionKey></merchantAuthentication><transactionRequest><transactionType>>>>>
a
>>>>
uthCaptureTransaction</transactionType><amount>20.00</amount></transactionR>>>>
e

>>>> quest></getHostedPaymentPageRequest>')]
>>>>   Expected: a tag name but got: "shell('curl -X POST
>>>> https://apitest.authorize.net/xml/v1/request.api --header "Content-Type:
>>>> application/xml" --data ' + <get...
>>>> at: Unterminated quoted literal on line 1 at position 1.
>>>>    
>>>>> Ack.  I did not properly quote the header value.
>>>>>       shell('curl -X POST
>>>>> https://apitest.authorize.net/xml/v1/request.api \
>>>>>             --header "Content-Type: application/xml" \
>>>>>             --data ' + $xml_content)
>>>>>        export xml="<my crazy long xml>"
>>>>>     curl -X POST https://apitest.authorize.net/xml/v1/request.api \
>>>>>             --header "Content-Type: application/xml" \
>>>>>             --data $xml
>>>>>   Also check for proper quoting of --data argument.
>>>>>   --steve
>>>>>    On 2/27/19 at 12:01 PM, [hidden email] (Steve
>>>>> Piercy - Website Builder)
>>>>> pronounced:
>>>>>
>>>>>> You have several mistakes with quote marks and the --header argument.
>>>>>> Try
>>>>>> this:
>>>>>>       shell("curl -X POST
>>>>>> https://apitest.authorize.net/xml/v1/request.api \
>>>>>>             --header Content-Type: application/xml \
>>>>>>             --data " + $xml_content)
>>>>>>   Tip: try doing this from a terminal first to speed up
>>>>>> development without
>>>>>> Lasso getting in
>>>>>> the way.
>>>>>>       export xml="<my crazy long xml>"
>>>>>>     curl -X POST https://apitest.authorize.net/xml/v1/request.api \
>>>>>>             --header Content-Type: application/xml \
>>>>>>             --data $xml
>>>>>>   --steve
>>>>>>    On 2/27/19 at 2:24 PM, [hidden email] (Mike
>>>>>> Ealy) pronounced:
>>>>>>
>>>>>>> $ curl -X POST https://apitest.authorize.net/xml/v1/request.api --header
>>>>>>> 'content-type: text/xml' --data '<xml><getHostedPaymentPageRequest
>>>>>>> xmlns="AnetApi/xml/v1/schema/AnetApiSchema.xsd"><merchantAuthentication>
>>>>>>> <n
>>>>>>> am
>>>>>>> e>SANDBOX_API_LOGIN_ID</name><transactionKey>SANDBOX_API_TRANSACTION_KEY
>>>>>>> </
>>>>>>> tr
>>>>>>> ansactionKey></merchantAuthentication><transactionRequest><transactionTy
>>>>>>> pe
>>>>>>>> a
>>>>>>> uthCaptureTransaction</transactionType><amount>20.00</amount></transacti
>>>>>>> on
>>>>>>> Re
>>>>>>> quest></getHostedPaymentPageRequest></xml>'
>>>>>>>   Produces:
>>>>>>> <?xml version="1.0" encoding="utf-8"?><ErrorResponse
>>>>>>> xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
>>>>>>> xmlns:xsd="http://www.w3.org/2001/XMLSchema"
>>>>>>> xmlns="AnetApi/xml/v1/schema/AnetApiSchema.xsd"><messages><resultCode>Er
>>>>>>> ro
>>>>>>> r<
>>>>>>> /resultCode><message><code>E00004</code><text>The name of the requested
>>>>>>> API
>>>>>>> method is invalid.</text></message></messages></ErrorResponse>
>>>>>>>    
>>>>>>> https://developer.authorize.net/api/reference/responseCodes.html?code=E0
>>>>>>> 00
>>>>>>> 04
>>>>>>>   Code: E00004  Explanation: The name of the requested
>>>>>>> API method is invalid.
>>>>>>> Description: The name of the root node of the XML request is the API
>>>>>>> method
>>>>>>> being called. It is not valid.
>>>>>>>    I'll take a look at the syntax in your tag. Thanks, Steve.
>>>>>>>   Mike
>>>>>>>  
>>>>>>>> What's the error code and message?
>>>>>>>>   A similar example that does work can be gleaned from
>>>>>>>> my tag.
>>>>>>>>  
>>>>>>>> https://github.com/stevepiercy/AuthorizeNet_AIM/blob/master/AuthorizeNe
>>>>>>>> t_
>>>>>>>> AI
>>>>>>>> M.i
>>>>>>>> nc#L193
>>>>>>>>   --steve
>>>>>>>>    On 2/27/19 at 12:03 PM, [hidden email]
>>>>>>>> (Mike Ealy) pronounced:
>>>>>>>>
>>>>>>>>> I'm working through the steps to move from Authorize.net SIM method to
>>>>>>>>> Accept Hosted Redirect Method. I'm using Lasso 8.5 on MacOS 10.11.6.
>>>>>>>>>   The first step is to request a Form Validation Token.
>>>>>>>>> I tried using
>>>>>>>>> include_URL but it produces an Authorize error code saying the name of
>>>>>>>>> the
>>>>>>>>> requested API method is invalid. This may be because TLS in not
>>>>>>>>> supported
>>>>>>>>> by
>>>>>>>>> include_URL.
>>>>>>>>>   [Include_URL: 'https://apitest.authorize.net/xml/v1/request.api',
>>>>>>>>> -POSTParams='<xml><getHostedPaymentPageRequest
>>>>>>>>> xmlns="AnetApi/xml/v1/schema/AnetApiSchema.xsd">
>>>>>>>>>     <merchantAuthentication>
>>>>>>>>>         <name>SANDBOX_API_LOGIN_ID</name>
>>>>>>>>>         <transactionKey>SANDBOX_API_TRANSACTION_KEY</transactionKey>
>>>>>>>>>     </merchantAuthentication>
>>>>>>>>>     <transactionRequest>
>>>>>>>>>         <transactionType>authCaptureTransaction</transactionType>
>>>>>>>>>         <amount>20.00</amount>
>>>>>>>>>     </transactionRequest>
>>>>>>>>> </getHostedPaymentPageRequest></xml>']
>>>>>>>>>   Reading the archives it looks like using curl is a
>>>>>>>>> better option. I've
>>>>>>>>> tried
>>>>>>>>> this but I can't seem to get the syntax right.
>>>>>>>>>   [shell('curl -X POST
>>>>>>>>> https://apitest.authorize.net/xml/v1/request.api
>>>>>>>>> --header 'content-type: text/xml' --data '$xml_content')]
>>>>>>>>>   How do I pass this xml into curl and submit it to
>>>>>>>>> https://apitest.authorize.net/xml/v1/request.api?
>>>>>>>>>   Thanks,
>>>>>>>>> Mike Ealy
>>>>>>>>>     #############################################################
>>>>>>>>>   This message is sent to you because you are
>>>>>>>>> subscribed to
>>>>>>>>>   the mailing list Lasso [hidden email]
>>>>>>>>> Official list archives available at http://www.lassotalk.com
>>>>>>>>> To unsubscribe, E-mail to: <[hidden email]>
>>>>>>>>> Send administrative queries to  <[hidden email]>
>>>>>>>>   -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
>>>>>>>> -- -- -- --
>>>>>>>> Steve Piercy              Website Builder              Eugene, OR
>>>>>>>> <[hidden email]>               <http://www.stevepiercy.com/>
>>>>>>>>    #############################################################
>>>>>>>>   This message is sent to you because you are subscribed to
>>>>>>>>   the mailing list Lasso [hidden email]
>>>>>>>> Official list archives available at http://www.lassotalk.com
>>>>>>>> To unsubscribe, E-mail to: <[hidden email]>
>>>>>>>> Send administrative queries to  <[hidden email]>
>>>>>>>     #############################################################
>>>>>>>   This message is sent to you because you are subscribed to
>>>>>>>   the mailing list Lasso [hidden email]
>>>>>>> Official list archives available at http://www.lassotalk.com
>>>>>>> To unsubscribe, E-mail to: <[hidden email]>
>>>>>>> Send administrative queries to  <[hidden email]>
>>>>>>   -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
>>>>>> -- -- --
>>>>>> Steve Piercy              Website Builder              Eugene, OR
>>>>>> <[hidden email]>               <http://www.stevepiercy.com/>
>>>>>>    #############################################################
>>>>>>   This message is sent to you because you are subscribed to
>>>>>>   the mailing list Lasso [hidden email]
>>>>>> Official list archives available at http://www.lassotalk.com
>>>>>> To unsubscribe, E-mail to: <[hidden email]>
>>>>>> Send administrative queries to  <[hidden email]>
>>>>>   -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
>>>>> -- -- --
>>>>> Steve Piercy              Website Builder              Eugene, OR
>>>>> <[hidden email]>               <http://www.stevepiercy.com/>
>>>>>    #############################################################
>>>>>   This message is sent to you because you are subscribed to
>>>>>   the mailing list Lasso [hidden email]
>>>>> Official list archives available at http://www.lassotalk.com
>>>>> To unsubscribe, E-mail to: <[hidden email]>
>>>>> Send administrative queries to  <[hidden email]>
>>>>     #############################################################
>>>>   This message is sent to you because you are subscribed to
>>>>   the mailing list Lasso [hidden email]
>>>> Official list archives available at http://www.lassotalk.com
>>>> To unsubscribe, E-mail to: <[hidden email]>
>>>> Send administrative queries to  <[hidden email]>
>>>
>>> -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
>>> Steve Piercy              Website Builder              Eugene, OR
>>> <[hidden email]>               <http://www.stevepiercy.com/>
>>>
>>>
>>> #############################################################
>>>
>>> This message is sent to you because you are subscribed to
>>> the mailing list Lasso [hidden email]
>>> Official list archives available at http://www.lassotalk.com
>>> To unsubscribe, E-mail to: <[hidden email]>
>>> Send administrative queries to  <[hidden email]>
>>
>>
>>
>> #############################################################
>>
>> This message is sent to you because you are subscribed to
>> the mailing list Lasso [hidden email]
>> Official list archives available at http://www.lassotalk.com
>> To unsubscribe, E-mail to: <[hidden email]>
>> Send administrative queries to  <[hidden email]>
>
> -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
> Steve Piercy              Website Builder              Eugene, OR
> <[hidden email]>               <http://www.stevepiercy.com/>
>
>
> #############################################################
>
> This message is sent to you because you are subscribed to
>   the mailing list Lasso [hidden email]
> Official list archives available at http://www.lassotalk.com
> To unsubscribe, E-mail to: <[hidden email]>
> Send administrative queries to  <[hidden email]>



#############################################################

This message is sent to you because you are subscribed to
  the mailing list Lasso [hidden email]
Official list archives available at http://www.lassotalk.com
To unsubscribe, E-mail to: <[hidden email]>
Send administrative queries to  <[hidden email]>
Reply | Threaded
Open this post in threaded view
|

Re: Authorize.net Accept Hosted Redirect Method

Mike Ealy-2
How do I retrieve the token value and save it in a variable?

<?xml version="1.0" encoding="utf-8"?><getHostedPaymentPageResponse
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns="AnetApi/xml/v1/schema/AnetApiSchema.xsd"><messages><resultCode>Ok</re
sultCode><message><code>I00001</code><text>Successful.</text></message></mes
sages><token>yBSyMvH++hUX9=/=Fp7t7b3q+PM/24swBuDbLdME/2hqUd+VgZaHz2fKzFgdjeU
gp08wm/wCIIj7Ui1tqZIYzdre+Ly9UHzs/YY=.4A826vxE8uu7</token></getHostedPayment
PageResponse>



>> The error message almost always gives you a good hint.
>>
>>> /bin/bash: -c: line 0: syntax error near unexpected token `<' /bin/bash: -c:
>>
>> As I remarked earlier:
>>
>>>>> Also check for proper quoting of --data argument.
>>
>> Try this.
>>
>>> --data "' + #myxml + '"');
>>
>> Else just fiddle around with the quote marks until you get it
>> right and always check the error messages.
>>
>> --steve
>>
>>
>> On 2/28/19 at 6:40 AM, [hidden email] (Mike Ealy) pronounced:
>>
>>> This:
>>> [
>>> local('myxml') = '<getHostedPaymentPageRequest
>>> xmlns="AnetApi/xml/v1/schema/AnetApiSchema.xsd"><merchantAuthentication><nam
>>> e>SANDBOX_API_LOGIN_ID</name><transactionKey>SANDBOX_API_TRANSACTION_KEY</tr
>>> ansactionKey></merchantAuthentication><transactionRequest><transactionType>a
>>> uthCaptureTransaction</transactionType><amount>20.00</amount></transactionRe
>>> quest></getHostedPaymentPageRequest>';
>>>
>>> shell('curl -X POST https://apitest.authorize.net/xml/v1/request.api \
>>> --header "Content-Type: application/xml" \
>>> --data ' + #myxml);
>>> ]
>>>
>>> Returns this:
>>> /bin/bash: -c: line 0: syntax error near unexpected token `<' /bin/bash: -c:
>>> line 0: `cd ///Library/.../pathToFile/; curl -X POST
>>> https://apitest.authorize.net/xml/v1/request.api --header "Content-Type:
>>> application/xml" --data <getHostedPaymentPageRequest
>>> xmlns="AnetApi/xml/v1/schema/AnetApiSchema.xsd"><merchantAuthentication><nam
>>> e>SANDBOX_API_LOGIN_ID</name><transactionKey>SANDBOX_API_TRANSACTION_KEY</tr
>>> ansactionKey></merchantAuthentication><transactionRequest><transactionType>a
>>> uthCaptureTransaction</transactionType><amount>20.00</amount></transactionRe
>>> quest></getHostedPaymentPageRequest>'
>>>
>>>
>>>
>>>> The error message is pretty helpful.
>>>>
>>>>> Unterminated quoted literal on line 1 at position 1.
>>>>
>>>> Try this:
>>>>
>>>> [
>>>> local('myxml') = '<getHostedPaymentPageRequest
>>>>
>>>>
xmlns="AnetApi/xml/v1/schema/AnetApiSchema.xsd"><merchantAuthentication><na>>>>
m
>>>>
>>>>
e>SANDBOX_API_LOGIN_ID</name><transactionKey>SANDBOX_API_TRANSACTION_KEY</t>>>>
r
>>>>
>>>>
ansactionKey></merchantAuthentication><transactionRequest><transactionType>>>>>
a
>>>>
>>>>
uthCaptureTransaction</transactionType><amount>20.00</amount></transactionR>>>>
e

>>>> quest></getHostedPaymentPageRequest>';
>>>>
>>>> shell('curl -X POST https://apitest.authorize.net/xml/v1/request.api \
>>>> --header "Content-Type: application/xml" \
>>>> --data ' + #myxml);
>>>> ]
>>>>
>>>> --steve
>>>>
>>>>
>>>> On 2/27/19 at 4:42 PM, [hidden email] (Mike Ealy) pronounced:
>>>>
>>>>> This works in terminal:
>>>>>   curl -X POST
>>>>> https://apitest.authorize.net/xml/v1/request.api --header
>>>>> 'Content-Type: application/xml' --data '<getHostedPaymentPageRequest
>>>>>
>
xmlns="AnetApi/xml/v1/schema/AnetApiSchema.xsd"><merchantAuthentication><na>>>>
>
> m
>>>>>
>
e>SANDBOX_API_LOGIN_ID</name><transactionKey>SANDBOX_API_TRANSACTION_KEY</t>>>>
>
> r
>>>>>
>
ansactionKey></merchantAuthentication><transactionRequest><transactionType>>>>>
>
> a
>>>>>
>
uthCaptureTransaction</transactionType><amount>20.00</amount></transactionR>>>>
>
> e
>>>>> quest></getHostedPaymentPageRequest>'
>>>>>   Result:
>>>>> <?xml version="1.0" encoding="utf-8"?><getHostedPaymentPageResponse
>>>>> xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
>>>>> xmlns:xsd="http://www.w3.org/2001/XMLSchema"
>>>>>
>
xmlns="AnetApi/xml/v1/schema/AnetApiSchema.xsd"><messages><resultCode>Ok</r>>>>
>
> e
>>>>>
>
sultCode><message><code>I00001</code><text>Successful.</text></message></me>>>>
>
> s
>>>>>
sages><token>y56C8lnp...U1Y4ZMgM4QnG</token></getHostedPaymentPageResponse>>>>>
>
>>>>>    When I try to serve it in Lasso 8.5 I get an error.
>>>>>   [shell('curl -X POST
>>>>> https://apitest.authorize.net/xml/v1/request.api \
>>>>>     --header "Content-Type: application/xml" \
>>>>>     --data ' + <getHostedPaymentPageRequest
>>>>>
>
xmlns="AnetApi/xml/v1/schema/AnetApiSchema.xsd"><merchantAuthentication><na>>>>
>
> m
>>>>>
>
e>SANDBOX_API_LOGIN_ID</name><transactionKey>SANDBOX_API_TRANSACTION_KEY</t>>>>
>
> r
>>>>>
>
ansactionKey></merchantAuthentication><transactionRequest><transactionType>>>>>
>
> a
>>>>>
>
uthCaptureTransaction</transactionType><amount>20.00</amount></transactionR>>>>

>
> e
>>>>> quest></getHostedPaymentPageRequest>')]
>>>>>   Expected: a tag name but got: "shell('curl -X POST
>>>>> https://apitest.authorize.net/xml/v1/request.api --header "Content-Type:
>>>>> application/xml" --data ' + <get...
>>>>> at: Unterminated quoted literal on line 1 at position 1.
>>>>>    
>>>>>> Ack.  I did not properly quote the header value.
>>>>>>       shell('curl -X POST
>>>>>> https://apitest.authorize.net/xml/v1/request.api \
>>>>>>             --header "Content-Type: application/xml" \
>>>>>>             --data ' + $xml_content)
>>>>>>        export xml="<my crazy long xml>"
>>>>>>     curl -X POST https://apitest.authorize.net/xml/v1/request.api \
>>>>>>             --header "Content-Type: application/xml" \
>>>>>>             --data $xml
>>>>>>   Also check for proper quoting of --data argument.
>>>>>>   --steve
>>>>>>    On 2/27/19 at 12:01 PM, [hidden email] (Steve
>>>>>> Piercy - Website Builder)
>>>>>> pronounced:
>>>>>>
>>>>>>> You have several mistakes with quote marks and the --header argument.
>>>>>>> Try
>>>>>>> this:
>>>>>>>       shell("curl -X POST
>>>>>>> https://apitest.authorize.net/xml/v1/request.api \
>>>>>>>             --header Content-Type: application/xml \
>>>>>>>             --data " + $xml_content)
>>>>>>>   Tip: try doing this from a terminal first to speed up
>>>>>>> development without
>>>>>>> Lasso getting in
>>>>>>> the way.
>>>>>>>       export xml="<my crazy long xml>"
>>>>>>>     curl -X POST https://apitest.authorize.net/xml/v1/request.api \
>>>>>>>             --header Content-Type: application/xml \
>>>>>>>             --data $xml
>>>>>>>   --steve
>>>>>>>    On 2/27/19 at 2:24 PM, [hidden email] (Mike
>>>>>>> Ealy) pronounced:
>>>>>>>
>>>>>>>> $ curl -X POST https://apitest.authorize.net/xml/v1/request.api
>>>>>>>> --header
>>>>>>>> 'content-type: text/xml' --data '<xml><getHostedPaymentPageRequest
>>>>>>>>
xmlns="AnetApi/xml/v1/schema/AnetApiSchema.xsd"><merchantAuthentication>>>>>>>>
>
>>>>>>>> <n
>>>>>>>> am
>>>>>>>>
e>SANDBOX_API_LOGIN_ID</name><transactionKey>SANDBOX_API_TRANSACTION_KE>>>>>>>>
Y
>>>>>>>> </
>>>>>>>> tr
>>>>>>>>
ansactionKey></merchantAuthentication><transactionRequest><transactionT>>>>>>>>
y
>>>>>>>> pe
>>>>>>>>> a
>>>>>>>>
uthCaptureTransaction</transactionType><amount>20.00</amount></transact>>>>>>>>
i
>>>>>>>> on
>>>>>>>> Re
>>>>>>>> quest></getHostedPaymentPageRequest></xml>'
>>>>>>>>   Produces:
>>>>>>>> <?xml version="1.0" encoding="utf-8"?><ErrorResponse
>>>>>>>> xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
>>>>>>>> xmlns:xsd="http://www.w3.org/2001/XMLSchema"
>>>>>>>>
xmlns="AnetApi/xml/v1/schema/AnetApiSchema.xsd"><messages><resultCode>E>>>>>>>>
r
>>>>>>>> ro
>>>>>>>> r<
>>>>>>>> /resultCode><message><code>E00004</code><text>The name of the requested
>>>>>>>> API
>>>>>>>> method is invalid.</text></message></messages></ErrorResponse>
>>>>>>>>    
>>>>>>>>
https://developer.authorize.net/api/reference/responseCodes.html?code=E>>>>>>>>
0

>>>>>>>> 00
>>>>>>>> 04
>>>>>>>>   Code: E00004  Explanation: The name of the requested
>>>>>>>> API method is invalid.
>>>>>>>> Description: The name of the root node of the XML request is the API
>>>>>>>> method
>>>>>>>> being called. It is not valid.
>>>>>>>>    I'll take a look at the syntax in your tag. Thanks, Steve.
>>>>>>>>   Mike
>>>>>>>>  
>>>>>>>>> What's the error code and message?
>>>>>>>>>   A similar example that does work can be gleaned from
>>>>>>>>> my tag.
>>>>>>>>>  
>>>>>>>>>
https://github.com/stevepiercy/AuthorizeNet_AIM/blob/master/AuthorizeN>>>>>>>>>
e

>>>>>>>>> t_
>>>>>>>>> AI
>>>>>>>>> M.i
>>>>>>>>> nc#L193
>>>>>>>>>   --steve
>>>>>>>>>    On 2/27/19 at 12:03 PM, [hidden email]
>>>>>>>>> (Mike Ealy) pronounced:
>>>>>>>>>
>>>>>>>>>> I'm working through the steps to move from Authorize.net SIM method
>>>>>>>>>> to
>>>>>>>>>> Accept Hosted Redirect Method. I'm using Lasso 8.5 on MacOS 10.11.6.
>>>>>>>>>>   The first step is to request a Form Validation Token.
>>>>>>>>>> I tried using
>>>>>>>>>> include_URL but it produces an Authorize error code saying the name
>>>>>>>>>> of
>>>>>>>>>> the
>>>>>>>>>> requested API method is invalid. This may be because TLS in not
>>>>>>>>>> supported
>>>>>>>>>> by
>>>>>>>>>> include_URL.
>>>>>>>>>>   [Include_URL: 'https://apitest.authorize.net/xml/v1/request.api',
>>>>>>>>>> -POSTParams='<xml><getHostedPaymentPageRequest
>>>>>>>>>> xmlns="AnetApi/xml/v1/schema/AnetApiSchema.xsd">
>>>>>>>>>>     <merchantAuthentication>
>>>>>>>>>>         <name>SANDBOX_API_LOGIN_ID</name>
>>>>>>>>>>         <transactionKey>SANDBOX_API_TRANSACTION_KEY</transactionKey>
>>>>>>>>>>     </merchantAuthentication>
>>>>>>>>>>     <transactionRequest>
>>>>>>>>>>         <transactionType>authCaptureTransaction</transactionType>
>>>>>>>>>>         <amount>20.00</amount>
>>>>>>>>>>     </transactionRequest>
>>>>>>>>>> </getHostedPaymentPageRequest></xml>']
>>>>>>>>>>   Reading the archives it looks like using curl is a
>>>>>>>>>> better option. I've
>>>>>>>>>> tried
>>>>>>>>>> this but I can't seem to get the syntax right.
>>>>>>>>>>   [shell('curl -X POST
>>>>>>>>>> https://apitest.authorize.net/xml/v1/request.api
>>>>>>>>>> --header 'content-type: text/xml' --data '$xml_content')]
>>>>>>>>>>   How do I pass this xml into curl and submit it to
>>>>>>>>>> https://apitest.authorize.net/xml/v1/request.api?
>>>>>>>>>>   Thanks,
>>>>>>>>>> Mike Ealy
>>>>>>>>>>     #############################################################
>>>>>>>>>>   This message is sent to you because you are
>>>>>>>>>> subscribed to
>>>>>>>>>>   the mailing list Lasso [hidden email]
>>>>>>>>>> Official list archives available at http://www.lassotalk.com
>>>>>>>>>> To unsubscribe, E-mail to: <[hidden email]>
>>>>>>>>>> Send administrative queries to  <[hidden email]>
>>>>>>>>>   -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
>>>>>>>>> -- -- -- --
>>>>>>>>> Steve Piercy              Website Builder              Eugene, OR
>>>>>>>>> <[hidden email]>               <http://www.stevepiercy.com/>
>>>>>>>>>    #############################################################
>>>>>>>>>   This message is sent to you because you are subscribed to
>>>>>>>>>   the mailing list Lasso [hidden email]
>>>>>>>>> Official list archives available at http://www.lassotalk.com
>>>>>>>>> To unsubscribe, E-mail to: <[hidden email]>
>>>>>>>>> Send administrative queries to  <[hidden email]>
>>>>>>>>     #############################################################
>>>>>>>>   This message is sent to you because you are subscribed to
>>>>>>>>   the mailing list Lasso [hidden email]
>>>>>>>> Official list archives available at http://www.lassotalk.com
>>>>>>>> To unsubscribe, E-mail to: <[hidden email]>
>>>>>>>> Send administrative queries to  <[hidden email]>
>>>>>>>   -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
>>>>>>> -- -- --
>>>>>>> Steve Piercy              Website Builder              Eugene, OR
>>>>>>> <[hidden email]>               <http://www.stevepiercy.com/>
>>>>>>>    #############################################################
>>>>>>>   This message is sent to you because you are subscribed to
>>>>>>>   the mailing list Lasso [hidden email]
>>>>>>> Official list archives available at http://www.lassotalk.com
>>>>>>> To unsubscribe, E-mail to: <[hidden email]>
>>>>>>> Send administrative queries to  <[hidden email]>
>>>>>>   -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
>>>>>> -- -- --
>>>>>> Steve Piercy              Website Builder              Eugene, OR
>>>>>> <[hidden email]>               <http://www.stevepiercy.com/>
>>>>>>    #############################################################
>>>>>>   This message is sent to you because you are subscribed to
>>>>>>   the mailing list Lasso [hidden email]
>>>>>> Official list archives available at http://www.lassotalk.com
>>>>>> To unsubscribe, E-mail to: <[hidden email]>
>>>>>> Send administrative queries to  <[hidden email]>
>>>>>     #############################################################
>>>>>   This message is sent to you because you are subscribed to
>>>>>   the mailing list Lasso [hidden email]
>>>>> Official list archives available at http://www.lassotalk.com
>>>>> To unsubscribe, E-mail to: <[hidden email]>
>>>>> Send administrative queries to  <[hidden email]>
>>>>
>>>> -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
>>>> Steve Piercy              Website Builder              Eugene, OR
>>>> <[hidden email]>               <http://www.stevepiercy.com/>
>>>>
>>>>
>>>> #############################################################
>>>>
>>>> This message is sent to you because you are subscribed to
>>>> the mailing list Lasso [hidden email]
>>>> Official list archives available at http://www.lassotalk.com
>>>> To unsubscribe, E-mail to: <[hidden email]>
>>>> Send administrative queries to  <[hidden email]>
>>>
>>>
>>>
>>> #############################################################
>>>
>>> This message is sent to you because you are subscribed to
>>> the mailing list Lasso [hidden email]
>>> Official list archives available at http://www.lassotalk.com
>>> To unsubscribe, E-mail to: <[hidden email]>
>>> Send administrative queries to  <[hidden email]>
>>
>> -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
>> Steve Piercy              Website Builder              Eugene, OR
>> <[hidden email]>               <http://www.stevepiercy.com/>
>>
>>
>> #############################################################
>>
>> This message is sent to you because you are subscribed to
>>   the mailing list Lasso [hidden email]
>> Official list archives available at http://www.lassotalk.com
>> To unsubscribe, E-mail to: <[hidden email]>
>> Send administrative queries to  <[hidden email]>
>
>
>
> #############################################################
>
> This message is sent to you because you are subscribed to
>   the mailing list Lasso [hidden email]
> Official list archives available at http://www.lassotalk.com
> To unsubscribe, E-mail to: <[hidden email]>
> Send administrative queries to  <[hidden email]>



#############################################################

This message is sent to you because you are subscribed to
  the mailing list Lasso [hidden email]
Official list archives available at http://www.lassotalk.com
To unsubscribe, E-mail to: <[hidden email]>
Send administrative queries to  <[hidden email]>
Reply | Threaded
Open this post in threaded view
|

Re: Authorize.net Accept Hosted Redirect Method

Mike Ealy-2
Got it!

[
    local('myxml') = '<getHostedPaymentPageRequest
xmlns='"'AnetApi/xml/v1/schema/AnetApiSchema.xsd'"'><merchantAuthentication>
<name>SANDBOX_API_LOGIN_ID</name><transactionKey>SANDBOX_API_TRANSACTION_KEY
</transactionKey></merchantAuthentication><transactionRequest><transactionTy
pe>authCaptureTransaction</transactionType><amount>20.00</amount></transacti
onRequest></getHostedPaymentPageRequest>';
   
    var('XML_String')=(shell('curl -X POST
https://apitest.authorize.net/xml/v1/request.api \
        --header "Content-Type: application/xml" \
        --data "' + #myxml + '"'));
]


[var:'extract_token'=(xml_tree($XML_String))]
[$extract_token->token]



> How do I retrieve the token value and save it in a variable?
>
> <?xml version="1.0" encoding="utf-8"?><getHostedPaymentPageResponse
> xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
> xmlns:xsd="http://www.w3.org/2001/XMLSchema"
> xmlns="AnetApi/xml/v1/schema/AnetApiSchema.xsd"><messages><resultCode>Ok</re
> sultCode><message><code>I00001</code><text>Successful.</text></message></mes
> sages><token>yBSyMvH++hUX9=/=Fp7t7b3q+PM/24swBuDbLdME/2hqUd+VgZaHz2fKzFgdjeU
> gp08wm/wCIIj7Ui1tqZIYzdre+Ly9UHzs/YY=.4A826vxE8uu7</token></getHostedPayment
> PageResponse>
>
>
>
>>> The error message almost always gives you a good hint.
>>>
>>>> /bin/bash: -c: line 0: syntax error near unexpected token `<' /bin/bash:
>>>> -c:
>>>
>>> As I remarked earlier:
>>>
>>>>>> Also check for proper quoting of --data argument.
>>>
>>> Try this.
>>>
>>>> --data "' + #myxml + '"');
>>>
>>> Else just fiddle around with the quote marks until you get it
>>> right and always check the error messages.
>>>
>>> --steve
>>>
>>>
>>> On 2/28/19 at 6:40 AM, [hidden email] (Mike Ealy) pronounced:
>>>
>>>> This:
>>>> [
>>>> local('myxml') = '<getHostedPaymentPageRequest
>>>>
xmlns="AnetApi/xml/v1/schema/AnetApiSchema.xsd"><merchantAuthentication><na>>>>
m
>>>>
e>SANDBOX_API_LOGIN_ID</name><transactionKey>SANDBOX_API_TRANSACTION_KEY</t>>>>
r
>>>>
ansactionKey></merchantAuthentication><transactionRequest><transactionType>>>>>
a
>>>>
uthCaptureTransaction</transactionType><amount>20.00</amount></transactionR>>>>
e

>>>> quest></getHostedPaymentPageRequest>';
>>>>
>>>> shell('curl -X POST https://apitest.authorize.net/xml/v1/request.api \
>>>> --header "Content-Type: application/xml" \
>>>> --data ' + #myxml);
>>>> ]
>>>>
>>>> Returns this:
>>>> /bin/bash: -c: line 0: syntax error near unexpected token `<' /bin/bash:
>>>> -c:
>>>> line 0: `cd ///Library/.../pathToFile/; curl -X POST
>>>> https://apitest.authorize.net/xml/v1/request.api --header "Content-Type:
>>>> application/xml" --data <getHostedPaymentPageRequest
>>>>
xmlns="AnetApi/xml/v1/schema/AnetApiSchema.xsd"><merchantAuthentication><na>>>>
m
>>>>
e>SANDBOX_API_LOGIN_ID</name><transactionKey>SANDBOX_API_TRANSACTION_KEY</t>>>>
r
>>>>
ansactionKey></merchantAuthentication><transactionRequest><transactionType>>>>>
a
>>>>
uthCaptureTransaction</transactionType><amount>20.00</amount></transactionR>>>>
e

>>>> quest></getHostedPaymentPageRequest>'
>>>>
>>>>
>>>>
>>>>> The error message is pretty helpful.
>>>>>
>>>>>> Unterminated quoted literal on line 1 at position 1.
>>>>>
>>>>> Try this:
>>>>>
>>>>> [
>>>>> local('myxml') = '<getHostedPaymentPageRequest
>>>>>
>>>>>
>
xmlns="AnetApi/xml/v1/schema/AnetApiSchema.xsd"><merchantAuthentication><na>>>>
>
> m
>>>>>
>>>>>
>
e>SANDBOX_API_LOGIN_ID</name><transactionKey>SANDBOX_API_TRANSACTION_KEY</t>>>>
>
> r
>>>>>
>>>>>
>
ansactionKey></merchantAuthentication><transactionRequest><transactionType>>>>>
>
> a
>>>>>
>>>>>
>
uthCaptureTransaction</transactionType><amount>20.00</amount></transactionR>>>>

>
> e
>>>>> quest></getHostedPaymentPageRequest>';
>>>>>
>>>>> shell('curl -X POST https://apitest.authorize.net/xml/v1/request.api \
>>>>> --header "Content-Type: application/xml" \
>>>>> --data ' + #myxml);
>>>>> ]
>>>>>
>>>>> --steve
>>>>>
>>>>>
>>>>> On 2/27/19 at 4:42 PM, [hidden email] (Mike Ealy) pronounced:
>>>>>
>>>>>> This works in terminal:
>>>>>>   curl -X POST
>>>>>> https://apitest.authorize.net/xml/v1/request.api --header
>>>>>> 'Content-Type: application/xml' --data '<getHostedPaymentPageRequest
>>>>>>
>>
>
xmlns="AnetApi/xml/v1/schema/AnetApiSchema.xsd"><merchantAuthentication><na>>>>
>
>>
>> m
>>>>>>
>>
>
e>SANDBOX_API_LOGIN_ID</name><transactionKey>SANDBOX_API_TRANSACTION_KEY</t>>>>
>
>>
>> r
>>>>>>
>>
>
ansactionKey></merchantAuthentication><transactionRequest><transactionType>>>>>
>
>>
>> a
>>>>>>
>>
>
uthCaptureTransaction</transactionType><amount>20.00</amount></transactionR>>>>

>
>>
>> e
>>>>>> quest></getHostedPaymentPageRequest>'
>>>>>>   Result:
>>>>>> <?xml version="1.0" encoding="utf-8"?><getHostedPaymentPageResponse
>>>>>> xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
>>>>>> xmlns:xsd="http://www.w3.org/2001/XMLSchema"
>>>>>>
>>
>
xmlns="AnetApi/xml/v1/schema/AnetApiSchema.xsd"><messages><resultCode>Ok</r>>>>
>
>>
>> e
>>>>>>
>>
>
sultCode><message><code>I00001</code><text>Successful.</text></message></me>>>>
>
>>
>> s
>>>>>>
>
sages><token>y56C8lnp...U1Y4ZMgM4QnG</token></getHostedPaymentPageResponse>>>>>

>
>>
>>>>>>    When I try to serve it in Lasso 8.5 I get an error.
>>>>>>   [shell('curl -X POST
>>>>>> https://apitest.authorize.net/xml/v1/request.api \
>>>>>>     --header "Content-Type: application/xml" \
>>>>>>     --data ' + <getHostedPaymentPageRequest
>>>>>>
>>
>
xmlns="AnetApi/xml/v1/schema/AnetApiSchema.xsd"><merchantAuthentication><na>>>>
>
>>
>> m
>>>>>>
>>
>
e>SANDBOX_API_LOGIN_ID</name><transactionKey>SANDBOX_API_TRANSACTION_KEY</t>>>>
>
>>
>> r
>>>>>>
>>
>
ansactionKey></merchantAuthentication><transactionRequest><transactionType>>>>>
>
>>
>> a
>>>>>>
>>
>
uthCaptureTransaction</transactionType><amount>20.00</amount></transactionR>>>>

>
>>
>> e
>>>>>> quest></getHostedPaymentPageRequest>')]
>>>>>>   Expected: a tag name but got: "shell('curl -X POST
>>>>>> https://apitest.authorize.net/xml/v1/request.api --header "Content-Type:
>>>>>> application/xml" --data ' + <get...
>>>>>> at: Unterminated quoted literal on line 1 at position 1.
>>>>>>    
>>>>>>> Ack.  I did not properly quote the header value.
>>>>>>>       shell('curl -X POST
>>>>>>> https://apitest.authorize.net/xml/v1/request.api \
>>>>>>>             --header "Content-Type: application/xml" \
>>>>>>>             --data ' + $xml_content)
>>>>>>>        export xml="<my crazy long xml>"
>>>>>>>     curl -X POST https://apitest.authorize.net/xml/v1/request.api \
>>>>>>>             --header "Content-Type: application/xml" \
>>>>>>>             --data $xml
>>>>>>>   Also check for proper quoting of --data argument.
>>>>>>>   --steve
>>>>>>>    On 2/27/19 at 12:01 PM, [hidden email] (Steve
>>>>>>> Piercy - Website Builder)
>>>>>>> pronounced:
>>>>>>>
>>>>>>>> You have several mistakes with quote marks and the --header argument.
>>>>>>>> Try
>>>>>>>> this:
>>>>>>>>       shell("curl -X POST
>>>>>>>> https://apitest.authorize.net/xml/v1/request.api \
>>>>>>>>             --header Content-Type: application/xml \
>>>>>>>>             --data " + $xml_content)
>>>>>>>>   Tip: try doing this from a terminal first to speed up
>>>>>>>> development without
>>>>>>>> Lasso getting in
>>>>>>>> the way.
>>>>>>>>       export xml="<my crazy long xml>"
>>>>>>>>     curl -X POST https://apitest.authorize.net/xml/v1/request.api \
>>>>>>>>             --header Content-Type: application/xml \
>>>>>>>>             --data $xml
>>>>>>>>   --steve
>>>>>>>>    On 2/27/19 at 2:24 PM, [hidden email] (Mike
>>>>>>>> Ealy) pronounced:
>>>>>>>>
>>>>>>>>> $ curl -X POST https://apitest.authorize.net/xml/v1/request.api
>>>>>>>>> --header
>>>>>>>>> 'content-type: text/xml' --data '<xml><getHostedPaymentPageRequest
>>>>>>>>>
>
xmlns="AnetApi/xml/v1/schema/AnetApiSchema.xsd"><merchantAuthentication>>>>>>>>
>
>>
>>>>>>>>> <n
>>>>>>>>> am
>>>>>>>>>
>
e>SANDBOX_API_LOGIN_ID</name><transactionKey>SANDBOX_API_TRANSACTION_KE>>>>>>>>
>
> Y
>>>>>>>>> </
>>>>>>>>> tr
>>>>>>>>>
>
ansactionKey></merchantAuthentication><transactionRequest><transactionT>>>>>>>>
>
> y
>>>>>>>>> pe
>>>>>>>>>> a
>>>>>>>>>
>
uthCaptureTransaction</transactionType><amount>20.00</amount></transact>>>>>>>>

>
> i
>>>>>>>>> on
>>>>>>>>> Re
>>>>>>>>> quest></getHostedPaymentPageRequest></xml>'
>>>>>>>>>   Produces:
>>>>>>>>> <?xml version="1.0" encoding="utf-8"?><ErrorResponse
>>>>>>>>> xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
>>>>>>>>> xmlns:xsd="http://www.w3.org/2001/XMLSchema"
>>>>>>>>>
>
xmlns="AnetApi/xml/v1/schema/AnetApiSchema.xsd"><messages><resultCode>E>>>>>>>>

>
> r
>>>>>>>>> ro
>>>>>>>>> r<
>>>>>>>>> /resultCode><message><code>E00004</code><text>The name of the
>>>>>>>>> requested
>>>>>>>>> API
>>>>>>>>> method is invalid.</text></message></messages></ErrorResponse>
>>>>>>>>>    
>>>>>>>>>
>
https://developer.authorize.net/api/reference/responseCodes.html?code=E>>>>>>>>

>
> 0
>>>>>>>>> 00
>>>>>>>>> 04
>>>>>>>>>   Code: E00004  Explanation: The name of the requested
>>>>>>>>> API method is invalid.
>>>>>>>>> Description: The name of the root node of the XML request is the API
>>>>>>>>> method
>>>>>>>>> being called. It is not valid.
>>>>>>>>>    I'll take a look at the syntax in your tag. Thanks, Steve.
>>>>>>>>>   Mike
>>>>>>>>>  
>>>>>>>>>> What's the error code and message?
>>>>>>>>>>   A similar example that does work can be gleaned from
>>>>>>>>>> my tag.
>>>>>>>>>>  
>>>>>>>>>>
>
https://github.com/stevepiercy/AuthorizeNet_AIM/blob/master/AuthorizeN>>>>>>>>>

>
> e
>>>>>>>>>> t_
>>>>>>>>>> AI
>>>>>>>>>> M.i
>>>>>>>>>> nc#L193
>>>>>>>>>>   --steve
>>>>>>>>>>    On 2/27/19 at 12:03 PM, [hidden email]
>>>>>>>>>> (Mike Ealy) pronounced:
>>>>>>>>>>
>>>>>>>>>>> I'm working through the steps to move from Authorize.net SIM method
>>>>>>>>>>> to
>>>>>>>>>>> Accept Hosted Redirect Method. I'm using Lasso 8.5 on MacOS 10.11.6.
>>>>>>>>>>>   The first step is to request a Form Validation Token.
>>>>>>>>>>> I tried using
>>>>>>>>>>> include_URL but it produces an Authorize error code saying the name
>>>>>>>>>>> of
>>>>>>>>>>> the
>>>>>>>>>>> requested API method is invalid. This may be because TLS in not
>>>>>>>>>>> supported
>>>>>>>>>>> by
>>>>>>>>>>> include_URL.
>>>>>>>>>>>   [Include_URL: 'https://apitest.authorize.net/xml/v1/request.api',
>>>>>>>>>>> -POSTParams='<xml><getHostedPaymentPageRequest
>>>>>>>>>>> xmlns="AnetApi/xml/v1/schema/AnetApiSchema.xsd">
>>>>>>>>>>>     <merchantAuthentication>
>>>>>>>>>>>         <name>SANDBOX_API_LOGIN_ID</name>
>>>>>>>>>>>         <transactionKey>SANDBOX_API_TRANSACTION_KEY</transactionKey>
>>>>>>>>>>>     </merchantAuthentication>
>>>>>>>>>>>     <transactionRequest>
>>>>>>>>>>>         <transactionType>authCaptureTransaction</transactionType>
>>>>>>>>>>>         <amount>20.00</amount>
>>>>>>>>>>>     </transactionRequest>
>>>>>>>>>>> </getHostedPaymentPageRequest></xml>']
>>>>>>>>>>>   Reading the archives it looks like using curl is a
>>>>>>>>>>> better option. I've
>>>>>>>>>>> tried
>>>>>>>>>>> this but I can't seem to get the syntax right.
>>>>>>>>>>>   [shell('curl -X POST
>>>>>>>>>>> https://apitest.authorize.net/xml/v1/request.api
>>>>>>>>>>> --header 'content-type: text/xml' --data '$xml_content')]
>>>>>>>>>>>   How do I pass this xml into curl and submit it to
>>>>>>>>>>> https://apitest.authorize.net/xml/v1/request.api?
>>>>>>>>>>>   Thanks,
>>>>>>>>>>> Mike Ealy
>>>>>>>>>>>     #############################################################
>>>>>>>>>>>   This message is sent to you because you are
>>>>>>>>>>> subscribed to
>>>>>>>>>>>   the mailing list Lasso [hidden email]
>>>>>>>>>>> Official list archives available at http://www.lassotalk.com
>>>>>>>>>>> To unsubscribe, E-mail to: <[hidden email]>
>>>>>>>>>>> Send administrative queries to  <[hidden email]>
>>>>>>>>>>   -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
>>>>>>>>>> -- -- -- --
>>>>>>>>>> Steve Piercy              Website Builder              Eugene, OR
>>>>>>>>>> <[hidden email]>               <http://www.stevepiercy.com/>
>>>>>>>>>>    #############################################################
>>>>>>>>>>   This message is sent to you because you are subscribed to
>>>>>>>>>>   the mailing list Lasso [hidden email]
>>>>>>>>>> Official list archives available at http://www.lassotalk.com
>>>>>>>>>> To unsubscribe, E-mail to: <[hidden email]>
>>>>>>>>>> Send administrative queries to  <[hidden email]>
>>>>>>>>>     #############################################################
>>>>>>>>>   This message is sent to you because you are subscribed to
>>>>>>>>>   the mailing list Lasso [hidden email]
>>>>>>>>> Official list archives available at http://www.lassotalk.com
>>>>>>>>> To unsubscribe, E-mail to: <[hidden email]>
>>>>>>>>> Send administrative queries to  <[hidden email]>
>>>>>>>>   -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
>>>>>>>> -- -- --
>>>>>>>> Steve Piercy              Website Builder              Eugene, OR
>>>>>>>> <[hidden email]>               <http://www.stevepiercy.com/>
>>>>>>>>    #############################################################
>>>>>>>>   This message is sent to you because you are subscribed to
>>>>>>>>   the mailing list Lasso [hidden email]
>>>>>>>> Official list archives available at http://www.lassotalk.com
>>>>>>>> To unsubscribe, E-mail to: <[hidden email]>
>>>>>>>> Send administrative queries to  <[hidden email]>
>>>>>>>   -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
>>>>>>> -- -- --
>>>>>>> Steve Piercy              Website Builder              Eugene, OR
>>>>>>> <[hidden email]>               <http://www.stevepiercy.com/>
>>>>>>>    #############################################################
>>>>>>>   This message is sent to you because you are subscribed to
>>>>>>>   the mailing list Lasso [hidden email]
>>>>>>> Official list archives available at http://www.lassotalk.com
>>>>>>> To unsubscribe, E-mail to: <[hidden email]>
>>>>>>> Send administrative queries to  <[hidden email]>
>>>>>>     #############################################################
>>>>>>   This message is sent to you because you are subscribed to
>>>>>>   the mailing list Lasso [hidden email]
>>>>>> Official list archives available at http://www.lassotalk.com
>>>>>> To unsubscribe, E-mail to: <[hidden email]>
>>>>>> Send administrative queries to  <[hidden email]>
>>>>>
>>>>> -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
>>>>> Steve Piercy              Website Builder              Eugene, OR
>>>>> <[hidden email]>               <http://www.stevepiercy.com/>
>>>>>
>>>>>
>>>>> #############################################################
>>>>>
>>>>> This message is sent to you because you are subscribed to
>>>>> the mailing list Lasso [hidden email]
>>>>> Official list archives available at http://www.lassotalk.com
>>>>> To unsubscribe, E-mail to: <[hidden email]>
>>>>> Send administrative queries to  <[hidden email]>
>>>>
>>>>
>>>>
>>>> #############################################################
>>>>
>>>> This message is sent to you because you are subscribed to
>>>> the mailing list Lasso [hidden email]
>>>> Official list archives available at http://www.lassotalk.com
>>>> To unsubscribe, E-mail to: <[hidden email]>
>>>> Send administrative queries to  <[hidden email]>
>>>
>>> -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
>>> Steve Piercy              Website Builder              Eugene, OR
>>> <[hidden email]>               <http://www.stevepiercy.com/>
>>>
>>>
>>> #############################################################
>>>
>>> This message is sent to you because you are subscribed to
>>>   the mailing list Lasso [hidden email]
>>> Official list archives available at http://www.lassotalk.com
>>> To unsubscribe, E-mail to: <[hidden email]>
>>> Send administrative queries to  <[hidden email]>
>>
>>
>>
>> #############################################################
>>
>> This message is sent to you because you are subscribed to
>>   the mailing list Lasso [hidden email]
>> Official list archives available at http://www.lassotalk.com
>> To unsubscribe, E-mail to: <[hidden email]>
>> Send administrative queries to  <[hidden email]>
>
>
>
> #############################################################
>
> This message is sent to you because you are subscribed to
>   the mailing list Lasso [hidden email]
> Official list archives available at http://www.lassotalk.com
> To unsubscribe, E-mail to: <[hidden email]>
> Send administrative queries to  <[hidden email]>



#############################################################

This message is sent to you because you are subscribed to
  the mailing list Lasso [hidden email]
Official list archives available at http://www.lassotalk.com
To unsubscribe, E-mail to: <[hidden email]>
Send administrative queries to  <[hidden email]>