PGecom
  • 🚀Introduction
  • đŸŽ¯Guides
    • Getting authenticated
  • 📚Concepts
    • Sandbox Environment
  • 🧑‍đŸ’ģAPI Endpoint
    • Ecommerce
      • đŸ›ī¸Shop
        • GetShopById
        • CreateShop
      • 👔Product
        • ProductSchema
        • GetProductById
        • GetProductBySlug
        • CreateNewProduct
      • 🛒Checkout
        • CreateCheckoutSession
      • Form
        • GetFormById
      • Invoice
        • GetInvoiceById
    • Wordpress Plugin
    • Chrome Extension
    • GiftCards
      • â„šī¸Gift Card Schema
      • ✅List giftcards
      • â˜‘ī¸Order a gift card
      • â˜‘ī¸Get giftcard
      • â˜‘ī¸Rates
    • Send rewards
      • â„šī¸Rewards Schema
      • â˜‘ī¸Send rewards
    • Withdraw
      • â„šī¸Withdraw Schema
      • â˜‘ī¸Process Withdraw
      • â˜‘ī¸Rates
    • Radar
      • â„šī¸Radar Schema
      • â˜‘ī¸Check for Fraudster
    • Top Up
      • â„šī¸Topup Schema
      • â˜‘ī¸Estimate
      • â˜‘ī¸Send
    • Payment
      • Mon Cash
        • CreateMonCashPayment
        • VerifyMonCashPayment
        • WithdrawToMonCashEstimate
        • WithdrawFundsToMonCash
      • PG Pay
        • ConfigurePGPay
        • CreatePGPayPayment
        • VerifyPGPaymentWithToken
        • VerifyPGPaymentWithOrderId
    • Deprecated
      • Card Holder
        • â„šī¸Card Holder Schema
        • â˜‘ī¸Update
      • Card
        • â„šī¸Card Schema
        • ✅Retrieve a single card
        • ✅List cards
        • â˜‘ī¸Create a card
        • â˜‘ī¸Create Customer
  • 🎓Resources
    • Support
    • Production Access
Powered by GitBook
On this page

Was this helpful?

  1. API Endpoint
  2. Payment
  3. PG Pay

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 token

{
    "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'
PreviousVerifyPGPaymentWithTokenNextDeprecated

Last updated 1 year ago

Was this helpful?

🧑‍đŸ’ģ