Download the PHP package kreative/f3-pypl without Composer

On this page you can find all versions of the php package kreative/f3-pypl. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package f3-pypl

F3-PYPL Build Status

F3-PYPL is a Fat Free Framework plugin that helps quickly implement PayPal Express Checkout via the PayPal Classic API.

Express Checkout Shortcut & Mark Demo
Please use a sandbox account to make payments.

F3-PYPL Integration Demo

Quick Start Config

Add the following custom section to your project config.

If you prefer you can also pass an array with above values when you instantiate the classes.

Manual Install Copy the lib/paypal.php file into your lib/ or your AUTOLOAD folder.
or
Automatic Install via Composer

Quick Start

PayPal Express Checkout

Create a route that will initialize the transaction (SetExpressCheckout API) & redirect the buyer to PayPal.

Once the buyer is returned to your website you can simply complete the transaction (DoExpressCheckoutPayment API) by

$result will contain an associative array of the API response. Store the useful bits like status & transaction ID.

PayPal Pro

$result will contain an associative array of the API response. Store the useful bits like status & transaction ID.

Methods

Setting a Shipping Address

The setShippingAddress() method allows you to pass the shipping address to PayPal before creating the transaction. The address will appear when the buyer logs into PayPal or will be used to populate the address form fields on the Guest Checkout. This address is also used in the DoExpressCheckoutPayment API call so it will appear on the payment receipt & transaction history.

Passing Cart Line Items

The setLineItem() method allows you to pass multiple shopping cart line items to PayPal. This will appear on the order summary when the buyer is redirected to PayPal and is also used in the DoExpressCheckoutPayment API so a detailed breakdown of the order is available on the PayPal receipts & transaction history.

Passing Cart Line Items from Basket

The copyBasket() method allows you to transfer the F3 Basket line items to PayPal and returns a subtotal. If not specified quantity will default to 1.

Setting the Shipping Amount

The setShippingAmt() method allows you to specify an overall shipping amount.

Setting the Tax Amount

The setTaxAmt() method allows you to specify an overall tax amount.

Creating a transaction

The create() method will setup the transaction using the SetExpressCheckout API call. If successful a unique token is returned that identifies your newly created transaction. The buyer should then be redirected to PayPal with the EC-Token appended to the URL where they will be prompted to login or checkout as a guest.

Retrieving details from PayPal

Once the buyer is returned from PayPal to your return URL the getDetails() method can be used to retrieve all the transaction and buyer details via GetExpressCheckoutDetails API before completing the transaction. All details are returned as an array.

Updating the Buyers Shipping Address

The updateShippingAddress() method can be used to update the shipping address the buyer selected or added during the PayPal checkout via the GetExpressCheckoutDetails API. (Use getDetails() to retrieve this info).

The address is either added or updated in the current user session associated with the Express Checkout token. The address is used in the final API call so the address will appear on payment receipts.

Completing the Transaction

The complete() method calls the DoExpressCheckoutPayment API and completes the transaction.

Refunding a Transaction

The refund() method calls the RefundTransaction API and refunds the transaction. There are two types of refunds Full which will refund the full amount or partial which will refund an amount specified.

Express Checkout Mark (ECM)

The following is a quick guide on implementing PayPal Express Checkout as a payment method (Express Checkout Mark) and creating a Sale transaction where funds are immediately captured. In this flow, buyers initiate the Express Checkout flow after you have collected all their information such as name, email, shipping & billing address.

ECM payment flow

When the buyer chooses to pay with PayPal, the Express Checkout flow commences.

Define a new route that will be used to setup the Express Checkout transaction and redirect the buyer to PayPal.

When we create the transaction a token value will be returned in the response. The buyer is redirected to a specific URL with the token value defined so PayPal knows what transaction to display the buyer.

For simplicity the correct URL is returned from the create() method as the 'redirect' value.

After the buyer logs in or fills out their payment information on the guest checkout flow they will be redirected back to the URL defined in the PayPal section of your project config.

The URL will have two values appended to it, token & PayerID. The token will be the same EC token that is returned when you first created the transaction and the PayerID is a unique identifier for the buyers PayPal account.

At this stage in the checkout you can either show an order review with an option to Complete or simply complete the transaction and display an order receipt/summary.

Order Review Page - optional step

To display an order review page we can request all the transaction details from PayPal using the getDetails() method. This will include everything defined when you created the transaction and if the buyer has changed their shipping address on PayPal we can get the updated address from here.

Complete Transaction / Order Summary

You can simply complete the transaction using the complete() method and display an order summary/receipt page to the buyer.

Express Checkout Shortcut (ECS)

The following is a quick guide on implementing PayPal Express Checkout on the basket and creating a Sale transaction where funds are immediately captured. In this flow, buyers initiate the Express Checkout Shortcut flow from the shopping cart/basket bypassing sign up and address forms as we leverage the API to retrieve those details from PayPal.

ECS payment flow

When the buyer clicks the Checkout with PayPal, the Express Checkout flow commences.

Define a new route that will be used to setup the Express Checkout transaction and redirect the buyer to PayPal.

When we create the transaction a token value will be returned in the response. The buyer is redirected to a specific URL with the token value defined so PayPal knows what transaction to display the buyer.

For simplicity the correct URL is returned from the create() method as the 'redirect' value.

After the buyer logs in or fills out their payment information on the guest checkout flow they will be redirected back to the URL defined in the PayPal section of your project config.

The URL will have two values appended to it, token & PayerID. The token will be the same EC token that is returned when you first created the transaction and the PayerID is a unique identifier for the buyers PayPal account.

At this stage in the checkout you can either show an order review with an option to Complete or simply complete the transaction and display an order receipt/summary.

Order Review Page

To display an order review page we can request all the transaction details from PayPal using the getDetails() method. This will include everything defined when you created the transaction and if the buyer has changed their shipping address on PayPal we can get the updated address from here.

Complete Transaction / Order Summary

You can simply complete the transaction using the complete() method and display an order summary/receipt page to the buyer.

Recurring Payments

The following is a quick guide on implementing a recurring payment (subscription) via the classic API.

Define a new route that will be used to setup the Recurring Payment and redirect the buyer to PayPal.

Just like Express Checkout (we're leveraging the same API call) when we create the Recurring Payment a token value will be returned in the response. The buyer is redirected to a specific URL with the token value defined so PayPal knows what transaction to display the buyer.

For simplicity the correct URL is returned from the create() method as the 'redirect' value.

After the buyer logs and agree's to the Recurring Payment they will be redirected back to the URL defined in the PayPal section of your project config.

The URL will have one value appended to it token. The token will be the same token that is returned when you first created the recurring payment.

We now setup the terms of the recurring payment and create the profile.

`

Reference Transactions / Billing Agreements

The following is a quick guide on implementing Express Checkout Reference Transactions via the classic API.

Define a new route that will be used to setup the billing agreement and redirect the buyer to PayPal.

When the buyer returns from PayPal we use the EC Token to create the Billing agreement using the CreateBillingAgreement API request. A successful response will contain a ['BILLINGAGREEMENTID'] value. Save this value as it is required to create future reference transactions.

Once you have a valid billing agreement ID for the buyer you can create/complete a transaction on their behalf using the DoReferenceTransaction API.

PayPal Pro

To process credit/debit card numbers directly you can use the dcc() method.

`

License

F3-PYPL is licensed under GPL v.3


All versions of f3-pypl with dependencies

PHP Build Version
Package Version
Requires bcosca/fatfree Version ^3.5
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package kreative/f3-pypl contains the following files

Loading the files please wait ....