Skip to content

Commit

Permalink
Implementación de devolución de comisiones.
Browse files Browse the repository at this point in the history
  • Loading branch information
Federico Balderas committed Nov 17, 2017
1 parent 020fe1e commit 56ea0d9
Showing 1 changed file with 32 additions and 20 deletions.
52 changes: 32 additions & 20 deletions resources/OpenpayFee.php
Original file line number Diff line number Diff line change
@@ -1,30 +1,42 @@
<?php
<?php

/**
* Openpay API v1 Client for PHP (version 1.0.0)
*
* Copyright © Openpay SAPI de C.V. All rights reserved.
* http://www.openpay.mx/
* soporte@openpay.mx
*/
class OpenpayFee extends OpenpayApiResourceBase
{

protected $authorization;
protected $creation_date;
protected $currency;
protected $operation_type;
protected $status;
protected $transaction_type;
protected $error_message;
protected $method;
protected $derivedResources = array('Refund' => null);

public function refund($params) {
$resource = $this->derivedResources['refunds'];
if ($resource) {
return parent::_create($resource->resourceName, $params, array('parent' => $this));
}
}

}

// ----------------------------------------------------------------------------
class OpenpayFeeList extends OpenpayApiDerivedResource
{

public function create($params) {
return $this->add($params);
}

class OpenpayFee extends OpenpayApiResourceBase {
protected $authorization;
protected $creation_date;
protected $currency;
protected $operation_type;
protected $status;
protected $transaction_type;
protected $error_message;
protected $method;
}
// ----------------------------------------------------------------------------
class OpenpayFeeList extends OpenpayApiDerivedResource {
public function create($params) {
return $this->add($params);
}
public function get($params) {
// TODO: throw exception
return null;
}
}

?>

0 comments on commit 56ea0d9

Please sign in to comment.