SDK Quick Start
MPAC provides SDKs in three languages for integrating with the Payment Gateway.
Installation
bash
npm install @mpac/pgw-sdkbash
go get github.com/mp-solution-inc/mpac-pgw/sdks/sdk-gobash
pip install mpac-pgw-sdkCreate a PaymentIntent
typescript
import { MpacPGW } from '@mpac/pgw-sdk'
const pgw = new MpacPGW({
apiKey: 'your-api-key',
secretKey: 'your-secret-key',
baseURL: 'https://api.pgw.mpac-cloud-dev.com',
})
const paymentIntent = await pgw.paymentIntents.create({
amount: 1000,
currency: 'JPY',
processing_type: 'pgw_processed',
store_id: 'store_01ABCDEF',
})
console.log(paymentIntent.id) // pi_01...
console.log(paymentIntent.status) // 'requires_payment_method'go
import pgw "github.com/mp-solution-inc/mpac-pgw/sdks/sdk-go"
client := pgw.NewClient(
pgw.WithAPIKey("your-api-key"),
pgw.WithSecretKey("your-secret-key"),
pgw.WithBaseURL("https://api.pgw.mpac-cloud-dev.com"),
)
pi, err := client.PaymentIntents.Create(ctx, &pgw.CreatePaymentIntentParams{
Amount: 1000,
Currency: "JPY",
ProcessingType: "pgw_processed",
StoreID: "store_01ABCDEF",
})
if err != nil {
log.Fatal(err)
}
fmt.Println(pi.ID) // pi_01...
fmt.Println(pi.Status) // requires_payment_methodpython
from mpac_pgw import MpacPGW
client = MpacPGW(
api_key="your-api-key",
secret_key="your-secret-key",
base_url="https://api.pgw.mpac-cloud-dev.com",
)
payment_intent = client.payment_intents.create(
amount=1000,
currency="JPY",
processing_type="pgw_processed",
store_id="store_01ABCDEF",
)
print(payment_intent.id) # pi_01...
print(payment_intent.status) # requires_payment_methodAuthentication
All SDKs handle HMAC-SHA256 authentication automatically. You need:
- API Key - Identifies your ClientPartner
- Secret Key - Used to sign requests (never expose client-side)
For client-side operations, use the payment_token returned when creating a PaymentIntent. See the API Authentication Guide for details.
PaymentIntent Lifecycle
See the PaymentIntent Guide for the full lifecycle documentation.
SDK References
- JavaScript/TypeScript SDK - Full API reference
- Go SDK - Full API reference
- Python SDK - Full API reference