Giter Site home page Giter Site logo

hansputera / midtrans-node Goto Github PK

View Code? Open in Web Editor NEW
12.0 1.0 1.0 747 KB

UnOfficial Midtrans Payment API Client for NodeJS | https://midtrans.com

Home Page: https://midtrans.com

TypeScript 99.65% Shell 0.35%
midtrans-nodejs midtrans nodejs payment-gateway

midtrans-node's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

Forkers

notyusta

midtrans-node's Issues

Error can't resolve 'crypto' in node_modules/hanif-midrans-node/dist/util.js

saya mengalamai error penggunaan library ini dengan error seperti di bawah ini
Error: Module not found: Error: Can't resolve 'crypto' in 'D:\ionic\latihan1\node_modules\hanif-midtrans-node\dist\Util'

berikut kode app.module.ts saya
import { NgModule } from '@angular/core';
import { BrowserModule } from '@angular/platform-browser';
import { RouteReuseStrategy } from '@angular/router';

import { IonicModule, IonicRouteStrategy } from '@ionic/angular';

import { AppComponent } from './app.component';
import { AppRoutingModule } from './app-routing.module';
import { MidtransNode } from 'hanif-midtrans-node';

@NgModule({
declarations: [AppComponent],
imports: [ BrowserModule, IonicModule.forRoot(), AppRoutingModule],
providers: [MidtransNode, { provide: RouteReuseStrategy, useClass: IonicRouteStrategy }],
bootstrap: [AppComponent],
})
export class AppModule {}

dan seperti ini di halaman midtransya

import { Component, OnInit } from '@angular/core';
import { MidtransNode } from 'hanif-midtrans-node';
@component({
selector: 'app-midtrans-npm',
templateUrl: './midtrans-npm.page.html',
styleUrls: ['./midtrans-npm.page.scss'],
})
export class MidtransNPMPage implements OnInit {

constructor() { }

ngOnInit() {
}

bayar(){
const midtrans = new MidtransNode(false, 'servey key saya'); // sandbox mode

midtrans.createTransaction({
    transaction_details: {
        gross_amount: 20000, // IDR 20.000
        order_id: 'midtrans-node',
    },
}).then(console.log).catch(console.error);

}

}

midtrans Node Bayar

mohon bantuannya, dimanakah salah peletakan kode saya

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.