Appearance
QA Environment (Testing)
NOTE
The QA environment is NOT to be used with production data. Production data includes real cards and account numbers.
Prerequisites to using the PayNetWorx Hosted Payments QA environment
A request must be made to use the QA environment prior to use. See contacts for details. PayNetWorx will configure the QA environment for use and inform developers of readiness for testing and certification efforts.
Purpose
The QA environment is designed for:
- Development and integration testing
- Testing payment flows without processing real transactions
- Validating your implementation before going live
- Using test card numbers provided by PayNetWorx support
Environment URLs
API Base URL
text
https://api.hosted-payments-qa.paynetworx.cloudSession Creation Endpoint:
text
https://api.hosted-payments-qa.paynetworx.cloud/v1/payments/sessions/createHosted Form URL
text
https://hosted-payments-qa.paynetworx.cloudThe complete hosted form URL (including the session ID) will be returned in the payment_session_url field when you create a payment session.
Authentication
Use your QA API credentials provided by PayNetWorx. These credentials are different from your production credentials.
IMPORTANT
Never use production credentials in the QA environment, and never use QA credentials in production.
Test Cards
Use test card numbers provided by PayNetWorx support for testing in the QA environment. These test cards will simulate various transaction scenarios including approvals, declines, and errors.
Example Session Creation Request
js
async function initializePaymentSession() {
const headers = new Headers();
headers.append("Content-Type", "application/json");
headers.append("Authorization", "{{ YOUR_QA_API_KEY }}");
const api_response = await fetch(
`https://api.hosted-payments-qa.paynetworx.cloud/v1/payments/sessions/create`,
{
method: "POST",
headers,
body: JSON.stringify({
payment_session: {
payment_session_use: "TOKENIZE",
},
}),
}
);
return await api_response.json();
}Origin Validation
When implementing postMessage listeners for the QA environment, use the following origin:
js
const allowedOrigin = "https://hosted-payments-qa.paynetworx.cloud";
window.addEventListener("message", (event) => {
if (event.origin !== allowedOrigin) {
console.warn("Rejected message from unauthorized origin:", event.origin);
return;
}
if (event.data?.type === "pnx-tokenized-payment-info") {
// Handle tokenized data
const tokenizedData = event.data.payload;
// Process payment...
}
});Next Steps
Once you've completed testing in the QA environment and your integration has been certified, you can proceed to the Production Environment.
