Skip to content

Commit

Permalink
GitBook: [main] 17 pages modified
Browse files Browse the repository at this point in the history
  • Loading branch information
Mohammed Elhaouari authored and gitbook-bot committed Oct 8, 2021
1 parent eb2f4c6 commit 00a4475
Show file tree
Hide file tree
Showing 17 changed files with 57 additions and 57 deletions.
9 changes: 3 additions & 6 deletions docs/README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
# Introduction

This Package is a PHP SDK wrapper around version 2 of the PayPal rest API. It provides a simple, fluent API to create
and capture orders with both sandbox and production environments supported.
This Package is a PHP SDK wrapper around version 2 of the PayPal rest API. It provides a simple, fluent API to create and capture orders with both sandbox and production environments supported.

Here are some quick code examples of what you can do:

Expand Down Expand Up @@ -49,7 +48,5 @@ $result = json_decode($response->getBody()->getContents());

## We have badges!

![Tests](https://github.com/phpjuice/paypal-checkout-sdk/workflows/Tests/badge.svg?branch=main)
[![Latest Stable Version](http://poser.pugx.org/phpjuice/paypal-checkout-sdk/v)](https://packagist.org/packages/phpjuice/paypal-checkout-sdk)
[![Total Downloads](http://poser.pugx.org/phpjuice/paypal-checkout-sdk/downloads)](https://packagist.org/packages/phpjuice/paypal-checkout-sdk)
[![License](http://poser.pugx.org/phpjuice/paypal-checkout-sdk/license)](https://packagist.org/packages/phpjuice/paypal-checkout-sdk)
![Tests](https://github.com/phpjuice/paypal-checkout-sdk/workflows/Tests/badge.svg?branch=main) [![Latest Stable Version](http://poser.pugx.org/phpjuice/paypal-checkout-sdk/v)](https://packagist.org/packages/phpjuice/paypal-checkout-sdk) [![Total Downloads](http://poser.pugx.org/phpjuice/paypal-checkout-sdk/downloads)](https://packagist.org/packages/phpjuice/paypal-checkout-sdk) [![License](http://poser.pugx.org/phpjuice/paypal-checkout-sdk/license)](https://packagist.org/packages/phpjuice/paypal-checkout-sdk)

35 changes: 18 additions & 17 deletions docs/SUMMARY.md
Original file line number Diff line number Diff line change
@@ -1,24 +1,25 @@
# Summary
# Table of contents

- [Introduction](README.md)
- [Requirements](requirements.md)
- [Installation](installation.md)
- [Upgrading](upgrading.md)
- [Questions and issues](questions-and-issues.md)
- [Changelog](changelog.md)
* [Introduction](README.md)
* [Requirements](requirements.md)
* [Installation](installation.md)
* [Upgrading](upgrading.md)
* [Questions and issues](questions-and-issues.md)
* [Changelog](changelog.md)

## Basic Usage

- [Create an Order](basic-usage/order-create.md)
- [Show an Order](basic-usage/order-show.md)
- [Capture an Order](basic-usage/order-capture.md)
* [Create an Order](basic-usage/order-create.md)
* [Show an Order](basic-usage/order-show.md)
* [Capture an Order](basic-usage/order-capture.md)

## Api

- [Amount](api/amount.md)
- [Amount Breakdown](api/amount-breakdown.md)
- [Application Context](api/application-context.md)
- [Item](api/item.md)
- [Order](api/order.md)
- [Payee](api/payee.md)
- [Purchase Unit](api/purchase-unit.md)
* [Amount](api/amount.md)
* [Amount Breakdown](api/amount-breakdown.md)
* [Application Context](api/application-context.md)
* [Item](api/item.md)
* [Order](api/order.md)
* [Payee](api/payee.md)
* [Purchase Unit](api/purchase-unit.md)

3 changes: 2 additions & 1 deletion docs/api/amount-breakdown.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# AmountBreakdown
# Amount Breakdown

coming soon.

1 change: 1 addition & 0 deletions docs/api/amount.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# Amount

coming soon.

1 change: 1 addition & 0 deletions docs/api/application-context.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# Application Context

coming soon.

1 change: 1 addition & 0 deletions docs/api/item.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# Item

coming soon.

1 change: 1 addition & 0 deletions docs/api/order.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# Order

coming soon.

1 change: 1 addition & 0 deletions docs/api/payee.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# Payee

coming soon.

3 changes: 2 additions & 1 deletion docs/api/purchase-unit.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# PurchaseUnit
# Purchase Unit

coming soon.

16 changes: 6 additions & 10 deletions docs/basic-usage/order-capture.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
# Capture an Order

To successfully capture payment for an order, the buyer must first approve the order or a valid payment_source must be
provided in the request. A buyer can approve the order upon being redirected to the `rel:
approve` URL that was provided the HATEOAS links in the [Create Order](order-create.md) response.
To successfully capture payment for an order, the buyer must first approve the order or a valid payment\_source must be provided in the request. A buyer can approve the order upon being redirected to the `rel: approve` URL that was provided the HATEOAS links in the [Create Order](order-create.md) response.

```php
use PayPal\Checkout\Http\OrderCaptureRequest;
Expand All @@ -20,11 +18,9 @@ $response = $client->send($request);
$result = json_decode($response->getBody()->getContents());
```

A successful response to a non-idempotent request returns the HTTP `201` Created status code with a JSON response body
that shows captured payment details. If a duplicate response is retried, returns the HTTP `200` OK status code. By
default, the response is minimal.
A successful response to a non-idempotent request returns the HTTP `201` Created status code with a JSON response body that shows captured payment details. If a duplicate response is retried, returns the HTTP `200` OK status code. By default, the response is minimal.

```json
```javascript
{
"id": "8F783829JA718493L",
"intent": "CAPTURE",
Expand Down Expand Up @@ -157,8 +153,7 @@ default, the response is minimal.

## Catching Errors

If a payment is not yet approved by the buyer, An error response with status code `422` is returned with a JSON response
body that shows errors.
If a payment is not yet approved by the buyer, An error response with status code `422` is returned with a JSON response body that shows errors.

Inorder to catch validation errors from PayPal, you can add the following:

Expand All @@ -176,7 +171,7 @@ try {

Errors :

```json
```javascript
{
"name": "UNPROCESSABLE_ENTITY",
"details": [
Expand All @@ -196,3 +191,4 @@ Errors :
]
}
```

9 changes: 4 additions & 5 deletions docs/basic-usage/order-create.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
# Create an Order

An order represents a payment between two or more parties. and inorder to create a new order we must send
an `OrderCreateRequest` to PayPal API.
An order represents a payment between two or more parties. and inorder to create a new order we must send an `OrderCreateRequest` to PayPal API.

```php
use PayPal\Checkout\Http\OrderCreateRequest;
Expand All @@ -27,10 +26,9 @@ $response = $client->send(new OrderCreateRequest($order));
$result = json_decode($response->getBody()->getContents());
```

A successful request returns the HTTP `201` Created status code and a JSON response body that includes by default a
minimal response with the `ID`, `status`, and `HATEOAS` links.
A successful request returns the HTTP `201` Created status code and a JSON response body that includes by default a minimal response with the `ID`, `status`, and `HATEOAS` links.

```json
```javascript
{
"id": "8F783829JA718493L",
"status": "CREATED",
Expand Down Expand Up @@ -58,3 +56,4 @@ minimal response with the `ID`, `status`, and `HATEOAS` links.
]
}
```

6 changes: 3 additions & 3 deletions docs/basic-usage/order-show.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,9 @@ $response = $client->send($request);
$result = json_decode($response->getBody()->getContents());
```

A successful request returns the HTTP `200` status code and a JSON response body that includes by default a minimal
response with the `ID`, `status`, and `HATEOAS` links.
A successful request returns the HTTP `200` status code and a JSON response body that includes by default a minimal response with the `ID`, `status`, and `HATEOAS` links.

```json
```javascript
{
"id": "8F783829JA718493L",
"intent": "CAPTURE",
Expand Down Expand Up @@ -82,3 +81,4 @@ response with the `ID`, `status`, and `HATEOAS` links.
]
}
```

3 changes: 2 additions & 1 deletion docs/changelog.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# Changelog

All notable changes to `paypal-checkout-sdk` are documented on [GitHub](../changelog.md)
All notable changes to `paypal-checkout-sdk` are documented on [GitHub](https://github.com/phpjuice/paypal-checkout-sdk/tree/eb2f4c679d997d8cedcbde12cfec7b35bd3cf9e8/changelog.md)

5 changes: 2 additions & 3 deletions docs/installation.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,7 @@ composer require phpjuice/paypal-checkout-sdk

## Setup Credentials

Get client ID and client secret by going
to [https://developer.paypal.com/developer/applications](https://developer.paypal.com/developer/applications) and
generating a REST API app. Get Client ID and Secret from there.
Get client ID and client secret by going to [https://developer.paypal.com/developer/applications](https://developer.paypal.com/developer/applications) and generating a REST API app. Get Client ID and Secret from there.

## Setup a Paypal Client

Expand Down Expand Up @@ -51,3 +49,4 @@ $environment = new ProductionEnvironment($clientId, $clientSecret);
// create a new client
$client = new PayPalClient($environment);
```

5 changes: 2 additions & 3 deletions docs/questions-and-issues.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
# Questions and issues

Find yourself stuck using the package? Found a bug? Do you have general questions or suggestions for improving the
package? Feel free to [create an issue on GitHub](https://github.com/phpjuice/paypal-checkout-sdk/issues), we'll try to
address it as soon as possible.
Find yourself stuck using the package? Found a bug? Do you have general questions or suggestions for improving the package? Feel free to [create an issue on GitHub](https://github.com/phpjuice/paypal-checkout-sdk/issues), we'll try to address it as soon as possible.

If you discover any security related issues, please email us at [email protected] instead of using the issue tracker.

11 changes: 6 additions & 5 deletions docs/requirements.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
# Requirements

`paypal-checkout-sdk` Package requires PHP 7.4 or higher. If you are using an older version of php this package may not
function correctly.
## Requirements

# Older versions
`paypal-checkout-sdk` Package requires PHP 7.4 or higher. If you are using an older version of php this package may not function correctly.

## Older versions

If you do not meet the requirements, you can opt to use an older version of the package. We only actively maintain the latest version.

If you do not meet the requirements, you can opt to use an older version of the package. We only actively maintain the
latest version.
4 changes: 2 additions & 2 deletions docs/upgrading.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,5 @@

## UPGRADING FROM V1 TO V2

There are no special requirements for upgrading from v1 to v2, other than changing ^1.xx (xx can vary) to ^2.0 in your
composer. json and running `composer update`. Of course, your app must meet the minimum requirements as well.
There are no special requirements for upgrading from v1 to v2, other than changing ^1.xx \(xx can vary\) to ^2.0 in your composer. json and running `composer update`. Of course, your app must meet the minimum requirements as well.

0 comments on commit 00a4475

Please sign in to comment.