Skip to content
This repository was archived by the owner on Aug 22, 2025. It is now read-only.
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
18 commits
Select commit Hold shift + click to select a range
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions lib/PayPal/Api/Amount.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ class Amount extends PayPalModel
* 3-letter [currency code](https://developer.paypal.com/docs/integration/direct/rest_api_payment_country_currency_support/). PayPal does not support all currencies.
*
* @param string $currency
*
*
* @return $this
*/
public function setCurrency($currency)
Expand All @@ -46,7 +46,7 @@ public function getCurrency()
* Total amount charged from the payer to the payee. In case of a refund, this is the refunded amount to the original payer from the payee. 10 characters max with support for 2 decimal places.
*
* @param string|double $total
*
*
* @return $this
*/
public function setTotal($total)
Expand All @@ -71,7 +71,7 @@ public function getTotal()
* Additional details of the payment amount.
*
* @param \PayPal\Api\Details $details
*
*
* @return $this
*/
public function setDetails($details)
Expand Down
68 changes: 68 additions & 0 deletions lib/PayPal/Api/ReportingTransactionAmount.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
<?php

namespace PayPal\Api;

use PayPal\Common\PayPalModel;
use PayPal\Converter\FormatConverter;
use PayPal\Validation\NumericValidator;

/**
* Class ReportingTransactionAmount
*
* payment amount model used by reporting transactions.
*
* @package PayPal\Api
*
* @property string currency_code
* @property string value
*/
class ReportingTransactionAmount extends PayPalModel
{
/**
* 3-letter [currency code](https://developer.paypal.com/docs/integration/direct/rest_api_payment_country_currency_support/). PayPal does not support all currencies.
*
* @param string $currency_code
*
* @return $this
*/
public function setCurrencyCode($currency_code)
{
$this->currencyCode = $currency_code;
return $this;
}

/**
* 3-letter [currency code](https://developer.paypal.com/docs/integration/direct/rest_api_payment_country_currency_support/). PayPal does not support all currencies.
*
* @return string
*/
public function getCurrencyCode()
{
return $this->currencyCode;
}

/**
* Set amount value. Format it using currency converter.
*
* @param string|double $value
*
* @return $this
*/
public function setValue($value)
{
NumericValidator::validate($value, "Total");
$value = FormatConverter::formatToPrice($value, $this->getCurrencyCode());
$this->value = $value;
return $this;
}

/**
* Get amount value.
*
* @return string
*/
public function getValue()
{
return $this->value;
}
}
37 changes: 37 additions & 0 deletions lib/PayPal/Api/ReportingTransactionDetails.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
<?php


namespace PayPal\Api;

use PayPal\Common\PayPalModel;

/**
* Class ReportingTransactionInfo.
*
* Model for transaction details.
*
* @package PayPal\Api
*
* @property \PayPal\Api\ReportingTransactionInfo transaction_info
*/
class ReportingTransactionDetails extends PayPalModel
{
protected $transactionInfo;
// @TODO: build rest of fields!

/**
* @return \PayPal\Api\ReportingTransactionInfo
*/
public function getTransactionInfo()
{
return $this->transactionInfo;
}

/**
* @param \PayPal\Api\ReportingTransactionInfo $transactionInfo
*/
public function setTransactionInfo($transactionInfo)
{
$this->transactionInfo = $transactionInfo;
}
}
Loading