定制 aditamairhamdev/midtranscore 二次开发

按需修改功能、优化性能、对接业务系统,提供一站式技术支持

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

aditamairhamdev/midtranscore

Composer 安装命令:

composer require aditamairhamdev/midtranscore

包简介

mengambil data dari midtrans tanpa perlu terlalu banyak konfigurasi pada class , helper dan lainnya

README 文档

README

GitHub stars GitHub forks GitHub issues

midtranscore

fetch data from midtrans without the need for too much configuration on classes, helpers and others

Installation

  1. Open the terminal, navigate to your laravel project directory.
$ composer require aditamairhamdev/midtranscore
  1. Setting the database configuration, open .env file at project root directory
DB_DATABASE=**your_db_name**
DB_USERNAME=**your_db_user**
DB_PASSWORD=**password**
  1. Run the following command at the terminal
$ php artisan vendor:publish --provider="Aditamairhamdev\MidtransCore\MidtransCoreServiceProvider"
  1. Run the following command at the terminal
$ php artisan migrate

midtranscore api base

for the midtranscore midtrans fire endpoint there are three endpoints:

  • {project_base}/midtrans/credit-card --METHOD = POST
  • {project_base}/midtrans/gopay --METHOD = POST
  • {project_base}/midtrans/bank-transfer --METHOD = POST

midtranscore : api [Credit Card]

To retrieve a response from a credit card it is necessary to enter the following parameters

{
    "card_number": "5211 1111 1111 1117", // example card number
    "card_exp_month": "12", // example month
    "card_exp_year": "2021", // example year
    "card_cvv": "123", // example cvv
    "with_3ds": true, // add if you want to use 3ds authentication
    "transaction_details": {
        "order_id": "order-qwerty-{{$timestamp}}",
        "gross_amount": 10000
    },
    "customer_details": {
        "first_name": "Udin",
        "last_name": "Cecep",
        "email": "cecep@gmail.com",
        "phone": "081230189469"
    },
    "item_details": [{
        "id" : 1,
        "price": 10000,
        "quantity": 1,
        "name": "order"
    }]
}

you will get a response from midtrans

{
    "status_code": "201",
    "status_message": "Success, Credit Card transaction is successful",
    "bank": "cimb",
    "transaction_id": "a7f91127-caca-42bb-b020-b1d5d00c86d8",
    "order_id": "order-qwerty-1607744911",
    "redirect_url": "https://api.sandbox.veritrans.co.id/v2/token/rba/redirect/521111-1117-a7f91127-caca-42bb-b020-b1d5d00c86d8",
    "merchant_id": "G328968496",
    "gross_amount": "10000.00",
    "currency": "IDR",
    "payment_type": "credit_card",
    "transaction_time": "2020-12-12 10:48:25",
    "transaction_status": "pending",
    "fraud_status": "accept",
    "masked_card": "521111-1117",
    "card_type": "debit"
}

midtranscore : api [Gopay]

To retrieve a response from a gopay it is necessary to enter the following parameters

{
    "callback_url": "", // if it uses its own url callback
    "transaction_details": {
        "order_id": "order-qwerty-{{$timestamp}}",
        "gross_amount": 10000
    },
    "customer_details": {
        "first_name": "Udin",
        "last_name": "Cecep",
        "email": "cecep@gmail.com",
        "phone": "081230189469"
    },
    "item_details": [{
        "id" : 1,
        "price": 10000,
        "quantity": 1,
        "name": "order"
    }]
}

you will get a response from midtrans

{
    "status_code": "201",
    "status_message": "GoPay transaction is created",
    "transaction_id": "a8d71cfa-969f-4d62-aa95-b54f747b28fd",
    "order_id": "order-qwerty-1607745365",
    "merchant_id": "G328968496",
    "gross_amount": "10000.00",
    "currency": "IDR",
    "payment_type": "gopay",
    "transaction_time": "2020-12-12 10:55:51",
    "transaction_status": "pending",
    "fraud_status": "accept",
    "actions": [
        {
            "name": "generate-qr-code",
            "method": "GET",
            "url": "https://api.sandbox.veritrans.co.id/v2/gopay/a8d71cfa-969f-4d62-aa95-b54f747b28fd/qr-code"
        },
        {
            "name": "deeplink-redirect",
            "method": "GET",
            "url": "https://simulator.sandbox.midtrans.com/gopay/partner/app/payment-pin?id=01166610-fa15-4ff8-b0f9-001f250dc931"
        },
        {
            "name": "get-status",
            "method": "GET",
            "url": "https://api.sandbox.veritrans.co.id/v2/a8d71cfa-969f-4d62-aa95-b54f747b28fd/status"
        },
        {
            "name": "cancel",
            "method": "POST",
            "url": "https://api.sandbox.veritrans.co.id/v2/a8d71cfa-969f-4d62-aa95-b54f747b28fd/cancel"
        }
    ]
}

midtranscore : api [Bank Transfer]

To retrieve a response from a bank transfer it is necessary to enter the following parameters

{
    "bank_name": "BNI",
    "transaction_details": {
        "order_id": "order-qwerty-{{$timestamp}}",
        "gross_amount": 10000
    },
    "customer_details": {
        "first_name": "Udin",
        "last_name": "Cecep",
        "email": "cecep@gmail.com",
        "phone": "081230189469"
    },
    "item_details": [{
        "id" : 1,
        "price": 10000,
        "quantity": 1,
        "name": "order"
    }]
}

you will get a response from midtrans

{
    "status_code": "201",
    "status_message": "Success, Bank Transfer transaction is created",
    "transaction_id": "00a5027e-be4c-44bd-8880-16e780e7ad76",
    "order_id": "order-qwerty-1607746147",
    "merchant_id": "G328968496",
    "gross_amount": "10000.00",
    "currency": "IDR",
    "payment_type": "bank_transfer",
    "transaction_time": "2020-12-12 11:08:52",
    "transaction_status": "pending",
    "va_numbers": [
        {
            "bank": "bni",
            "va_number": "9886849634055039"
        }
    ],
    "fraud_status": "accept"
}

in a bank transfer there is a list of banks that can be processed, among others

'BCA', 'Permata', 'BNI', 'Mandiri'

Documentation

others documentation you can see : Documentation

aditamairhamdev/midtranscore 适用场景与选型建议

aditamairhamdev/midtranscore 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 10 次下载、GitHub Stars 达 0, 最近一次更新时间为 2020 年 12 月 11 日, 在 PHP 生态内属于活跃度较高的组件。

我们在过去多个企业项目中使用过 aditamairhamdev/midtranscore 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。

围绕 aditamairhamdev/midtranscore 我们能提供哪些服务?
定制开发 / 二次开发

基于 aditamairhamdev/midtranscore 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。

BUG 修复 & 性能优化

线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。

项目外包 & 长期维护

承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。

yvsm@zunyunkeji.com QQ:316430983 微信:yvsm316 西安尊云信息科技 · 专注 PHP / Go / 分布式系统研发

统计信息

  • 总下载量: 10
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 0
  • 点击次数: 1
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 0
  • Watchers: 1
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2020-12-11