Reply
Member
Posts: 5
Registered: ‎03-06-2012
Accepted Solution

Transferring data to hosted form (SIM)

I'm trying to use a number of payment methods for a webapp - and I'm using only PHP... no javascript whatsoever.

 

My problem:

 

The user has already selected an item - only one is allowed at a time, so it's a really simple 'shopping cart'. 

He/she selects from a variety of payment options - e.g. VISA, Mastercard, Bank Transfer, etc. After this, the user is expected to conclude the transaction using the appropriate payment method by clicking a button at the bottom of the form that says 'Continue'.  For example, if the user clicked 'Visa' or 'Mastercard', they would be passed on to authorize.net, but there are also options for paypal, etc.

 

I can't use the 'Click to confirm payment' button suggested in the SIM manual, because it assumes authorize.net is the only method I'm using, and AIM isn't an option because the requirement is that the information is not captured on our servers.

 

Can I use cURL/a stream method to post the information and then redirect to the SIM form? Right now, when I redirect, I get a blank form, because it's considered a different transaction. What's the unique identifier I use to recall the data that was posted?

 

Thanks!

 

 

 


Accepted Solutions
Solution
Accepted by topic author aoa4eva
‎08-21-2015 01:58 AM
Posts: 1,609
Topics: 15
Kudos: 201
Solutions: 121
Registered: ‎06-23-2011

Re: Transferring data to hosted form (SIM)

Screen 3 would look at the payment option chosen in screen 2, detect that it's appropriate for Authorize.net, generate the SIM form with all necessary information as hidden fields, then auto-submit on page load:

 

<body onload="document.myformname.submit();">

The form could also have a submit button for if they have Javascript turned off, but for most people it should flash by too fast to be seen.

View solution in original post


All Replies
Posts: 1,609
Topics: 15
Kudos: 201
Solutions: 121
Registered: ‎06-23-2011

Re: Transferring data to hosted form (SIM)

Are you collecting credit card data through your form? If you are, you shouldn't be - SIM does that for you. If you aren't, then I'm not seeing the problem - you can submit to a second page which generates an appropriate form with the SIM fields as hidden fields and auto-submits using Javascript, or if you have something against Javascript, you can have the shopping cart page generate the same thing and just have a button for "Click here to pay with x" (assuming you know already the amount they're going to pay)

Member
Posts: 5
Registered: ‎03-06-2012

Re: Transferring data to hosted form (SIM)

No, I'm not collecting any credit card information - I'm letting SIM do that for me.

 

I'm passing the application login id, transaction key, and fingerprint at the very least. I'd also like to put in a description and amount. I know how to do this in theory - the difficult part is getting the form to display the information.

 

Since there's only one item in the shopping cart, this is the flow:

 

Screen 1:

- Select item to pay for

 

Screen 2:

Select payment options (Mastercard, Visa, Bank transfer, etc.)

 

Screen 3:

A screen that has nothing on it except one button saying 'Click here to pay using the method you've just selected' (I want to avoid this because the user already has an item description of the one item in the shopping cart on screen 2 - amount and all)

 

Screen 4:

Sim form with required authentication information required by authorize.net (hidden variables), the item description and amount to be paid.

 

This would be the only part of the application that has javascript if I have to autosubmit. Nothing against javascript in theory, but I want to know if there's an alternative first, since people can turn javascript off.

 

Moneybookers has the option to post data to the form and retrieve the details into the form with a session id variable. I tried it and it works well. Is there something similar that I can use? The client insisted on authorize.net because it can 'speak directly' to credit/debit cards.

 

I've seen in earlier posts that authorize.net doesn't have SIM sessions - has this changed?

 

Thanks!

 

 

 

 

Solution
Accepted by topic author aoa4eva
‎08-21-2015 01:58 AM
Posts: 1,609
Topics: 15
Kudos: 201
Solutions: 121
Registered: ‎06-23-2011

Re: Transferring data to hosted form (SIM)

Screen 3 would look at the payment option chosen in screen 2, detect that it's appropriate for Authorize.net, generate the SIM form with all necessary information as hidden fields, then auto-submit on page load:

 

<body onload="document.myformname.submit();">

The form could also have a submit button for if they have Javascript turned off, but for most people it should flash by too fast to be seen.

Member
Posts: 5
Registered: ‎03-06-2012

Re: Transferring data to hosted form (SIM)

That means that Screen 3 is still in the PHP only flow (which is really uncomfortable). 

I didn't get an answer about the session variables, though. No such thing with authorize.net?

Posts: 1,609
Topics: 15
Kudos: 201
Solutions: 121
Registered: ‎06-23-2011

Re: Transferring data to hosted form (SIM)

You can pass your session ID as a custom field, then load that session from the relay response page - which already has access to all the data passed back from Authorize.net. Just turn on relay response using the passed variable for that, set up a relay response page, and specify the relay response page URL in your control panel.

 

What exactly are you trying to do with the session?

Member
Posts: 5
Registered: ‎03-06-2012

Re: Transferring data to hosted form (SIM)

Not a session ID for me - one FROM authorize.net.

 

So here's what happens with the other payment method I'm using:

 

I cURL to a remotely hosted form which returns a session ID with the information that I'm putting into the form. The session lasts for 15 minutes, during which time other things can be done on the site, the user can have a cup of coffee, etc.

 

And then, when I feel like it (within 15 minutes), I call the webadress, passing the session ID over the URL, and I get a secure hosted form, SIM style, with pre-popluated values. 

 

Since I was using that method, I was wondering whether it was applicable to authorize.net as well. However, the workaround I managed to agree on:

 

Use submits instead of radio buttons on the payment selection form, so I can make a form for each payment method (and therefore use the 'click here to make payment' button I wasn't too fond of before).

 

The submits will actually be images, so you have colourful logos to click on (if Images aren't disabled), and text as an alternative. 

 

And I don't have to use Javascript. :catvery-happy:

 

 

 

 

 

 

 

 

Posts: 1,609
Topics: 15
Kudos: 201
Solutions: 121
Registered: ‎06-23-2011

Re: Transferring data to hosted form (SIM)

Whatever works.