Create Session Request / Response
To enhance the integration with the CCG widget, it's crucial to have comprehensive details regarding session-based request and response interactions.
Invalid Session Responses
Guidelines for Merchant Implementation:
Ensure the Convenient Checkout widget is activated only after the following prerequisites are met:
- The session creation request has been successfully acknowledged.
- The polling response for the GET session is affirmative. In the event of a BAD REQUEST error on the GET session, it is imperative to scrutinize the response and adjust the session request accordingly.
Scenarios Leading to Session Invalidation and BAD REQUEST Responses:
The following instances result in the invalidation of a session and the issuance of a BAD REQUEST response:
WS2 Verification Failure:
During the session creation process, a WS2 check is conducted to verify agent information, such as MSID. If this check fails, the session is invalidated, leading to a BAD REQUEST response.
Applicable Session Modes:
PAYMENT_METHOD_ENTRY
, PAYMENT
Sample Response:
WS2 Check Failed Response
{
"title": "INVALID_REQUEST",
"status": 400,
"detail": "Card WS2 check has failed.",
"errorDetails": null
}
Payment Method Configuration Not Found:
A session is invalidated during its creation phase if the payment method type is either not configured for the merchant or if it is not correctly specified in the session request.
Applicable Session Modes:
PAYMENT_METHOD_ENTRY
, PAYMENT
, PAYMENT_WITH_WALLET
Sample Response:
Missing Payment Method Type Configuration Response
{
"title": "INVALID_REQUEST",
"status": 400,
"detail": "Payment method type is not configured.",
"errorDetails": null
}
Unavailability of Payment Methods for Capture:
A session becomes invalid if the channels available for the configured payment methods are absent. This absence could be due to either a lack of configuration at the merchant level or an invalid session request.
Applicable Session Modes:
PAYMENT_METHOD_ENTRY
, PAYMENT
Sample Response:
Missing Payment Method Channels Response
{
"title": "INVALID_REQUEST",
"status": 400,
"detail": "You have no capture methods available.",
"errorDetails": null
}
Absence of Consent in Payment Request Leads to Failure:
Payment requests are validated against the consent object, and if the consent is not found within the request, the payment request will be invalidated.
If an invalid Consent text is provided, the session will fail with an invalid request. Below special characters are not allowed in the consent text:
[ ] { } + = * ^ % # ~ ` < > ? | \
Applicable Session Modes:
PAYMENT
Sample Response:
Payment Failed Response When Consent Not Found
{
"title": "INVALID_REQUEST",
"status": 400,
"detail": "Consent is required!",
"errorDetails": null
}
Session Failed Response When Consent text not valid
{
"title": "INVALID_REQUEST",
"status": 400,
"detail": "Consent is invalid",
"errorDetails": null
}