rawcreative/receiptful

Receiptful PHP 集成

0.2.0 2015-05-13 17:10 UTC

This package is not auto-updated.

Last update: 2024-09-28 16:57:07 UTC


README

Latest Version Software License Total Downloads

A PHP SDK for the Receiptful API. See the Receiptful API Docs for more information.

安装

通过 Composer

$ composer require rawcreative/receiptful

使用方法

<?php 
require '../vendor/autoload.php';

$receiptful = RawCreative\Receiptful\Api::factory([
    'apiKey' => 'your api key here'
]);

$result = $receiptful->receipts();

var_dump($result);

与 Laravel 一起使用

为了方便与 Laravel 5 集成,请安装配套包

$ composer require rawcreative/laravel-receiptful

可用方法

收据

receipts
$receipts = $receiptful->receipts();
receipt
$receipt = $receiptful->receipt($receiptId);
sendReceipt

有关所需参数的列表,请参阅 API 文档

$result = $receiptful->sendReceipt(array $receipt); 
resendReceipt
$result = $receiptful->resendReceipt($receiptId);
resend

resendReceipt 的别名

$result = $receiptful->resend($receiptId);

优惠券

coupons
$coupons = $receiptful->coupons();
coupon
$coupon = $receiptful->coupon($couponId);
deleteCoupon
$coupon = $receiptful->deleteCoupon($couponId);
useCoupon
$coupon = $receiptful->useCoupon($couponId, $reference, $amount, $currency);

用户

获取 API 密钥的信息

$user = $receiptful->currentUser();

贡献

有关详细信息,请参阅 CONTRIBUTING

许可证

The MIT License (MIT). 请参阅 许可证文件 以获取更多信息。