paypay_uo (PayPay Unofficial) is a client library for PayPay's Open Payment API (OPA) faithfully ported from paypayopa-sdk-php
Dart Class for interacting with the Paypay API This is the quickest way to integrate PayPay payment services, primarily meant for merchants who wish to perform interactions with the Paypay API programatically. With PayPay's OPA SDK, you can build a custom payment checkout process to suit your unique business needs and branding guidelines.
PayPay SDK https://developer.paypay.ne.jp/miniapp/docs/apireference/commonSpecs
Before integrating with the SDK, run through this checklist:
- Understand the payment flow
- Sign up for a PayPay developer/merchant account
- Generate the API keys from the Developer Panel. Use the sandbox API keys to test out the integration
APIs implemented:
- Cashback
- QR Code
- Payment
- User
- Wallet
Check out the Examples and API docs
import 'package:paypay_uo/paypay_uo.dart';
void main() async {
/// from your developer account
final apiKey = 'YOUR API KEY';
final apiSecret = 'YOUR API SECRET';
final assumeMerchant = 'YOUR ASSUME MERCHANT';
final auth = PayPayAuth(
merchantId: assumeMerchant, apiSecret: apiSecret, apiKey: apiKey);
final client = PayPayClient(apiMode: ApiMode.staging, auth: auth);
final payload = CreateQrCodePayload(
merchantPaymentId: PayPayClient.getTestMerchantPaymentId(),
amount: Amount(amount: 1, currency: 'JPY'),
codeType: 'ORDER_QR',
requestedAt: PayPayClient.getRequestedAt(),
orderItems: [
OrderItem(
name: "Cake",
quantity: 1,
unitPrice: Amount(amount: 20, currency: 'JPY'))
],
redirectType: "WEB_LINK",
redirectUrl: "http://foobar.com",
);
final response = await client.codeApi.createQRCode(payload);
print(response.statusCode);
print(response.body);
ApiResult result = PayPayClient.convertResponseToApiResult(response);
print(result.resultInfo.code);
}
It supports log output by Logger.
By default, execution of PayPay API and its result are output.
Specifying Level.debug or Level.verbose will output more detailed information.
Apache License Version 2.0
Copyright 2023 KATO Kanryu([email protected])
Please raise issues on GitHub. Pull requests always welcome.