Reply
Highlighted
Member
Posts: 3
Registered: ‎07-19-2011
Accepted Solution

How to retrieve fp_sequence from response = AuthorizeNetSIM(login,md5) call - emergency help!

Unfortunately I am under a deadline today.  Your help would be invaluable.

I used the Authorize.net examples (PHP) SIM.

 

The call to Authorize is

AuthorizeNetDPM::getCreditCardForm($amount, $fp_sequence,$relay_response_url,$api_login_id, $transaction_key);

and I have the customer's member/ID number in "$fp_sequence"

 

The return from Authorize uses   $response = new AuthorizeNetSIM($api_login_id, $md5_setting);

And from that call the example code pulls out data values like

      $response->transaction_id

      $response->response_reason_text

 

My question:  what is the  "fp_sequence" value referenced as when at this stage?

I tried  $response->fp_sequence  but it comes back null

 

I just want to pull out the fp_sequence value in the return and use the existing code/library calls that were used in Authorize's examples.  Help!  Thank you.


 


Accepted Solutions
Highlighted
Solution
Accepted by topic author JayP
‎08-21-2015 01:58 AM
Regular Contributor
Posts: 72
Registered: ‎07-06-2011

Re: How to retrieve fp_sequence from response = AuthorizeNetSIM(login,md5) call - emergency help!

[ Edited ]

If you really need to get that fp_sequence back from Authnet and they aren't sending it,  you could try setting up a merchant defined field in the resulting form.

 

Set it to whatever you want to call it,  make it a hidden field, and populate it with the value of fp_sequence

 

Section 3 -> Customizing the Hosted Payment Form -> Merchant Defined Fields is wherr to get the info on that (http://developer.authorize.net/guides/SIM/)

 

At the very least,  you can use that to ignore fp_sequence completely because whatever the value in fp_sequence actually is,  you can set it to come back to you with some other name.. I.E.   x_my_fp_sequence_copy = fp_sequence.

 

Then, instead of looking for the value of fp_sequence (which is null), you get the 'real value' by pulling x_my_fp_sequence_copy (or whatever you named it)

 

:)

WHeis

 

View solution in original post

Highlighted
Solution
Accepted by topic author JayP
‎08-21-2015 01:58 AM
Member
Posts: 3
Registered: ‎07-19-2011

Re: How to retrieve fp_sequence from response = AuthorizeNetSIM(login,md5) call - emergency help!

Thank you Wheis.  That is what I ended up doing and it's working!!!!!

 

Specifically I edited the   anet_php_sdk/lib/AuthorizeNetDPM.php file...went down to where the form is that is asking for customer's address and I added a hidden field.  Specifically I added the type=hidden field named  "x_hiddenj" and had its value='$fp_sequence'   As I reviewed the var dump coming from the reply side it did list it amongst the 67 or so variables.  The last twist was that I had to reference it as  $response->hiddenj   rather than $response->x_hiddenj.

 

Now that I can reference the "member #" that I passed to Authorize on return...now I can look up that member in my database and update their database status and look up their email and send them an ack email.  Back on track.

 

Thank you WHeis for all your help!!!!!!   Hopefully our email discussion will help others in the future needing the same issue.

View solution in original post


All Replies
Highlighted
Regular Contributor
Posts: 72
Registered: ‎07-06-2011

Re: How to retrieve fp_sequence from response = AuthorizeNetSIM(login,md5) call - emergency help!

If you are able to use $response->transaction_id  to get the value of the transaction_id,  but get no value with $response->fp_sequence,  it's possible that AuthNet isn't passing that back to you at all.  

 

In the example docs, I see a line that reads:

 

$redirect_url .= '?response_code=1&transaction_id=' .
$response->transaction_id;

That appears to be telling AuthNet not only where to send the customer when they are done,  but also what information to return to you at the same time.

 

Maybe if you change it to this:

$redirect_url .= '?response_code=1&transaction_id=' .
$response->transaction_id .
'\&fp_sequence=' .
$response->fp_sequence;

 

Mabye that will do the trick.    The only line in that code is the one that reads '\&fp_sequence='.

I'm not sure if you have to put a backslash before the ampersand or not..  I think you do in order to escape it, but maybe not (PhP noob here).

 

 

If that doesn't do it, and there is still a possibility that AuthNet actually is passing the fp_sequence value back to you;

I've only been using PhP for a couple days, and am unsure as to the specific use of each function that could pull out a variable value,   but maybe one of these will work?

 

 

htmlentities($_GET['fp_sequence')

 

htmlspecialchars($_POST["fp_sequence"])

 

urlencode($_POST["fp_sequence"])

 

 

You can give them a try and see if they work (no promises hehe).

 

WHeis

 

Highlighted
Member
Posts: 3
Registered: ‎07-19-2011

Re: How to retrieve fp_sequence from response = AuthorizeNetSIM(login,md5) call - emergency help!

Thank you WHeis,

I appreciate what you've put together.  Your examples..everything.  There is the two step process after it comes back from Authorize - the first step is the relay_response program where I was trying to disect the $response object and pull out fp_sequence.  If I can get that value at that point in the cycle that would resolve it.

 

I did just try doing a     var_dump(get_object_vars($response))   command inside the relay_response program and I found that at that point  $response object has a LOT of data fields but none are/contain the  fp_sequence value.  They do include the purchaser's name, address... 67 different fields in fact.   But none being fp_response or holding the value I put into that field when I first called Authorize.

 

I'll also try dumping all the $_POST variables as you suggest.

 

So I appreciate your help on this...it seems we are very close...

I'm also going to try seeing if I can tweak the SDK form and include a hiddent field...maybe that will come back as a parameter in the $response object.

 

Thank you WHeis

Highlighted
Solution
Accepted by topic author JayP
‎08-21-2015 01:58 AM
Regular Contributor
Posts: 72
Registered: ‎07-06-2011

Re: How to retrieve fp_sequence from response = AuthorizeNetSIM(login,md5) call - emergency help!

[ Edited ]

If you really need to get that fp_sequence back from Authnet and they aren't sending it,  you could try setting up a merchant defined field in the resulting form.

 

Set it to whatever you want to call it,  make it a hidden field, and populate it with the value of fp_sequence

 

Section 3 -> Customizing the Hosted Payment Form -> Merchant Defined Fields is wherr to get the info on that (http://developer.authorize.net/guides/SIM/)

 

At the very least,  you can use that to ignore fp_sequence completely because whatever the value in fp_sequence actually is,  you can set it to come back to you with some other name.. I.E.   x_my_fp_sequence_copy = fp_sequence.

 

Then, instead of looking for the value of fp_sequence (which is null), you get the 'real value' by pulling x_my_fp_sequence_copy (or whatever you named it)

 

:)

WHeis

 

Highlighted
Solution
Accepted by topic author JayP
‎08-21-2015 01:58 AM
Member
Posts: 3
Registered: ‎07-19-2011

Re: How to retrieve fp_sequence from response = AuthorizeNetSIM(login,md5) call - emergency help!

Thank you Wheis.  That is what I ended up doing and it's working!!!!!

 

Specifically I edited the   anet_php_sdk/lib/AuthorizeNetDPM.php file...went down to where the form is that is asking for customer's address and I added a hidden field.  Specifically I added the type=hidden field named  "x_hiddenj" and had its value='$fp_sequence'   As I reviewed the var dump coming from the reply side it did list it amongst the 67 or so variables.  The last twist was that I had to reference it as  $response->hiddenj   rather than $response->x_hiddenj.

 

Now that I can reference the "member #" that I passed to Authorize on return...now I can look up that member in my database and update their database status and look up their email and send them an ack email.  Back on track.

 

Thank you WHeis for all your help!!!!!!   Hopefully our email discussion will help others in the future needing the same issue.