After you have successfully created a Remote Payment using the API and received a paymentId back, the next step is to guide the user to complete the payment.
Redirecting Users to the Payment Page
Your application (typically the frontend) needs to redirect the user’s browser to the Cashii payment page. Construct the URL as follows:
https://cashii.app/payment?code={paymentId}&redirect={redirectUrl}
Parameters:
code (Required): The 16-digit paymentId you received when creating the Remote Payment.
redirect (Required): The URL within your application where Cashii should redirect the user after they attempt the payment (whether successful or not). This URL must be URL-encoded.
Example Redirect URL:
https://cashii.app/payment?code=1234567890123456&redirect=https%3A%2F%2Fyourapp.com%2Fpayment%2Fcallback
User Experience on the Payment Page
- A web-based payment page is displayed.
- It shows a QR code that can be scanned by the Cashii app.
- It allows payment via bank cards integrated with the Cashii network.
- Users can manually enter the 16-digit payment code if needed.
- On some devices (like certain Samsung models using the default browser), universal links might not work reliably. In such cases, the user might see tabs and need to manually tap the “Cashii App” tab to trigger the app launch.
Handling the Redirect Back to Your App
Once the user completes (or cancels) the payment attempt on the Cashii page/app, Cashii will redirect their browser back to the redirectUrl you provided.
Cashii appends query parameters to this URL to inform your application about the outcome:
Example Redirect Back:
https://yourapp.com/payment/callback?transaction_id=TRX987654321&status=paid&signature=a_secure_signature_hash
Query Parameters:
transaction_id: The unique identifier for the transaction record within Cashii (distinct from the initial paymentId).
status: The resulting status of the payment attempt (e.g., paid, rejected, canceled). See Core Concepts for possible values.
signature: A security signature hash (details forthcoming - used to verify the redirect came from Cashii).
Client-Side Status is Informational Only
While the status parameter in the redirect URL provides immediate feedback to the user, do not rely solely on this client-side information to confirm the payment for fulfilling orders or providing services.
Always verify the final payment status server-side.
Verifying Payment Status (Server-Side)
Your redirectUrl should point to a page or endpoint in your application that triggers a server-side verification process:
- Your frontend receives the redirect with
transaction_id, status, and signature.
- Your frontend informs your backend, passing along the original
paymentId (which you should associate with the user’s session or the order).
- Your backend uses the
paymentId to call the Retrieve Remote Payment Information endpoint (API Reference or see Quickstart).
- The API response contains the definitive, trusted
status of the payment.
- Your backend updates your order status in your database based on the verified API response.
- Your backend informs the frontend, which then displays the appropriate confirmation or error message to the user.
This server-side check ensures payment integrity even if the client-side redirect is manipulated or fails.