revolution/laravel-paypay

Simple integration Laravel and PayPay API

2.2.2 2024-03-14 09:12 UTC

This package is auto-updated.

Last update: 2024-04-14 09:16:05 UTC


README

packagist tests Maintainability Test Coverage

Simple integration Laravel and PayPay OpenPayment API.

https://developer.paypay.ne.jp/

https://github.com/paypay/paypayopa-sdk-php

Requirements

  • PHP >= 8.1
  • Laravel >= 10.0

Versioning

  • Basic : semver
  • Drop old PHP or Laravel version : +0.1. composer should handle it well.
  • Support only latest major version (master branch), but you can PR to old branches.

Installation

composer require revolution/laravel-paypay

Configuration

.env

PAYPAY_PRODUCTION=false
PAYPAY_API_KEY=
PAYPAY_API_SECRET=
PAYPAY_MERCHANT_ID=
PAYPAY_CURRENCY=JPY

Usage

Magic method returns the corresponding controller class.

use Revolution\PayPay\Facades\PayPay;

// PayPay\OpenPaymentAPI\Controller\Code
$code = PayPay::code();

// PayPay\OpenPaymentAPI\Controller\Payment
$payment = PayPay::payment();

// PayPay\OpenPaymentAPI\Controller\Refund
$refund = PayPay::refund();
use Revolution\PayPay\Facades\PayPay;
use PayPay\OpenPaymentAPI\Models\CreateQrCodePayload;

$payload = new CreateQrCodePayload();
// ...

$response = PayPay::code()->createQRCode($payload);

// ...

Testing

use Revolution\PayPay\Facades\PayPay;

PayPay::shouldReceive('code->createQRCode')->once()->andReturn([]);

LICENSE

MIT