Product
Introducing License Enforcement in Socket
Ensure open-source compliance with Socket’s License Enforcement Beta. Set up your License Policy and secure your software!
github.com/mythrnr/paypayopa-sdk-go
paypayopa
provides SDK to use PayPay API for Go.Get it with go get
.
go get github.com/mythrnr/paypayopa-sdk-go
The official paypay/paypayopa-sdk-*
will obviously do the job.
But, to focus to integrate SDK to your system, mythrnr/paypayopa-sdk-go
provides clients each integration such as Web Payment or Native Payment,
not based REST API.
Available integration here.
Integration | Document |
---|---|
Web Payment | https://developer.paypay.ne.jp/products/docs/webpayment |
Native Payment | https://developer.paypay.ne.jp/products/docs/nativepayment |
Dynamic QR | https://developer.paypay.ne.jp/products/docs/qrcode |
App Invoke | https://developer.paypay.ne.jp/products/docs/appinvoke |
Continuous Payment | https://developer.paypay.ne.jp/products/docs/continuouspayment |
PreAuth & Capture | https://developer.paypay.ne.jp/products/docs/preauthcapture |
Request Money | https://developer.paypay.ne.jp/products/docs/pendingpayment |
paypayopa.NewCredentials
, and set the API key generated on the developer page.paypayopa.Env***
to switch the connection destination.creds := paypayopa.NewCredentials(
paypayopa.EnvSandbox,
"YOUR_API_KEY",
"YOUR_API_KEY_SECRET",
"YOUR_MERCHANT_ID",
)
package main
import (
"context"
"encoding/json"
"log"
"github.com/google/uuid"
"github.com/mythrnr/paypayopa-sdk-go"
)
func main() {
creds := paypayopa.NewCredentials(
paypayopa.EnvSandbox,
"YOUR_API_KEY",
"YOUR_API_KEY_SECRET",
"YOUR_MERCHANT_ID",
)
wp := paypayopa.NewWebPayment(creds)
ctx := context.Background()
res, info, err := wp.CreateCode(ctx, &paypayopa.CreateQrCodePayload{
MerchantPaymentID: uuid.NewString(),
Amount: &paypayopa.MoneyAmount{
Amount: 1000,
Currency: paypayopa.CurrencyJPY,
},
CodeType: paypayopa.CodeTypeOrderQR,
RedirectURL: "https://localhost",
RedirectType: paypayopa.RedirectTypeWebLink,
})
if err != nil {
log.Fatalf("%+v", err)
}
if !info.Success() {
log.Fatalf("%+v", info)
}
info, err = wp.DeleteCode(ctx, res.CodeID)
if err != nil {
log.Fatalf("%+v", err)
}
}
FAQs
Unknown package
Did you know?
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.
Product
Ensure open-source compliance with Socket’s License Enforcement Beta. Set up your License Policy and secure your software!
Product
We're launching a new set of license analysis and compliance features for analyzing, managing, and complying with licenses across a range of supported languages and ecosystems.
Product
We're excited to introduce Socket Optimize, a powerful CLI command to secure open source dependencies with tested, optimized package overrides.