Forum Moderators: coopster

Message Too Old, No Replies

transfering data from another site and back again

         

phazei

10:30 am on Jul 17, 2006 (gmt 0)

10+ Year Member



I'm trying to get a payment system working on my site.

I'm getting stuck on how to transfer data around.
I need to send some data to the payment site, and then it will post a confirmation to processing page that the user never goes to.

The credit card site only needs the total, but I need a bit more info to add the purchase to the users account.

There were 3 ways I was thinking about going about doing it.

The first way I was thinking about doing it I'd still like to use, but I'm not sure if it could be problematic at all.
I was going to pass the session ID to the credit card site, using a passthrough field they allow, and just reopen the session using that ID on the page that gets the confirmation. I could just store all the info in the session right before the user goes to pay. Is that a bad idea? Something tells me it might be.

The other idea was to just use the custom passthrough field and put all the info inside it. But it doesn't store enough info, only 255 characters, which isn't enough after already including a confirmatory md5 in the passthrough field.

The last option which I though might be best was to make a new table and just use it for temp data.
3 columns, userID, name, value... and maybe date so a chron job could go through and delete all data 24hours old.
But then I found out my server has MySQL4 and not 4.1 so I couldn't use "ON DUPLICATE KEY UPDATE" and it's way to much code to do an individual mysql_query for every single variable to check if it exists to see if i should insert or update...

I was looking for tip or suggestions for a little help with this, i feel stuck.

Thanks,
Adam

phazei

10:42 am on Jul 17, 2006 (gmt 0)

10+ Year Member



Forgot to mention,

With the database idea, I didn't want a 'userID' to have to entries with the same 'name' value. So userID-name is a linked UNIQUE.

omoutop

11:17 am on Jul 17, 2006 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



Personal opinion follows....

if you can pass some kind of unique id, then you are set.... as soon as the user returns to your site, you can retrieve the stored data, plus an accept/failure transaction flag/value from bank/psp. At that stage you only need to update your db with the accept/failed value.

Perhaps some verification need may arise (for eaxmple the stored value of cost matches the bank's return value? the currency code? the merchant id? the shop id?), but you should be ok with the first scenario you mentioned.