Skip to content

paypay_uo (PayPay Unofficial) is a client library for PayPay's Open Payment API (OPA) faithfully ported from paypayopa-sdk-php

License

Notifications You must be signed in to change notification settings

kanryu/paypay_uo

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

22 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

paypay_uo

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.

SDK

PayPay SDK https://developer.paypay.ne.jp/miniapp/docs/apireference/commonSpecs

Prerequisites

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

Features

APIs implemented:

  • Cashback
  • QR Code
  • Payment
  • User
  • Wallet

Usage

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);
}

Logger

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.

License

Apache License Version 2.0

Author

Copyright 2023 KATO Kanryu(k.kanryu@gmail.com)

Additional information

Please raise issues on GitHub. Pull requests always welcome.

License Coverage Status Maintainability Black Duck Security Risk FOSSA Status Quality Gate Status Codacy Badge BCH compliance

About

paypay_uo (PayPay Unofficial) is a client library for PayPay's Open Payment API (OPA) faithfully ported from paypayopa-sdk-php

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages