You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@@ -672,10 +672,23 @@ export default function PayHereTester() {
672
672
673
673
<divclassName="space-y-2 text-sm text-slate-700">
674
674
<p>1. Go to <ahref="https://sandbox.payhere.lk"target="_blank"rel="noopener noreferrer"className="text-blue-600 hover:underline">sandbox.payhere.lk</a> and create an account.</p>
675
-
<p>2. In the "Integrations" tab, create a new app. Use "localhost" for the domain.</p>
675
+
<p>2. In the "Integrations" tab, create a new app. Use "github.io" for the domain when testing using this tool.</p>
676
676
<p>3. Copy the "Merchant ID" and the app's "Merchant Secret" into the form on the left.</p>
677
677
</div>
678
678
679
+
<divclassName="mt-6">
680
+
<h4className="font-semibold text-slate-700 mb-2">Testing Notify URL with a Backend Server</h4>
681
+
<divclassName="space-y-2 text-sm text-slate-700">
682
+
<p>The <code>notify_url</code> is used by PayHere to send a server-to-server notification to your backend to confirm the payment status. This frontend tester does not include a backend service.</p>
683
+
<p>To test this, you will need a separate backend application running that can receive these notifications. You can use <ahref="https://ngrok.com/"target="_blank"rel="noopener noreferrer"className="text-blue-600 hover:underline">ngrok</a> to expose your local backend server to the internet.</p>
684
+
<p>1. Run your backend application on a specific port (e.g., port 8080).</p>
685
+
<p>2. In a new terminal, run ngrok to expose that port: <codeclassName="bg-slate-100 text-slate-800 px-2 py-1 rounded-md font-mono">ngrok http 8080</code> (replace 8080 with your backend's port).</p>
686
+
<p>3. Copy the "Forwarding" URL provided by ngrok.</p>
687
+
<p>4. Paste this URL into the "Notify URL" field in the form on the left.</p>
688
+
<p>When a payment is completed, PayHere will send a POST request with the payment status to your backend server via this ngrok URL.</p>
689
+
</div>
690
+
</div>
691
+
679
692
<divclassName="mt-6">
680
693
<h4className="font-semibold text-slate-700 mb-2">Test Cards for Successful Payments</h4>
681
694
<pclassName="text-xs text-slate-500 mb-3">For ‘Name on Card’, ‘CVV’ &‘Expirydate’youcanenter any validdata.</p>
0 commit comments