mirror of
https://we.phorge.it/source/phorge.git
synced 2024-12-02 11:42:42 +01:00
23786784ef
Summary: Adds the Balanced PHP API to externals/. Ref T2787. Test Plan: Used in next diff. Reviewers: btrahan, chad Reviewed By: chad CC: aran, aurelijus Maniphest Tasks: T2787 Differential Revision: https://secure.phabricator.com/D5764
50 lines
956 B
PHP
50 lines
956 B
PHP
<?php
|
|
|
|
namespace Balanced;
|
|
|
|
use Balanced\Resource;
|
|
use \RESTful\URISpec;
|
|
|
|
/**
|
|
* Represents a refund of an account debit transaction.
|
|
*
|
|
* You create these via Balanced\Debit::refund.
|
|
*
|
|
* <code>
|
|
* $marketplace = \Balanced\Marketplace::mine();
|
|
*
|
|
* $account = $marketplace
|
|
* ->accounts
|
|
* ->query()
|
|
* ->filter(Account::f->email_address->eq('buyer@example.com'))
|
|
* ->one();
|
|
*
|
|
* $debit = $account->debit(
|
|
* 100,
|
|
* 'how it appears on the statement',
|
|
* 'a description',
|
|
* array(
|
|
* 'my_id': '443322'
|
|
* )
|
|
* );
|
|
*
|
|
* $debit->refund(
|
|
* 99,
|
|
* 'some description',
|
|
* array(
|
|
* 'my_id': '123123'
|
|
* )
|
|
* );
|
|
* </code>
|
|
*/
|
|
class Refund extends Resource
|
|
{
|
|
protected static $_uri_spec = null;
|
|
|
|
public static function init()
|
|
{
|
|
self::$_uri_spec = new URISpec('refunds', 'id');
|
|
self::$_registry->add(get_called_class());
|
|
}
|
|
}
|
|
|