VerifyPGPaymentWithOrderId
Use the order id to verify if the payment is complete
Retrieve a order by orderId
GET
https://sandbox.pgecom.com/api/order/{orderId}
Headers
Name | Type | Description |
---|---|---|
authorization* | String | Bearer |
{
"quantity": 1,
"receiver": "info@pgecom.com",
"metadata": {
"isChatEnabled": true,
"pgPayMerchantName": "PGecom",
"isProd": false,
"customerEmail": "info@pgecom.com",
"customerFirstName": "Esterling",
"customerLastName": "Accime",
"returnUrl": "https://sandbox.pgecom.com/payment/pgpay/eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJvcmRlcklkIjoiYjU5YTA5MzktYzgyNC00NzMyLThiMmYtMzZmNDE3NDM3ZTJhIiwiaWF0IjoxNzA0MTQyNDE3LCJleHAiOjE3MDQxNDYwMTd9.JB3oVi3nH0Yw_Q9F1x-1N8bBTkJkRAjoKYq_xIfH7x0?merchantName=PGecom&amount=25"
},
"orderId": "b59a0939-c824-4732-8b2f-36f417437e2a",
"successUrl": "https://sandbox.pgecom.com/payment-success",
"status": "pending",
"createdAt": "2024-01-01T20:53:37.155Z",
"transactionType": "pgpay",
"sender": "info@pgecom.com",
"errorUrl": "https://sandbox.pgecom.com/payment-error",
"paymentStatus": "pending",
"updatedAt": "2024-01-01T20:53:37.155Z",
"userID": "5f56dfa3-a415-4818-8275-44fc63ece3fd",
"amount": 25,
"paymentMethod": "pgpay",
"id": "b59a0939-c824-4732-8b2f-36f417437e2a",
"deliveryMethod": "instant",
"customerId": "87ee04dd-41e8-42e8-b5b9-16c0e4a04c17",
"customer": {
"lastName": "Accime",
"userID": "5f56dfa3-a415-4818-8275-44fc63ece3fd",
"updatedAt": "2023-09-29T07:01:11Z",
"createdAt": "2023-09-29T07:01:11Z",
"id": "87ee04dd-41e8-42e8-b5b9-16c0e4a04c17",
"email": "info@pgecom.com",
"phone": "+1 404 825 3444",
"firstName": "Esterling"
},
"shop": {},
"invoice": {},
"products": []
}
{
"message": "jwt malformed - session expired",
"status": 401
}
{
"message": "Order with id 1ddbb939-a8e9-4c31-85d-1cc5477574a9 not found",
"status": 400
}
const axios = require('axios');
let config = {
method: 'get',
url: 'https://sandbox.pgecom.com/api/order/b59a0939-c824-4732-8b2f-36f417437e2a',
headers: { }
};
axios(config)
.then((response) => {
console.log(JSON.stringify(response.data));
})
.catch((error) => {
console.log(error);
});
require "uri"
require "net/http"
url = URI("https://sandbox.pgecom.com/api/order/b59a0939-c824-4732-8b2f-36f417437e2a")
http = Net::HTTP.new(url.host, url.port);
request = Net::HTTP::Get.new(url)
response = http.request(request)
puts response.read_body
require "uri"
require "net/http"
url = URI("https://sandbox.pgecom.com/api/order/b59a0939-c824-4732-8b2f-36f417437e2a")
http = Net::HTTP.new(url.host, url.port);
request = Net::HTTP::Get.new(url)
response = http.request(request)
puts response.read_body
<?php
require_once 'HTTP/Request2.php';
$request = new HTTP_Request2();
$request->setUrl('https://sandbox.pgecom.com/api/order/b59a0939-c824-4732-8b2f-36f417437e2a');
$request->setMethod(HTTP_Request2::METHOD_GET);
$request->setConfig(array(
'follow_redirects' => TRUE
));
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/order/b59a0939-c824-4732-8b2f-36f417437e2a'
Last updated