Log In
PHP & HTML
WordPress
Node
Python
Introduction:
Spaceremit Api done with four satges:
A-User pay form that will direct him to our pay page .
B-User will pay and return to your site .
C-We will send notify to your "notify_url".
D-At "notify_url" page you can triger commandes after pay.
Pay form:
<?php
$my_email ="[email protected]" ;
$return_to ="http://yourwebsite.com/returnto" ;
$notify_page ="http://yourwebsite.com/notify_page.php" ;
$custom = "example";
?>


<form action="https://spaceremit.com/apipay/" method="POST" accept-charset="utf-8" >
<input type="hidden" name="cmd" value="_xclick">
<input type="hidden" name="business" value="<?php echo htmlspecialchars( $my_email); ?>">
<input type="hidden" name="currency_code" value="USD">
<input type="hidden" name="item_name" value="Recharge">
<input type="hidden" name="return" value="<?php echo htmlspecialchars( $return_to); ?>">
<input type="hidden" name="notify_url" value="<?php echo htmlspecialchars( $notify_page); ?>">
<input type="hidden" name="custom" value="<?php echo htmlspecialchars( $custom );?>">

<input type="hidden" name="sp_api_skip_register" value="true">
<input type="text" name="sp_api_user_fullname">
<input type="email" name="sp_api_user_email">

<input type="number" name="amount" id="payPrice" required="required" />
<input type="submit" id="pay" value="pay"/>

</form>
At "notify_page.php":
<?php
if(!empty($_POST["sender_email"]) && !empty($_POST["reciver_email"]) && !empty($_POST["payment_code"]) && !empty($_POST["total_amount"]) && !empty($_POST["date"]) && isset($_POST["tax"]) && !empty($_POST["status"]) ){

$myarrayy = $_POST ;
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL,"http://spaceremit.com/api/");
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS,http_build_query($myarrayy));
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
$server_output = curl_exec($ch);
curl_close ($ch);

if ($server_output == "VALID_PAYMENT") {

//do some thing ,this is real payment
echo "OK ";


}else {
//payment invalid
}

} ?>
Data responses:
Name Values
sender_email Email of sender
reciver_email Email of reciver
payment_code Payment id or code
total_amount Total amount payed with taxes
date Date of payment
tax Taxes of payment
status We send one of three type status "COMPLETED" , "PENDING" or "REFUSED".
custom If you added a custom value we will return it .
additional_tax This is additional taxes.
origin_amount The main amount that paid by buyer.
Api Login:
We will send the following data ,if your account is allowed:

-The buyer is free to decide whether he wants to give access to his account or not.
-After he agrees, we send the data below to "notify_url".
Name Values
ACCESS_TOKEN The code that is sent at each payment for automatic login.
EMAIL User Email.
DATE_OF_REGISTER Date of registration .
You must send this data with each "payment form".
Name Values
sp_api_user_access_token The code that is sent at each payment for automatic login.
Version:
How integrate woocomerce step by step:
  • Download plugin
  • Get SAC
  • Setup api keys
  • Completed
Download and setup a Spaceremit plugin
How to do that
Setup Your Spaceremit Activation Code
Login to display code.
How do that
How do that
Api Integration Completed
You have successfully Added Website .
Soon...
Soon...
Soon...
Soon...
title
cancel
confirm