Frontend
Process a campaign checkout
POST
/
frontend
/
checkout
/
campaign
/
{client_id}
/
{program_id}
/
{session_id}
Process a campaign checkout
curl --request POST \
--url https://api.helpyousponsor.com/v1/frontend/checkout/campaign/{client_id}/{program_id}/{session_id} \
--header 'Content-Type: application/json' \
--data @- <<EOF
{
"amount": "100",
"email": "email@email.com",
"frequency": "Every Month",
"method_signup": "3",
"cardExpiry": "0228",
"cardHolderName": "John Doe",
"cvv": "123",
"donation_amount": "100",
"expiryMonth": "02",
"expiryYear": "2028",
"firstName": "John",
"lastName": "Doe",
"number": "4242424242424242",
"paying_processing": "1",
"paymentMethod": "credit_card",
"processingFee": "['3']"
}
EOFimport requests
url = "https://api.helpyousponsor.com/v1/frontend/checkout/campaign/{client_id}/{program_id}/{session_id}"
payload = {
"amount": "100",
"email": "email@email.com",
"frequency": "Every Month",
"method_signup": "3",
"cardExpiry": "0228",
"cardHolderName": "John Doe",
"cvv": "123",
"donation_amount": "100",
"expiryMonth": "02",
"expiryYear": "2028",
"firstName": "John",
"lastName": "Doe",
"number": "4242424242424242",
"paying_processing": "1",
"paymentMethod": "credit_card",
"processingFee": "['3']"
}
headers = {"Content-Type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({
amount: '100',
email: 'email@email.com',
frequency: 'Every Month',
method_signup: '3',
cardExpiry: '0228',
cardHolderName: 'John Doe',
cvv: '123',
donation_amount: '100',
expiryMonth: '02',
expiryYear: '2028',
firstName: 'John',
lastName: 'Doe',
number: '4242424242424242',
paying_processing: '1',
paymentMethod: 'credit_card',
processingFee: '[\'3\']'
})
};
fetch('https://api.helpyousponsor.com/v1/frontend/checkout/campaign/{client_id}/{program_id}/{session_id}', 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://api.helpyousponsor.com/v1/frontend/checkout/campaign/{client_id}/{program_id}/{session_id}",
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([
'amount' => '100',
'email' => 'email@email.com',
'frequency' => 'Every Month',
'method_signup' => '3',
'cardExpiry' => '0228',
'cardHolderName' => 'John Doe',
'cvv' => '123',
'donation_amount' => '100',
'expiryMonth' => '02',
'expiryYear' => '2028',
'firstName' => 'John',
'lastName' => 'Doe',
'number' => '4242424242424242',
'paying_processing' => '1',
'paymentMethod' => 'credit_card',
'processingFee' => '[\'3\']'
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json"
],
]);
$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://api.helpyousponsor.com/v1/frontend/checkout/campaign/{client_id}/{program_id}/{session_id}"
payload := strings.NewReader("{\n \"amount\": \"100\",\n \"email\": \"email@email.com\",\n \"frequency\": \"Every Month\",\n \"method_signup\": \"3\",\n \"cardExpiry\": \"0228\",\n \"cardHolderName\": \"John Doe\",\n \"cvv\": \"123\",\n \"donation_amount\": \"100\",\n \"expiryMonth\": \"02\",\n \"expiryYear\": \"2028\",\n \"firstName\": \"John\",\n \"lastName\": \"Doe\",\n \"number\": \"4242424242424242\",\n \"paying_processing\": \"1\",\n \"paymentMethod\": \"credit_card\",\n \"processingFee\": \"['3']\"\n}")
req, _ := http.NewRequest("POST", url, payload)
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://api.helpyousponsor.com/v1/frontend/checkout/campaign/{client_id}/{program_id}/{session_id}")
.header("Content-Type", "application/json")
.body("{\n \"amount\": \"100\",\n \"email\": \"email@email.com\",\n \"frequency\": \"Every Month\",\n \"method_signup\": \"3\",\n \"cardExpiry\": \"0228\",\n \"cardHolderName\": \"John Doe\",\n \"cvv\": \"123\",\n \"donation_amount\": \"100\",\n \"expiryMonth\": \"02\",\n \"expiryYear\": \"2028\",\n \"firstName\": \"John\",\n \"lastName\": \"Doe\",\n \"number\": \"4242424242424242\",\n \"paying_processing\": \"1\",\n \"paymentMethod\": \"credit_card\",\n \"processingFee\": \"['3']\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.helpyousponsor.com/v1/frontend/checkout/campaign/{client_id}/{program_id}/{session_id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Content-Type"] = 'application/json'
request.body = "{\n \"amount\": \"100\",\n \"email\": \"email@email.com\",\n \"frequency\": \"Every Month\",\n \"method_signup\": \"3\",\n \"cardExpiry\": \"0228\",\n \"cardHolderName\": \"John Doe\",\n \"cvv\": \"123\",\n \"donation_amount\": \"100\",\n \"expiryMonth\": \"02\",\n \"expiryYear\": \"2028\",\n \"firstName\": \"John\",\n \"lastName\": \"Doe\",\n \"number\": \"4242424242424242\",\n \"paying_processing\": \"1\",\n \"paymentMethod\": \"credit_card\",\n \"processingFee\": \"['3']\"\n}"
response = http.request(request)
puts response.read_body{
"status": "success",
"message": "Success: Donation Added",
"redirect": "/frontend/donations_page/1/1"
}{
"status": "error",
"message": "Error: No Donation Added",
"redirect": "/frontend/donations_page/1/1"
}{
"message": "Validation error",
"errors": {}
}Path Parameters
The ID of the client
The ID of the program
The ID of the session
Body
application/json
Data needed to process a campaign checkout
Example:
"100"
Example:
"email@email.com"
Example:
"Every Month"
Example:
"3"
Example:
"0228"
Example:
"John Doe"
Example:
"123"
Example:
"100"
Example:
"02"
Example:
"2028"
Example:
"John"
Example:
"Doe"
Example:
"4242424242424242"
Example:
"1"
Example:
"credit_card"
Example:
"['3']"
⌘I
Process a campaign checkout
curl --request POST \
--url https://api.helpyousponsor.com/v1/frontend/checkout/campaign/{client_id}/{program_id}/{session_id} \
--header 'Content-Type: application/json' \
--data @- <<EOF
{
"amount": "100",
"email": "email@email.com",
"frequency": "Every Month",
"method_signup": "3",
"cardExpiry": "0228",
"cardHolderName": "John Doe",
"cvv": "123",
"donation_amount": "100",
"expiryMonth": "02",
"expiryYear": "2028",
"firstName": "John",
"lastName": "Doe",
"number": "4242424242424242",
"paying_processing": "1",
"paymentMethod": "credit_card",
"processingFee": "['3']"
}
EOFimport requests
url = "https://api.helpyousponsor.com/v1/frontend/checkout/campaign/{client_id}/{program_id}/{session_id}"
payload = {
"amount": "100",
"email": "email@email.com",
"frequency": "Every Month",
"method_signup": "3",
"cardExpiry": "0228",
"cardHolderName": "John Doe",
"cvv": "123",
"donation_amount": "100",
"expiryMonth": "02",
"expiryYear": "2028",
"firstName": "John",
"lastName": "Doe",
"number": "4242424242424242",
"paying_processing": "1",
"paymentMethod": "credit_card",
"processingFee": "['3']"
}
headers = {"Content-Type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({
amount: '100',
email: 'email@email.com',
frequency: 'Every Month',
method_signup: '3',
cardExpiry: '0228',
cardHolderName: 'John Doe',
cvv: '123',
donation_amount: '100',
expiryMonth: '02',
expiryYear: '2028',
firstName: 'John',
lastName: 'Doe',
number: '4242424242424242',
paying_processing: '1',
paymentMethod: 'credit_card',
processingFee: '[\'3\']'
})
};
fetch('https://api.helpyousponsor.com/v1/frontend/checkout/campaign/{client_id}/{program_id}/{session_id}', 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://api.helpyousponsor.com/v1/frontend/checkout/campaign/{client_id}/{program_id}/{session_id}",
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([
'amount' => '100',
'email' => 'email@email.com',
'frequency' => 'Every Month',
'method_signup' => '3',
'cardExpiry' => '0228',
'cardHolderName' => 'John Doe',
'cvv' => '123',
'donation_amount' => '100',
'expiryMonth' => '02',
'expiryYear' => '2028',
'firstName' => 'John',
'lastName' => 'Doe',
'number' => '4242424242424242',
'paying_processing' => '1',
'paymentMethod' => 'credit_card',
'processingFee' => '[\'3\']'
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json"
],
]);
$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://api.helpyousponsor.com/v1/frontend/checkout/campaign/{client_id}/{program_id}/{session_id}"
payload := strings.NewReader("{\n \"amount\": \"100\",\n \"email\": \"email@email.com\",\n \"frequency\": \"Every Month\",\n \"method_signup\": \"3\",\n \"cardExpiry\": \"0228\",\n \"cardHolderName\": \"John Doe\",\n \"cvv\": \"123\",\n \"donation_amount\": \"100\",\n \"expiryMonth\": \"02\",\n \"expiryYear\": \"2028\",\n \"firstName\": \"John\",\n \"lastName\": \"Doe\",\n \"number\": \"4242424242424242\",\n \"paying_processing\": \"1\",\n \"paymentMethod\": \"credit_card\",\n \"processingFee\": \"['3']\"\n}")
req, _ := http.NewRequest("POST", url, payload)
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://api.helpyousponsor.com/v1/frontend/checkout/campaign/{client_id}/{program_id}/{session_id}")
.header("Content-Type", "application/json")
.body("{\n \"amount\": \"100\",\n \"email\": \"email@email.com\",\n \"frequency\": \"Every Month\",\n \"method_signup\": \"3\",\n \"cardExpiry\": \"0228\",\n \"cardHolderName\": \"John Doe\",\n \"cvv\": \"123\",\n \"donation_amount\": \"100\",\n \"expiryMonth\": \"02\",\n \"expiryYear\": \"2028\",\n \"firstName\": \"John\",\n \"lastName\": \"Doe\",\n \"number\": \"4242424242424242\",\n \"paying_processing\": \"1\",\n \"paymentMethod\": \"credit_card\",\n \"processingFee\": \"['3']\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.helpyousponsor.com/v1/frontend/checkout/campaign/{client_id}/{program_id}/{session_id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Content-Type"] = 'application/json'
request.body = "{\n \"amount\": \"100\",\n \"email\": \"email@email.com\",\n \"frequency\": \"Every Month\",\n \"method_signup\": \"3\",\n \"cardExpiry\": \"0228\",\n \"cardHolderName\": \"John Doe\",\n \"cvv\": \"123\",\n \"donation_amount\": \"100\",\n \"expiryMonth\": \"02\",\n \"expiryYear\": \"2028\",\n \"firstName\": \"John\",\n \"lastName\": \"Doe\",\n \"number\": \"4242424242424242\",\n \"paying_processing\": \"1\",\n \"paymentMethod\": \"credit_card\",\n \"processingFee\": \"['3']\"\n}"
response = http.request(request)
puts response.read_body{
"status": "success",
"message": "Success: Donation Added",
"redirect": "/frontend/donations_page/1/1"
}{
"status": "error",
"message": "Error: No Donation Added",
"redirect": "/frontend/donations_page/1/1"
}{
"message": "Validation error",
"errors": {}
}
