New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

github.com/jaynzr/go-paynow

Package Overview
Dependencies
Alerts
File Explorer
Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

github.com/jaynzr/go-paynow

  • v1.1.2
  • Source
  • Go
  • Socket score

Version published
Created
Source

Open in Visual Studio Code

PayNow

A Go package implementing QRCode generator for Singapore PayNow.

The main package implements the method to generate the value string for PayNow.

Optional package "github.com/jaynzr/go-paynow/qrcode" uses yeqown qrcode package to generate qrcodes. You may use other qrcode generator.

Generating PayNow Value


import "github.com/jaynzr/go-paynow"

payee := paynow.NewUEN("ACME Pte Ltd", "S99345678ABCD")
val : payee.New(12.34, "INV1234", true, time.Time{}).String()


QR Code Usage

import "github.com/jaynzr/go-paynow/qrcode"

payee := qrcode.NewMobile("90991234")

jpg, err := qrcode.QRCode(12.35, "ABCDEFG")

To customize image output, append qrcode.ImageOption to Payee.Options

Using custom logo, image attributes, expiry date, and image options


import (
    "github.com/jaynzr/go-paynow/qrcode"
	qrcopt "github.com/yeqown/go-qrcode"
)

payee := qrcode.NewUEN("ACME Pte Ltd", "S99345678ABCD")

// see https://github.com/yeqown/go-qrcode#options for available ImageOptions
payee.Options = []qrcopt.ImageOption{
    // logo size should not be > 1/5 of qrcode.
    qrcopt.WithLogoImageFilePNG("logo.png"),

    // width of each qr block
    qrcopt.WithQRWidth(12),

    // generates png format
    qrcopt.WithBuiltinImageEncoder(qrcopt.PNG_FORMAT),
}

amount := 12.35
ref := "ABCDEFG"
editable := false
expiry := time.Now().Add(time.Hour * 48)

png, err := payee.QRCodeExpiry(amount, ref, editable, expiry)

Credits

javascript/node.js

PaynowQR

QRGenerator.js

FAQs

Package last updated on 18 Jul 2021

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc