views:

222

answers:

4

the users on a website need to have the possibility to buy/sell website's currency (credits in exchange for real money), is there some easy to use API to do this (that is usable in asp.net mvc) ?
the user can:

  • buy website's currency for real money

  • and get real money for website's currency

is this possible with paypal ?

+1  A: 

This really is nothing special. It's just the buying/returning of a virtual item which programmatically isn't any different then a tangible good or service. You can use the API of any payment gateway or third party provider to allow the user to make a purchase of credits and use the same API to issue refunds if they are selling credits back to the website.

The API you'll use will depend on the payment gateway or third party processor you choose. The options available to you will depend on what country you are in. In the US Authorize.Net's Advanced Integration Method (AIM) API is ideal for this purpose.

EDIT: If you want international try Worldpay. They have an excellent reputation and an API available for use.

John Conde
I would like something international
Omu
A: 

If you'd like to stick to paypal, have a look at this: https://www.paypal.com/IntegrationCenter/ic_micropayments.html

There is not setup fee.

here is an easy tutorial

You can create and administer 'buy this' buttons easily via the merchats menu once registered to pay pal including the amount of money to be processed. pay pal also supports refunds, which is what you want to do for 'get real money for website's currency'.

henchman
actually is not a refund, is more like one type of users pay, and another type of users receive the money
Omu
pay pal calls it 'refund', when you send money back to someone. it was just important to me, that they support sending money back via api call.
henchman
A: 

It's perfectly doable with PayPal. It's extremely easy to set up, there are great tutorials for many languages (including C# and VB.NET). The commission fees for their services are affordable, so money won't be driven out of your business. There are various options for specifying the price of your virtual currency (the user can be instructed to make fixed- or variable amount purchases).

When a purchase is made, PayPal issues an HTTP request to a URL that you specify in your control panel. In this HTTP request, it passes an ID of the purchase. All you need to do is connecting to PayPal's site through HTTPS and query the purchase details such as customer name, amount, etc. Samples are provided for many languages. You just need to negotiate with your hosting provider if they support outbound HTTPS queries.

In order to provide support for your users to get real money (in exchange for your virtual currency), it may make sense to instruct them to get a PayPal account, too. That way, you can exchange real money with no commission at all! AFAIK, other options are also available, but they are just more expensive.

On your business layer, you need to maintain support for your virtual currency. For example, when you receive an HTTP notification, you need to convert real currency (USD, Euro, etc.) received in a payment, into your own currency. Typically, you would need a database where customers are stored together with a journal of their spendings/earnings in your virtual currency.

Also, I would recommend buying an SSL certificate, since your website will need authentication and reporting in a confidential manner.

Kerido
+1 I have used PayPal this way in the past and it is incredibly easy to setup.
Leigh Shayler
A: 

I think the easiest way it will be to use paypal.
If you are wanting to accept payments, you can use Website Payments Pro or Website Payments Standard. Pro would allow you to accept credit cards directly on your site. There is also a 30 monthly charge for using pro. Standard would to accept payments, however when the buyer goes to pay they would be redirected over to PayPal to put in their information. They would actually complete payment on PayPal's site, and then they would be returned back to your site, and you could use IPN to update your system when a transaction is completed.

As far as sending payments to other users, you can either do this manually through your PayPal account, or you could use the MassPay API to send funds to other users. There are also some newer APIs that you could use to send payments to other users. You could use the Adaptive Payments API to do this.

Omu