Transfer Flow

Overview

In order to transfer Ven from a user's account, you first need to authenticate them with your app and obtain an access_token.

Once an access_token has been obtained, you're ready to initialise a request_transfer.

Initialise a request_transfer

When a user authenticates & grants your app access to their Ven account, they set a confirmation limit for transactions.
Provided there is sufficient credit, any requests for a transfer amount under this limit are accepted automatically, any above it require additional confirmation.

i. Automatic acceptance

A transfer request where all arguments are valid, the user has sufficient balance, and the amount is below the confirmation limit will be automatically accepted.

This acceptance will come in the form of the response given to your request_transfer call:

{"request_key":"8df6e4c0240365e425d6cf4839e5266e","code":987654,"expires":1292790082}

ii. Redirect for acceptance

For various reasons, the transfer may not be automatically accepted.
In this case, you will need to redirect the user to Ven Currency in order for them to top up/accept the request:

{"request_key":"8df6e4c0240365e425d6cf4839e5266e","code":false,"failure_code":210,
"failure_message":"Insufficient Balance","expires":1292790082}

Now, use the request_key and redirect the user to:

https://www.vencurrency.com/confirm/transfer/?request_key=8df6e4c0240365e425d6cf4839e5266e

If and when the user accepts the request/tops up, they will be redirected to the callback_url specified in the request_transfer call

http://myapp.com/accept/?request_key=8df6e4c0240365e425d6cf4839e5266e&code=987654&status=OK

Note the variables request_key and code appended to the URL. Use them.

Using a request_key & code to charge

Now you have a request_key and a code, either through automatic acceptance or redirection, the transfer can be finalised: 'charged'

1. Create a hash

Concatenate your request_key, code, and app client_secret then take the md5 of the result:

<?php 
	$hash = md5($request_key . $code . $client_secret); 
?>

2. Call the /ven/charge method

Follow the instructions on the method page.

Both the recipient and sender will receive an email confirming the success of the transaction