cancel
Showing results for 
Search instead for 
Did you mean: 

Need to switch from SIM to AIM, Accept or ???

We have been using SIM for years, but the hosted payment form is not mobile-friendly and there seems to be no immediate plans to make it so, according to tech support.

 

So, we're forced to host our own form. We've got an SSL cert installed and I've downloaded the SDK, but I can't find any kind of form samples to see what can work for us. And should I be using AIM or is that now something else... or should I use Accept?

 

We just need a simple form that submits 3 fields - the cardholder's Name, Card Number and Exp. Date and returns the fact that the transaction is good (or error code if bad).

 

A little help, please? :)

mferguson
Member
19 REPLIES 19

Hi Aaron,

 

I have both, but am working with the sample app. I assume you mean this page, right?

/accept/getHostedPaymentForm.php

 

Here's the errors I get when trying to bring this page up directly (which comes up blank):

 

PHP Warning: SimpleXMLElement::__construct(): namespace warning : xmlns: URI AnetApi/xml/v1/schema/AnetApiSchema.xsd is not absolute in /accept/getHostedPaymentForm.php on line 105


PHP Warning: SimpleXMLElement::__construct(): <getHostedPaymentPageRequest xmlns="AnetApi/xml/v1/schema/AnetApiSchema.xsd"> in /accept/getHostedPaymentForm.php on line 105


PHP Warning: SimpleXMLElement::__construct(): ^ in /accept/getHostedPaymentForm.php on line 105


PHP Notice: Use of undefined constant JSON_UNESCAPED_SLASHES - assumed 'JSON_UNESCAPED_SLASHES' in /accept/getHostedPaymentForm.php on line 109


PHP Warning: json_encode() expects parameter 2 to be long, string given in /accept/getHostedPaymentForm.php on line 109


PHP Fatal error: Call to undefined function curPageURL() in /accept/getHostedPaymentForm.php on line 112

 

I can log in and get to the /accept/index.php page as I detailed in my prior reply. There's a little Iframe that opens up to the left of the buttons. It appears to be the XML file for what is needed to send to your server, but there is no token there. And when I click on the Hosted Pay button, I get a modal that says, "Make Payment" and "Missing or invalid token", so it appears this sample is not sending a token back.

 

Thanks,

Mark

The sample code is something different from the sample app. Go to this GitHub page. That's a collection of sample code that you can use to see how the different method's are implemented. It would be best to clone that whole repository to the machine where you've installed the PHP SDK.

 

Each of the sample code files in that sample code repository provides an example for how to use the Authorize.Net PHP SDK to do a particular type of transaction.

I'm back with more questions. We had some other tasks taking precedence over this one of moving from SIM to Accept Hosted, so took a while to get back to this.

 

I've got Accept Hosted working for the most part, now. I get a token, get the form for entering CC info, submit that and get a completed transaction with email receipt.

 

What I'm not getting is a return of name=value pairs from the "Default Relay Response URL" set up in the Admin > Settings > Response/Receipt URLs page. SIM sends us back vars like: x_first_name, firstName, or any other custom var I create. Accept Hosted is not doing this. I was told at the beginning that Accept Hosted is the replacement for SIM, so I expect all aspects of SIM to be happening... except we can now have a mobile-friendly form.

 

Is there some trick here to get this working or some other way to do this with Accept Hosted?

 

Thanks,

Mark

When using Accept Hosted, the following parameter settings are used with the getHostedPaymentPageRequest API method. All configuration options for how the form operates and is displayed are set by sending these parameters within hostedPaymentSettings in the token request. The form's appearance and behavior are not affected by SIM payment form settings or any other settings in the merchant interface.

 

Information specific to your customer can be passed back to your server by embedding it in the continue/return URL or the cancel URL. By embedding information into the URL that is provided in the token request, your server can identify the specific customer and transaction that has been processed when the customer returns. Any name-value pairs embedded in the URL should be URL-encoded to ensure correct processing in the form request.

 

Whether the API request is sent using JSON or XML formatting, the values for all parameters sent within hostedPaymentSettings are sent as JSON objects.

 

hostedPaymentReturnOptions {"showReceipt" : true, "url":"https://yoursite.com/receipt", "urlText": "Continue", "cancelUrl": "https://yoursite.com/cancel", "cancelUrlText": "Cancel"}

 If the API request is sent using JSON formatting, the values need to be sent using backslashes to escape the quote characters.

{
"settingName": "hostedPaymentReturnOptions",
"settingValue": "{\"url\":\"https://www.yoursite.com/continue\",\"urlText\":\"Continue\",\"cancelUrl\":\"https://yoursite.com/cancel\",\"cancelUrlText\":\"Cancel\"}"
}

 

Note: If you are using an IFrame, you must send the hostedPaymentIFrameCommunicatorUrl parameter in the getHostedPaymentPageRequest method.

Powered by NexWebSites.com -
Certified Authorize.net developers

The one problem I see with using this method would be where the user leaves the page and doesn't click the button. Then my update script doesn't get run and their order isn't recorded, like what I get using SIM.

 

Is there a way to get my custom name/value pairs returned after the transaction is successful, whether or not the "continue" button is clicked or not?

 

One way is to use webhooks, which would enable you to still be notified if a transaction was processed but the customer closed the browser before following the return URL.

Powered by NexWebSites.com -
Certified Authorize.net developers

Well, I'm just not able to make sense out of the webhooks docs and it doesn't seem that it would do what I need anyway.

 

I'm using the Silent Post method and it's working very well. Only drawback is that it seems to have a limit of 20 name/value pairs you can send... but I can work with that.

 

Now, after a transaction is successful, it displays, "Thank-you for your business!" How do I edit that wording?

 

Hi @markusfergus,

 

There's no way to edit that wording, unfortunately, but I can definitely see the usefulness of such an option.

 

I'd encourage you to post this onto our Ideas Forum where others can take a look, contribute feedback, and vote for new features.

Yes, it assumes a particular type of transaction is taking place, when it could be many different things. This is not something that should be static, but editable.

 

Thanks, I'll make the suggestion.

@markusfergus -- Out of curiosity, did you have a specific issue with the Webhooks documentation? I'm eager to hear any feedback you have so we can improve its quality.

--
"Move fast and break things," out. "Move carefully and fix what you break," in.