Skip to content

Commit

Permalink
Merge pull request #62 from 202-ecommerce/develop
Browse files Browse the repository at this point in the history
5.2.0
  • Loading branch information
clotairer authored Sep 17, 2020
2 parents 12d2bc2 + ebe20c3 commit 9bb9ee9
Show file tree
Hide file tree
Showing 117 changed files with 8,775 additions and 3,436 deletions.
2 changes: 1 addition & 1 deletion 202/build.xml
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
<property name="src-dir" value="${basedir}" />
<property name="TARGETNAME" value="paypal" />
<property name="TARGETBRANCH" value="${env.GIT_BRANCH}" />
<property name="TARGETVERSION" value="5.1.5" />
<property name="TARGETVERSION" value="5.2.0" />
<property name="PHPVERSION" value="5.6" />
<property name="PSVERSION" value="1.7.5.x" />

Expand Down
1 change: 1 addition & 0 deletions 202/doc/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,3 +20,4 @@ order:
- Introduction
- Entities
- Controllers
- API
69 changes: 69 additions & 0 deletions 202/doc/src/ApiManagerInterface.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
---
name: PaypalApiManagerInterface
category: API
---

## Definition

For more flexibility and extensibility, the logic for creating orders,
refunds and cancellation is placed in the separate command classes.
Each command must implement the `RequestInteface` interface which contains only one
method `execute()`.
The api manager, which must implement `PaypalApiManagerInterface`, is
responsible for defining the required class. So `PaypalApiManagerInterface` is an
abstract factory of the `RequestInterace` commandes.

- **getAccessTokenRequest()**

Returns `RequestInteface` object that allow take an access token.
In fact it is used for checking of the credentials.


- **getAuthorizationVoidRequest(`PaypalOrder` $paypalOrder)**

Returns `RequestInteface` object that allow to cancel an authorized
transaction.


- **getCaptureAuthorizeRequest(`PaypalOrder` $paypalOrder)**

Returns `RequestInteface` object that allow to capture fonds from an authorized
transaction.


- **getOrderAuthorizeRequest(`string` $idPayment)**

Returns `RequestInteface` object that allow to create an authorized
transaction.


- **getOrderCaptureRequest(`string` $idPayment)**

Returns `RequestInteface` object that allow to capture fonds from a
transaction.


- **getOrderGetRequest(`string` $idPayment)**

Returns `RequestInteface` object that allow to get an information about a
transaction.


- **getOrderPartialRefundRequest(`PaypalOrder` $paypalOrder, `float` $amount)**

Returns `RequestInteface` object that allow to do partial refund.


- **getOrderPatchRequest(`string` $idPayment)**

Returns `RequestInteface` object that allow to update a transaction.


- **getOrderRefundRequest(`PaypalOrder` $paypalOrder)**

Returns `RequestInteface` object that allow to do refund of whole order.


- **getOrderRequest(`string` $idPayment)**

Returns `RequestInteface` object that allow to create a transaction.
157 changes: 134 additions & 23 deletions 202/doc/src/ClassMehtodAbstract.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,43 +8,154 @@ The AbstractMethodPaypal extends the abstract class AbstractMethod from PPBTlib.
## Definition
The AbstractMethodPaypal extends the abstract class AbstractMethod from PPBTlib.

#### load()
#### paypalApiManager

Static function.
Required parameter : $method like BT, EC, PPP.
Return method Class.
Protected property.
Type: PaypalApiManagerInterface
Must be defined in each children class

#### getPaymentMethod()
#### isSandbox

Protected.
Get payment method name depending on sandbox or live env.
Protected property.
Type: bool

#### doOrderPatch()

Public method.
Returns Response object.
Template method that is used for update an order on paypal

#### formatPrice($price \[,$isoCurrency = null\])

Public method.
price: float
isoCurrency: string
Returns float.

#### getBrandName()

Public method.
Returns a value of a configuration "Brand Name"

#### getCancelUrl()

Abstract public method.
Must be defined in each children class.
That is address where a client will be redirected after he click cancel
button in paypal checkout page.
Returns `string`

#### getClientId()

Abstract public method.
Must be defined in each children class.
Returns string

#### getCustomFieldInformation($cart)

Public method.
cart: Cart object
Returns string

#### getInfo(\[$paymentId\])

Public method.
paymentId: sting
returns ResponseOrderGet object that consists the information about a paypal order

#### getIntent()

Abstract public method.
returns `string` a value of a configuration "Payment mode" (sale / autorization)

#### getLandingPage()

Public method.
Returns `string`

#### getLinkToTransaction($log)

Public method.
log: PaypalLog object
returns `string` the link to paypal transaction

#### getPaypalPartnerId()

Abstract public method.
return `string`

#### getReturnUrl()

Abstract public method.
Must be defined in each children class.
That is address where a client will be redirected after he confirm a transaction.
Returns `string`

#### getSecret()

Abstract public method.
return `string`

#### getSellerNonce()

Abstract public method.
return `string`

#### getUrlJsSdkLib()

Public method.
returns `string` a address / url of a JS lib

#### init()

Abstract function. Must be defined in each children class.
Initialize payment method.
Public method.
Return ResponseOrderCreate object.
Template method that creates an order on PayPal

#### validation()
#### isConfigured()

Abstract function. Must be defined in each children class.
Validate the transaction. Create PrestaShop order.
Abstract public method.
returns `bool` true if module is configured and false if it is not

#### confirmCapture , refund, void
#### load(\[$method = null\])

Abstract functions.
Required parameter : $orderPayPal - PaypalOrder object.

#### partialRefund()
Static function.
method: string like BT, EC, PPP.
Return an object.

#### partialRefund($params)

Public method
params: `array` hookActionOrderSlipAdd parameters.
returns `ResponseOrderRefund` object.
That is a template method that is used for do a partial refund request

#### refund($paypalOrder)

Public method
params: `PaypalOrder` object.
returns `ResponseOrderRefund` object.
That is a template method that is used for do a full refund request

#### setDetailsTransaction($data)

Public method.
data: `ResponseOrderCapture` object
return void
That is a template method that is encapsulates a setting of transaction
data after a client confirm an order

#### validation()

Abstract functions.
Required parameter : $params - hookActionOrderSlipAdd parameters.
Public method.
returns `void`
That is a template method that is used for create an order in Prestashop

#### getConfig()
#### getUrlOnboarding()

Generate Helper Forms for specific method.
Protected method.
return `string`

#### setConfig()

Save method configurations.


Loading

0 comments on commit 9bb9ee9

Please sign in to comment.