非官方的 OVOID API 包装器

v3.2 2021-10-29 15:57 UTC

This package is auto-updated.

Last update: 2024-09-29 05:08:38 UTC


README

Packagist patreons

捐赠

https://trakteer.id/stefanus-lintang/tip

非官方 ovoid API 包装器

已在 OVO 版本 3.43.0 上测试 | 2021 年 9 月 24 日 | PHP 7.2.2

端口

如果你不习惯使用 PHP,可以尝试其他编程语言,或者如果你想用那种语言编写,请稍后提交 Issue,我会在这里列出

Python

Flutter

GO

Java

Ruby

JavaScript / nodejs

安装

composer require lintangtimur/ovoid

登录

第一步

require 'vendor/autoload.php';
use Stelin\OVOID;

$ovo = new OVOID(null, "contoh-device-id");
echo $ovo->OTP("+62xxxxxxxx")->getData()->getOtp()->getOtpRefId();

第二步

echo $ovo->OTPValidation("+62xxxxxx", "otp-ref-id", "otp")->getData()->getOtp()->getOtpToken();

第三步

echo $ovo->accountLogin("+62xxxxx", 'otp-ref-id', 'otp-token', '6-digit-security-code')->getData()->getAuth()->getAccessToken();

余额模型

获取支付方式

getPaymentMethod()

获取卡余额

getCardBalance($payment_method)

获取卡号

getCardNo($payment_method)

示例

<?php

require 'vendor/autoload.php';

use Stelin\OVOID;
$ovoid = new OVOID($authToken);
dd($ovoid->modelBalance()->getBalance()->getCardNo()('OVO'));

个人资料模型

权限模型

同 OVO 转账

Telah di test di OVO 2.8.0

在转账之前,请使用 isOVO() 方法检查其账户是否正确,然后执行以下方法

public function transferOvo($to_mobilePhone, $amount, $message = null)

目前只能转两次,第三次转账到 OVO 需要头部签名。如果有人能找到签名过程,请愉快地提交 pull request :)

交易历史

/**
     * Wallet Transaction
     *
     * @param int $page halaman ke berapa
     * @param int $limit berapa kontent dalam 1 page
     * @return \Stelin\Response\WalletTransactionResponse
     */
    public function getWalletTransaction($page, $limit = 10)

那里有一个硬编码的产品类型 001,可以自己尝试一下它的影响,因为我测试的是同 OVO 的转账

获取所有通知

    /**
     * get all notification
     *
     * @return \Stelin\Response\NotificationAllResponse
     */
    public function allNotification()

检查未读通知的数量

/**
     * mendapatkan total unread history
     *
     * @return \Stelin\Response\NotificationUnread
     */
    public function unreadHistory()

示例: $ovo->unreadHistory()->getTotal()

跨行转账

    /**
     * transer antar bank
     *
     * @param  string                                  $accountName          nama akun
     * @param  string                                  $accountNo            No akun OVO Cash
     * @param  string                                  $accountNoDestination No rekening yang dituju
     * @param  int                                     $amount               jumlah yang akan ditransfer
     * @param  string                                  $bankCode             kode bank yang dituju
     * @param  string                                  $bankName             nama bank
     * @param  string                                  $message
     * @param  string                                  $notes
     * @return \Stelin\Response\TransferDirectResponse
     */
    public function transferBank($accountName, $accountNo, $accountNoDestination, $amount, $bankCode, $bankName, $message, $notes)

待办事项

  • 同 OVO 转账超过 2 次的签名头部

贡献

我非常粗略地创建了此项目,因此当请求到 OVO 端点并发生失败或参数不正确时,脚本仍然无法从 OVO 获取响应错误,必须手动从源代码(从文件 Response)中进行 dd。因此,请愉快地贡献,无论是文档程序还是改进此脚本 :)