Download the PHP package webservco/paypal without Composer
On this page you can find all versions of the php package webservco/paypal. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download webservco/paypal
More information about webservco/paypal
Files in webservco/paypal
Package paypal
Short Description A PHP component/library.
License MIT
Homepage https://webserv.co
Informations about the package paypal
webservco/paypal
A PayPal REST API implementation.
Implemented functionality: Orders v2.
Resources
Storage
Structure
Both table names and field names can be customized.
Table order_payment
Fields to add to an existing table
- Mandatory:
order_reference
: implementation specific, eg.VARCHAR(45) NOT NULL
, - Mandatory:
order_total
: implementation specific, eg.DECIMAL(10,2) NOT NULL
- Optional:
order_currency
:CHAR(3) NOT NULL
, - Mandatory:
order_payment_status
VARCHAR(45) DEFAULT NULL
, - Mandatory:
payment_event_date_time
DATETIME DEFAULT NULL
,
New table example
Table payment_access_token
Configuration
Use environment variables (check example configuration) (app url, default currency, table and fields names);
If not using order level currency, make sure to set the PAYMENT_DEFAULT_CURRENCY
options, and leave blank PAYMENT_FIELD_NAME_ORDER_CURRENCY
.
If using a very specialized setup and using the configuration is not enough, you can implement \WebServCo\Contract\Storage\Order\OrderPaymentStorageInterface
specifically for your project.
Usage
An example is located in the directory public/payment
.
Copy the files in your local project and adapt the paths.
Note: If a custom implementation is required, check and adapt the code located in src/example_implementation
.
Testing the example implementation
- Create
config/.env.ini
; - Fill paypal info
- Start project:
ddev start
- Create tables;
-
Create a test order:
- Open payment page:
https://paypal.ddev.site/payment/pay.php?orderReference=Test1&languageCode=en
Note: languageCode
is optional and only used internally in implementing project.
If you set it when initialize the payment, it will arrive as parameter to the PAYMENT_RESULT_LOCATION
and the PAYMENT_CANCEL_LOCATION
.
TODO
[ ] Find a way to suppress Psalm "UnusedVariable" errors.
Not working (generates "UnusedPsalmSuppress" error):
Reference: Docblock suppression
All versions of paypal with dependencies
nyholm/psr7 Version ^1
psr/http-client Version ^1
psr/http-message Version ^2
symfony/http-client Version ^6
webservco/configuration Version ^0
webservco/data Version ^0
webservco/database Version ^0
webservco/log Version ^0