VerifyPGPaymentWithToken
Verify a pg pay a checkout session
Verify pg pay payment with pgpay token
POST
https://sandbox.pgecom.com/api/pgpay/order
Request Body
Name | Type | Description |
---|---|---|
pgPayToken* | String | The token |
{
"quantity": 1,
"receiver": "wysavmuhjsuxpv@lifebeyondservice.com",
"metadata": {
"is_matched": false,
"gender": "female",
"isChatEnabled": false,
"isProd": false,
"webhookUrl": "https://webhook.site/40adf10b-9352-4d20-b23a-17d4f1a32a9f",
"token": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJvcmRlcklkIjoiNDE0MTJiZTMtMDFmZC00ODhhLWEyNzktY2FkYmUxNzFiNWU1IiwiaWF0IjoxNzEzNDU5MjE2LCJleHAiOjE3MTM0NjI4MTZ9.-LqeTBDi1vOT1giyOLfnQ5hrpmrtrKbWxB_SqvZD5mU",
"app_name": "Match.com",
"pgPayMerchantName": "PGecom",
"customerEmail": "info@pgecom.com",
"paymentMethods": [
"moncash",
"pgpay"
],
"customerFirstName": "",
"customerLastName": "",
"returnUrl": "https://sandbox.pgecom.com/payment/pgpay/eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJvcmRlcklkIjoiNDE0MTJiZTMtMDFmZC00ODhhLWEyNzktY2FkYmUxNzFiNWU1IiwiaWF0IjoxNzEzNDU5MjE2LCJleHAiOjE3MTM0NjI4MTZ9.-LqeTBDi1vOT1giyOLfnQ5hrpmrtrKbWxB_SqvZD5mU?merchantName=PGecom&amount=55"
},
"userFee": 0,
"currency": "htg",
"newBalance": 5440.35927,
"orderId": "41412be3-01fd-488a-a279-cadbe171b5e5",
"status": "completed",
"successUrl": "https://pgecom.com",
"createdAt": "2024-04-18T16:53:36.528Z",
"transactionType": "pgpay_deposit",
"sender": "info@pgecom.com",
"paymentStatus": "completed",
"platform": "pgrewards",
"updatedAt": "2024-04-18T16:54:36.333Z",
"userID": "f725076f-ade0-4912-bc86-db1681700d91",
"amount": 0.3061999999999999,
"paymentMethod": "pgpay",
"description": "Esterling Accime paid you 55 HTG via PG Pay. You've received 55 HTG to your account. Your updated balance is 5440.35927 HTG",
"id": "41412be3-01fd-488a-a279-cadbe171b5e5",
"deliveryMethod": "instant",
"phone": "+50934748112",
"customerId": "e66d2dac-e514-42b7-8490-de3972709d7e",
"gourdes": 55
}
{
"message": "Order ID 8db0fd57-5494-45d2-8ede-f045ffbd85b9 already exist, please create a new order id",
"status": 400
}
const axios = require('axios');
let data = {
"pgPayToken": "jfhsfhsh"
}
let config = {
method: 'post',
url: 'https://sandbox.pgecom.com/api/pgpay/order',
headers: { },
data : data
};
axios(config)
.then((response) => {
console.log(JSON.stringify(response.data));
})
.catch((error) => {
console.log(error);
});
import requests
url = "https://sandbox.pgecom.com/api/pgpay/order"
payload = {
"pgPayToken": "jfhsfhsh"
}
headers = {}
response = requests.request("POST", url, headers=headers, data=payload)
print(response.text)
require "uri"
require "net/http"
url = URI("https://sandbox.pgecom.com/api/pgpay/order")
https = Net::HTTP.new(url.host, url.port)
https.use_ssl = true
request = Net::HTTP::Post.new(url)
request.body = {
"pgPayToken": "jfhsfhsh"
}
response = https.request(request)
puts response.read_body
<?php
require_once 'HTTP/Request2.php';
$request = new HTTP_Request2();
$request->setUrl('https://sandbox.pgecom.com/api/pgpay/order');
$request->setMethod(HTTP_Request2::METHOD_POST);
$request->setConfig(array(
'follow_redirects' => TRUE
));
$request->setBody({
"pgPayToken": "jfhsfhsh"
});
try {
$response = $request->send();
if ($response->getStatus() == 200) {
echo $response->getBody();
}
else {
echo 'Unexpected HTTP status: ' . $response->getStatus() . ' ' .
$response->getReasonPhrase();
}
}
catch(HTTP_Request2_Exception $e) {
echo 'Error: ' . $e->getMessage();
}
curl --location 'https://sandbox.pgecom.com/api/pgpay/order' \
--data-raw '{
"pgPayToken": "jfhsfhsh"
}'
Last updated