Payment Xendit and Midtrans

Tutorial in Video:

https://www.loom.com/share/4a107700cf51426283c68002749ce239

How to use it:

Create a virtual account

Url for sandbox/testing: https://dev-api.importir.com/

Url for production: https://new-apiv2.importir.com/

Example of xendit request:
```postman_json
{
    "company" : "EPD",
    "external_id" : "COM124",
    "bank_code" : "BCA",
    "name" : "Imam syafii",
    "expected_amount" : 200000,
    "callback_url" : "www.google.com",
    "payment_type" : "xendit"
}
```

POST {{url}}api/payment/create-custom-va

Request Body

Name
Type
Description

company*

EPD

EPD (Edrus Pasar Digital), JUT(Yayasan Satu Juta Pengusaha), ESD(Edrus Strategy Digital)

external_id*

YG123

Unique key

bank_code*

BNI

BNI, MANDIRI, BRI

name*

imam

name of the user that has the bill

expected_amount*

100000

Must be integer

callback_url

www.yoursite.com/callbackurl

Your callback site

payment_type*

String

midtrans, xendit

{
    "data": {
        "type_payment": "xendit",
        "external_id": "CCVA-COM124-DATE1703",
        "account_number": "11039709505",
        "bank_code": "bca",
        "expected_amount": 200000,
        "dump": {
            "status_code": "201",
            "status_message": "Success, Bank Transfer transaction is created",
            "transaction_id": "5978c3c9-5ebd-48ab-91ec-e92da2eea245",
            "order_id": "CCVA-COM124-DATE1703",
            "merchant_id": "G131111039",
            "gross_amount": "200000.00",
            "currency": "IDR",
            "payment_type": "bank_transfer",
            "transaction_time": "2023-01-19 10:17:03",
            "transaction_status": "pending",
            "fraud_status": "accept",
            "va_numbers": [
                {
                    "bank": "bca",
                    "va_number": "11039709505"
                }
            ]
        }
    },
    "status": true
}

Testing callback payment for Xendit

Url for sandbox/testing: https://stage-payment.importir.com/

Url for production: https://payment.importir.com/

POST {{url}}payment/xendit/testing-callback-sandbox

External ID that we use when we hit the create a virtual account

Request Body

Name
Type
Description

company*

EPD

EPD (Edrus Pasar Digital), JUT(Yayasan Satu Juta Pengusaha), ESD(Edrus Strategy Digital)

amount*

10000

Must be associate with expected_amount

external_id*

COM475804036622

{
    "error_code": "INVALID_AMOUNT_ERROR",
    "message": "Invalid amount. The expected amount for this fixed VA is 100000"
}

Testing callback payment for Midtrans

Midtrans, you can reference to it's site on https://docs.midtrans.com/en/technical-reference/sandbox-test?id=bank-transfer

For example, i have created a bca virtual account on testing, and i want to pay it, then open the url and click this.

Then copy the account number from the response of create virtual account.

And paste it

then click inquire

It should be returned the amount that we want to pay. and finally you just hit the pay button.

Last updated

Was this helpful?