Client Side:

<form action="your-server-side-code" method="POST">
<script
    src="https://checkout.stripe.com/checkout.js" class="stripe-button"
    data-key="YOUR_API_KEY"
    data-image="https://app.paymart.it/img/logo-2-stripe.png"
    data-name="NOME NEGOZIO"
    data-description="DESCRIZIONE TRANSAZIONE"
	data-email="EMAIL_CLIENTE"
    data-currency="EUR"
    data-amount="9900" //SENZA SEPARATORE DECIMALE (99.00 si scrive 9900)
	data-label="PAGAMENTO SICURO"
    data-locale="auto">
</script>
</form>

 

Server Side:

import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.net.HttpURLConnection;
import java.io.OutputStream;
import java.net.URL;

public class Main {
    public static void main(String[] args) {
        try {
            URL url = new URL("https://app.paymart.it/API/v1.0/REST/checkout");
            HttpURLConnection conn = (HttpURLConnection) url.openConnection();

            conn.setRequestProperty("secret", "SECRET_KEY");

            conn.setRequestMethod("POST");

            conn.setRequestProperty("Accept", "application/json");
            conn.setRequestProperty("Content-type", "application/json");
            conn.setDoOutput(true);

			String token=request.getParameter("stripeToken");

            String payload = "{" + 
              "    \"demo\": \"0\", " + // 1 per ambiente DEMO, 0 per LIVE mode
              "    \"token\": \""+token+"\", " +
              "    \"amount\": \"99.00\", " + 
              "    \"currency\": \"EUR\", " +
			  "    \"email\": \"EMAIL_CLIENTE\", " +
              "    \"description\": \"Descrizione\", " + 
              "}";

            OutputStream os = conn.getOutputStream();
            os.write(payload.getBytes());
            os.flush();

System.out.println("JSON SENT - RESPONSE CODE: "+conn.getResponseCode());
            if (conn.getResponseCode() != 200) {
                // Print the possible error contained in body response
                String error = "";
                String output;
                BufferedReader errorbuffer = new BufferedReader(new InputStreamReader(conn.getErrorStream(), "UTF-8"));
                while ((output = errorbuffer.readLine()) != null) {
                    error += output;
                }
                System.out.println("Error! HTTP error code : " + conn.getResponseCode() +
                                   ", Body message : " + error);
                throw new RuntimeException("Failed : HTTP error code : " + conn.getResponseCode());
            }

			int status = conn.getResponseCode();
			BufferedReader br =
                new BufferedReader(new InputStreamReader(conn.getInputStream()));

            String graph = "";
            String output;
            while ((output = br.readLine()) != null) {
                graph += output;
            }
            // You can parse the response using Google GSON or similar.
            // MyObject should be a class that reflect the JSON
            // structure of the response
			org.json.JSONObject resp = new org.json.JSONObject(graph);

			out.println(resp);

            conn.disconnect();
        }
        catch (Exception e) {
            e.printStackTrace();
        }
    }
}
$token=$_GET['stripeToken'];

$payload = '{' . 
  '    "demo": "0", ' . // 1 per DEMO mode, 0 per LIVE mode
  '    "token": "".$token."", ' .
  '    "amount": "99.00", ' . 
  '    "currency": "EUR", ' .
  '    "email": "EMAIL_CLIENTE", ' .
  '    "description": "Descrizione", ' .
  '}';

$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, 'https://app.paymart.it/API/v1.0/REST/checkout');
curl_setopt($ch, CURLOPT_HTTPHEADER, array(
    'Content-type: application/json',
    'secret: SECRET_KEY'
));
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS, $payload);
$response = curl_exec($ch);
$info = curl_getinfo($ch);
curl_close($ch);

if ($info['http_code'] != 201) {
    echo('Error! http code: ' . $info['http_code'] . ', body message: ' . $response);
}
else {

    $obj = json_decode($response);
    print_r($obj);
}
// Uses https://github.com/request/request
// npm install [-g] request

var request = require('request');
// Get the payment token ID submitted by the form:
const token = request.body.stripeToken; // Using Express

request({
    url: 'https://app.paymart.it/API/v1.0/REST/checkout',
    method: 'POST',
    headers: { 'secret' : 'SECRET_KEY' },

    json: true,
    body:     {
        "demo": "0", // 0 per ambiente TEST, 1 in produzione  
        "token": token, 
        "amount": "99.00",
		"currency": "EUR", 
        "email": "EMAIL_CLIENTE", 
        "description": "descrizione"
    },

    callback: function (error, responseMeta, response) {
        if (!error && responseMeta.statusCode == 201) {

        }
        else {
            console.log('Error! http code: ' + responseMeta.statusCode + ', body message: ' + response)
        }
    }
});

Response:

{
    "charge" : "success",    "//success or failed"
    "charge_id" : "ch_19nmLVKSWltuOeTEmtpBkLko", //success only
    "timestamp" : "2018-11-13 10:00:00"                  
}