curl --request POST \
--url https://{environment}.plugsurfing.com/drive/v1/users/{userId}/sessions/{sessionId}/payments/retry \
--header 'Content-Type: application/json' \
--header 'X-API-Key: <api-key>' \
--data '
{
"paymentMethodId": "STRIPE-7844364278189399",
"idempotencyKey": "retry-payment-001"
}
'import requests
url = "https://{environment}.plugsurfing.com/drive/v1/users/{userId}/sessions/{sessionId}/payments/retry"
payload = {
"paymentMethodId": "STRIPE-7844364278189399",
"idempotencyKey": "retry-payment-001"
}
headers = {
"X-API-Key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'X-API-Key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
paymentMethodId: 'STRIPE-7844364278189399',
idempotencyKey: 'retry-payment-001'
})
};
fetch('https://{environment}.plugsurfing.com/drive/v1/users/{userId}/sessions/{sessionId}/payments/retry', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://{environment}.plugsurfing.com/drive/v1/users/{userId}/sessions/{sessionId}/payments/retry",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'paymentMethodId' => 'STRIPE-7844364278189399',
'idempotencyKey' => 'retry-payment-001'
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"X-API-Key: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://{environment}.plugsurfing.com/drive/v1/users/{userId}/sessions/{sessionId}/payments/retry"
payload := strings.NewReader("{\n \"paymentMethodId\": \"STRIPE-7844364278189399\",\n \"idempotencyKey\": \"retry-payment-001\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("X-API-Key", "<api-key>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://{environment}.plugsurfing.com/drive/v1/users/{userId}/sessions/{sessionId}/payments/retry")
.header("X-API-Key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"paymentMethodId\": \"STRIPE-7844364278189399\",\n \"idempotencyKey\": \"retry-payment-001\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://{environment}.plugsurfing.com/drive/v1/users/{userId}/sessions/{sessionId}/payments/retry")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["X-API-Key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"paymentMethodId\": \"STRIPE-7844364278189399\",\n \"idempotencyKey\": \"retry-payment-001\"\n}"
response = http.request(request)
puts response.read_body{
"paymentStatus": "SUCCEEDED",
"statusDetails": "Payment retried successfully"
}{
"message": "Invalid request payload",
"details": [
"field X is required"
]
}{
"message": "Resource not found"
}{
"message": "Resource not found"
}{
"message": "Resource not found"
}Retry session payment
Use this endpoint to retry an unsuccessful session payment
curl --request POST \
--url https://{environment}.plugsurfing.com/drive/v1/users/{userId}/sessions/{sessionId}/payments/retry \
--header 'Content-Type: application/json' \
--header 'X-API-Key: <api-key>' \
--data '
{
"paymentMethodId": "STRIPE-7844364278189399",
"idempotencyKey": "retry-payment-001"
}
'import requests
url = "https://{environment}.plugsurfing.com/drive/v1/users/{userId}/sessions/{sessionId}/payments/retry"
payload = {
"paymentMethodId": "STRIPE-7844364278189399",
"idempotencyKey": "retry-payment-001"
}
headers = {
"X-API-Key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'X-API-Key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
paymentMethodId: 'STRIPE-7844364278189399',
idempotencyKey: 'retry-payment-001'
})
};
fetch('https://{environment}.plugsurfing.com/drive/v1/users/{userId}/sessions/{sessionId}/payments/retry', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://{environment}.plugsurfing.com/drive/v1/users/{userId}/sessions/{sessionId}/payments/retry",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'paymentMethodId' => 'STRIPE-7844364278189399',
'idempotencyKey' => 'retry-payment-001'
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"X-API-Key: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://{environment}.plugsurfing.com/drive/v1/users/{userId}/sessions/{sessionId}/payments/retry"
payload := strings.NewReader("{\n \"paymentMethodId\": \"STRIPE-7844364278189399\",\n \"idempotencyKey\": \"retry-payment-001\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("X-API-Key", "<api-key>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://{environment}.plugsurfing.com/drive/v1/users/{userId}/sessions/{sessionId}/payments/retry")
.header("X-API-Key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"paymentMethodId\": \"STRIPE-7844364278189399\",\n \"idempotencyKey\": \"retry-payment-001\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://{environment}.plugsurfing.com/drive/v1/users/{userId}/sessions/{sessionId}/payments/retry")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["X-API-Key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"paymentMethodId\": \"STRIPE-7844364278189399\",\n \"idempotencyKey\": \"retry-payment-001\"\n}"
response = http.request(request)
puts response.read_body{
"paymentStatus": "SUCCEEDED",
"statusDetails": "Payment retried successfully"
}{
"message": "Invalid request payload",
"details": [
"field X is required"
]
}{
"message": "Resource not found"
}{
"message": "Resource not found"
}{
"message": "Resource not found"
}Authorizations
API key for authentication
Body
request
Request payload to retry or initiate a session payment.
The id of the payment option
"STRIPE-2059519182987632"
The URL to which your customer will be redirected after they complete or cancel their payment authentication. If you prefer to redirect them to a mobile application, you can alternatively provide an application URI scheme.
"https://landing.page.after.3ds.authentication"
Response
Response payload describing the payment attempt result.
Status of the payment attempt.
SUCCEEDED, FAILED, REQUIRES_3DS_AUTHENTICATION The client secret to be used when user authentication is required for the payment to be accepted. E.g. When the payment status have a value of REQUIRES_3DS_AUTHENTICATION. Ignore otherwise.
"pi_1DtBRR2eZvKYlo2CmCVxxvd7_secret_cWsUkvyTOjhLKh5Wxu61nYc0i"