Skip to content

Offiicial UAT script for DANA Payment Gateway, IPG, and Disbursement integration. Available for Python, Golang, and NodeJS

Notifications You must be signed in to change notification settings

dana-id/uat-script

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

DANA Self Testing Scenario

Description

This repository contains scenarios that can be run for UAT in Sandbox and E2E scenarios using DANA Client library with your choice of programming language (Python, Golang, PHP, Node). You can use it to:

  • Automate running UAT scenarios in Sandbox with your credentials and the result can be downloaded in your Merchant Portal dashboard
  • Find examples of E2E scenarios for each business solution

For documentation of each DANA Client library visit:

How to Use

  1. Set up your environment:

    Clone this repo to your deployed sandbox system (can be in Kubernetes, VM, etc.)

    git clone git@github.com:dana-id/uat-script.git
    cd uat-script
  2. Configure your credentials:

    Change the .env-example file name to .env and fill the data with your credentials

    cp .env-example .env

    Edit the .env file with your credential information.

    Note:

    • You can fill PRIVATE_KEY and PRIVATE_KEY_PATH simultaneously, but if you fill both and the key values are different, we will prioritize the key in PRIVATE_KEY_PATH. The same applied to DANA_PUBLIC_KEY and DANA_PUBLIC_KEY_PATH. The CLIENT_SECRET env is for disbursement business solution.
    • You can set REDIRECT_URL_OAUTH to get auth code via url.
    • You can find your EXTERNAL_SHOP_ID in your Merchant Portal account(Submerchant Menu).
  3. Run the tests:

    • Run the command with your preferred programming language.

      sh run-test.sh python
    • You can run the command with your specific business solution.

      sh run-test.sh python payment_gateway

      Note: You can find specific solution that you choose with this command

      sh run-test.sh --list python
    • You can run the command with your specific API in business solution.

      sh run-test.sh python payment_gateway create_order_test

      Note: You can find specific API solution that you choose with this command. First, get your solution.

      sh run-test.sh --list node

      Copy paste solution to this command and delete slash / , then continue like this example command.

      sh run-test.sh --list python payment_gateway  

      View the results in your terminal and in your Merchant Portal dashboard

Supported Languages

Currently, the following programming languages are supported:

  • Python
  • Golang
  • Node
  • PHP
  • Java

Additional language support will be added in future updates.

Structure

  • test/: Contains test scenarios for different business solutions
  • resource/: Contains request templates and fixtures

Note

The test scenarios in this repository use a JSON-based approach for loading test data, which means the way API requests are made here may differ slightly from how you would use the libraries in your actual implementation (detailed in the library documentation):

Example in Python:

  • In this repository: Requests are loaded from JSON files and converted using .from_dict() method

    # Test scenario approach
    json_dict = get_request(json_path_file, title_case, case_name)
    consult_pay_request_obj = ConsultPayRequest.from_dict(json_dict)
    api_instance.consult_pay(consult_pay_request_obj)
  • In your actual implementation: You would directly create request objects as shown in the library documentation

    # Direct implementation approach
    request = ConsultPayRequest(
        merchant_id="YOUR_MERCHANT_ID",
        amount={"value": "10000.00", "currency": "IDR"},
        additional_info={...}
    )
    api_instance.consult_pay(request)

About

Offiicial UAT script for DANA Payment Gateway, IPG, and Disbursement integration. Available for Python, Golang, and NodeJS

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published