-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* update namespace * add upgrading steps * add api docs * add other api docs
- Loading branch information
Showing
34 changed files
with
906 additions
and
720 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,93 @@ | ||
# Amount Breakdown | ||
|
||
coming soon. | ||
See https://developer.paypal.com/docs/api/orders/v2/#definition-Amount_breakdown. | ||
|
||
## Methods | ||
|
||
### AmountBreakdown::__construct() | ||
|
||
Creates an amount breakdown object using constructor. | ||
|
||
#### Signature | ||
|
||
```php | ||
public function __construct(string $value, string $currency_code = 'USD'); | ||
``` | ||
|
||
#### Example | ||
|
||
```php | ||
$amount = new AmountBreakdown('100.00', 'USD'); | ||
``` | ||
|
||
### AmountBreakdown::of() | ||
|
||
Creates an amount from a value and an optional currency code. | ||
|
||
#### Signature | ||
|
||
```php | ||
public static function of(string $value, string $currency_code = 'USD'): AmountBreakdown; | ||
``` | ||
|
||
#### Example | ||
|
||
```php | ||
$amount = AmountBreakdown::of('100.00', 'USD'); | ||
``` | ||
|
||
### AmountBreakdown::getCurrencyCode() | ||
|
||
Gets an amount currency code. | ||
|
||
#### Signature | ||
|
||
```php | ||
public function getCurrencyCode(): string; | ||
``` | ||
|
||
#### Example | ||
|
||
```php | ||
$amount = AmountBreakdown::of('100.00', 'USD'); | ||
$currency = $amount->getCurrencyCode(); // USD | ||
``` | ||
|
||
### AmountBreakdown::getValue() | ||
|
||
Gets an amount value. | ||
|
||
#### Signature | ||
|
||
```php | ||
public function getValue(): string; | ||
``` | ||
|
||
#### Example | ||
|
||
```php | ||
$amount = AmountBreakdown::of('100.00', 'USD'); | ||
$value = $amount->getValue(); // '100.00' | ||
``` | ||
|
||
### AmountBreakdown::toArray() | ||
|
||
Casts the AmountBreakdown an array representation, used when serializing an amount into http request. | ||
|
||
#### Signature | ||
|
||
```php | ||
public function toArray(): array; | ||
``` | ||
|
||
#### Example | ||
|
||
```php | ||
$amount = AmountBreakdown::of('100.00', 'USD'); | ||
$array = $amount->toArray(); | ||
// result | ||
[ | ||
'value' => '100.00', | ||
'currency_code' => 'USD' | ||
]; | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,93 @@ | ||
# Amount | ||
|
||
coming soon. | ||
See https://developer.paypal.com/docs/api/orders/v2/#definition-Amount_breakdown. | ||
|
||
## Methods | ||
|
||
### Amount::__construct() | ||
|
||
Creates an amount object using constructor. | ||
|
||
#### Signature | ||
|
||
```php | ||
public function __construct(string $value, string $currency_code = 'USD'); | ||
``` | ||
|
||
#### Example | ||
|
||
```php | ||
$amount = new Amount('100.00', 'USD'); | ||
``` | ||
|
||
### Amount::of() | ||
|
||
Creates an amount from a value and an optional currency code. | ||
|
||
#### Signature | ||
|
||
```php | ||
public static function of(string $value, string $currency_code = 'USD'): Amount; | ||
``` | ||
|
||
#### Example | ||
|
||
```php | ||
$amount = Amount::of('100.00', 'USD'); | ||
``` | ||
|
||
### Amount::getCurrencyCode() | ||
|
||
Gets an amount currency code. | ||
|
||
#### Signature | ||
|
||
```php | ||
public function getCurrencyCode(): string; | ||
``` | ||
|
||
#### Example | ||
|
||
```php | ||
$amount = Amount::of('100.00', 'USD'); | ||
$currency = $amount->getCurrencyCode(); // USD | ||
``` | ||
|
||
### Amount::getValue() | ||
|
||
Gets an amount value. | ||
|
||
#### Signature | ||
|
||
```php | ||
public function getValue(): string; | ||
``` | ||
|
||
#### Example | ||
|
||
```php | ||
$amount = Amount::of('100.00', 'USD'); | ||
$value = $amount->getValue(); // '100.00' | ||
``` | ||
|
||
### Amount::toArray() | ||
|
||
Casts the Amount an array representation, used when serializing an amount into http request. | ||
|
||
#### Signature | ||
|
||
```php | ||
public function toArray(): array; | ||
``` | ||
|
||
#### Example | ||
|
||
```php | ||
$amount = Amount::of('100.00', 'USD'); | ||
$array = $amount->toArray(); | ||
// result | ||
[ | ||
'value' => '100.00', | ||
'currency_code' => 'USD' | ||
]; | ||
``` |
Oops, something went wrong.