English 中文(简体)
How to develop a manual money-transfer interface for my website?
原标题:

I have developed a website. Users need to prepay for his projects/tasks. Now I want to provide a way which a user can recharge his financial account on my website. Suppose the financial account of my website is a moneybookers account and a user can send money to this account manually, how could I develop the interface? You know,many users will send money to the public account of the website, how can I determine the source where a sum of money come from? How can I make sure I won t add his account balance twice for only one money-transfer? If my question is not clear, please don t hesitate to ask for clarification.

Suppose you have an account on my website, it is yourname@example.com. And when you create the account, the balance is $0. Now you need to deposit money in yourname@example.com. You can do it manually. You just pay me $200, and notice that you have sent me $200, so I will update your balance to $200.

I don t use their API. If I use their API, this process is done automatically by computer program. I mean I want to do it manually, by hand.

最佳回答

I am sure that whatever moneybookers/paypal/neteller/whatever API you use, this is a problem for the financial institution, not you, as long as you stick to using their API and don t try to re-invent the wheel.

问题回答

to my understanding, you have a site that accepts money proccessed via a payment gateway. The gateway sends a notification to a specified url at the end of a transaction with the transaction results. You then take these results and update your system with a new balance. Your fear is that a client can manually call the specified url that notifies your system twice.

If this is the case, here is my suggestion:

Your payment gateway should already stop someone from manually calling notification urls by implimenting consistant keys which are made using the transaction data your account details with them and a private key. Secondly you should manage you database by updating and storing your own transaction status s.

For instance, you have a transactions table with a uniqueid field as a primary key, amount, date/time, foriegn key linking to a users table and a foriegn key linking to a status table. Your status table will comprise of "inProgress", "Cancelled" and "Complete".

As soon as you send the transaction through to the payment gateway, create the transaction in your Transactionns table with a status of "inProgress". When you get the notification return to update your system run this logic:

if(returnedStatus == "Completed" && status = "inProgress")
(
  status = "Completed";
  //update balance
)
elseif(returnedStatus == "Cancelled" && status != "Completed")) 
{
  status = "Cancelled";
  //display cancelled message
}

This will update the account balance if the transaction is still in progress, not update a the account if it is already done and do nothing to the account balance if it was cancelled for some reason.

PS: have a looke at monsterpay as a gateway www.monsterpay.com





相关问题
API HTTPOK 200 Postback handler from Ruby App

I m building a sinatra Ruby app that interacts with Jambool Social Gold API (a virtual currency platform). After a transaction is complete (the user purchases points) Jambool sends a "postback" to "...

Safely getting card number for payment gateway

I have a payment gateway api for BluePay. My application is in PHP. I am able to process a transaction with code similar to this: bp->process(1111111111111111,.....) with 111111111111111 being the ...

ecommerce stock management with external payment gateway

this question is similar to this one but with a twist (so the answer accepted for the older question is not valid in the following scenario) i have a site for selling tickets (PHP/MYSQL). Suppose i ...

Online credit card payment processing on behalf of others

Does anyone know a way to facilitate payment between two parties via our website similar to how eBay facilitates payments between sellers and buyers, with buyers using their credit cards to make the ...

Getting started with a project using Zend Framework

Ok, I ve got Zend all set up and my hello world pages working. Personally, I d rather code this from scratch, but I m trying to find out how to use Zend to save time when making similar projects over ...

热门标签