BCA KlikPay Landing Page Development Guideline

To enable this payment method, you can see this guideline. Additionally you will need to fulfill additional technical requirements below as required by BCA team according to their guidelines.

This article will explain additional technical requirement to integrate with BCA KlikPay payment method. This implementation is mandatory and applies to both integration using SNAP Pop Up and/or Core API.

The customer payment journey for BCA KlikPay will be as follows:

  1. Customer will be redirected to BCA KlikPay site to complete the transaction.
  2. Customer follows the steps on BCA KlikPay site. Once the payment is done, the customer will be redirected back to Merchant’s site.

The target finish redirect URL that will be used can be configured by Merchant through the Merchant Adminstration Portal (MAP), by going to the Settings > Configuration > Finish Redirection URL tabs on the left side of the dashboard.
As transaction identifier, ?id=<the-transaction-id> will be included as url Query String upon redirect.

For example: If the finish redirect URL of merchant is www.mywebstore.com/finish-payment, customer will be redirected to url below:


After the finish redirect, merchant’s site have to display the result (success/failure message) of transaction directly on that page. Which require Merchant to get the latest transaction status via get Transaction Status API (https://api-docs.midtrans.com/#get-transaction-status) by using the transaction_id provided on the finish redirect.

Please display confirmation message in text-format based on the resulted transaction_status to customer. If the transaction_status is settlement display some message like “payment success”. Otherwise show message like “payment failed.”

These sample code show how’s the logic work in php. Please adjust the code with your tech stack.

require_once dirname(__FILE__) . '/pathToMidtransLibrary/Midtrans.php';
\Midtrans\Config::$serverKey = '<your server key>';
\Midtrans\Config::$isProduction = false;

$transactionId = $_GET['id']; // from `id` url query string
$statusResponse = \Midtrans\Transaction::status($orderId);

if($statusResponse->transaction_status == "settlement")
    echo "payment success";
else {
    echo "payment failed";

You will also need to make sure your implementation can handle Cancel & Expire scenario properly. Here is how to test cancel and expiry scenario in SANDBOX environment.

CANCEL Scenario testing flow:

  1. Create transaction from your website and redirected to Midtrans simulator,
  2. Login to MAP, go to menu TRANSACTIONS,
  3. Go to the BCA KlikPay Order ID,and the transaction status should be PENDING. Click the Order ID to open the details, then click CANCEL,
  4. Continue payment on the simulator,
  5. Click return to merchant’s website.
  6. The expected result is merchant’s website should display payment failure message.

EXPIRE Scenario testing flow:

  1. Create transaction and redirected to Midtrans’ BCA Klikpay simulator,
  2. Call Midtrans expire API using the current Order ID,
  3. Continue payment on the simulator,
  4. Click return to merchant’s website.
  5. The expected result is merchant’s website should display payment failure message.

Was this article helpful?
9 out of 28 found this helpful
Can't find your answer? How about looking at our Tech Docs?

Tech docs

Our API and plug-ins play well with platforms from PHP, Shopify, Woo Commerce to Android and many more.

Learn more