zeevx/laravel-ovalfi

OvalFi 的 Laravel 扩展包 - https://dev.ovalfi-app.com/

0.1.2 2022-08-25 15:41 UTC

This package is auto-updated.

Last update: 2024-09-25 20:31:22 UTC


README

OvalFi Laravel 扩展包

Laravel-OvalFi 帮助您在 Laravel 应用中直接设置、测试和管理您的 OvalFi 集成。

Latest Version on Packagist Total Downloads GitHub Actions

安装

您可以通过 composer 安装此包

composer require zeevx/laravel-ovalfi

安装后,运行以下命令(以创建 ovalfi.php 配置文件)

php artisan ovalfi:publish

将以下内容添加到您的 .env 文件中,您可以从 ovalfi 控制台获取这些值

注意:OVALFI_MODE 应设置为 sandbox 以进行测试,设置为 live 以进行生产。

OVALFI_MODE=
OVALFI_PUBLIC_KEY=
OVALFI_BEARER_TOKEN=

用法

使用辅助函数

ovalfi() //It works automatically 😍

创建客户

ovalfi()->createCustomer(
        string $name,
        string $mobile_number,
        string $email,
        string $reference,
        string $yield_offering_id
        );

更新客户

ovalfi()->updateCustomer(
        string $customer_id,
        string $name = null,
        string $mobile_number = null,
        string $email = null,
        string $reference = null,
        string $yield_offering_id = null
    );

获取客户

ovalfi()->getCustomers();

获取单个客户

ovalfi()->getCustomer(
        string $customer_id
    );

获取汇率

ovalfi()->getExchangeRate(
        float $amount,
        string $currency,
        string $destination_currency
    );

发起转账

注意:请参阅此文档以更好地了解参数:https://docs.ovalfi.com/docs/initiate-transfer

ovalfi()->initiateTransfer(
        string $customer_id,
        float $amount,
        string $currency,
        array $destination,
        string $reason,
        string $reference,
        string $note = null
    );

通过批量 ID 取消转账

ovalfi()->cancelTransferByBatchId(
        string $batch_id,
        string $reason
    );

获取商业投资组合

ovalfi()->getBusinessPortfolios();

创建收益提供者档案

ovalfi()->createYieldOfferingProfile(
        string $name,
        string $reference,
        string $description,
        string $portfolio_id = null,
        float $apy_rate = null,
        string $currency = null,
        int $deposit_lock_day = null,
        float $minimum_deposit_allowed = null,
        float $maximum_deposit_allowed = null,
        int $yieldable_after_day = null,
        float $withdrawal_limit_rate = null
    );

获取收益档案

ovalfi()->getYieldProfiles();

获取单个收益档案

ovalfi()->getYieldProfile(
        string $yield_offering_id
    );

更新收益提供者档案

ovalfi()->updateYieldOfferingProfile(
        string $yield_offering_id,
        string $name = null,
        string $reference = null,
        string $description = null,
        string $portfolio_id = null,
        float $apy_rate = null,
        string $currency = null,
        int $deposit_lock_day = null,
        float $minimum_deposit_allowed = null,
        float $maximum_deposit_allowed = null,
        int $yieldable_after_day = null,
        float $withdrawal_limit_rate = null
    );

获取客户余额

ovalfi()->getCustomerBalance(
        string $customer_id
    );

发起储蓄存款

ovalfi()->initiateSavingsDeposit(
        string $customer_id,
        string $reference,
        float $amount
    );

获取存款

ovalfi()->getDeposits();

通过批量 ID 获取存款

ovalfi()->getDepositByBatchId(
        string $batch_id
    );

发起储蓄提款

ovalfi()->initiateSavingsWithdrawal(
        string $customer_id,
        string $reference,
        float $amount
    );

安全

如果您发现任何安全问题,请通过电子邮件 adamsohiani@gmail.com 而不是使用问题跟踪器来报告。

致谢

许可证

MIT 许可证(MIT)。有关更多信息,请参阅许可证文件