Download the PHP package peggyforms/php-sdk without Composer
On this page you can find all versions of the php package peggyforms/php-sdk. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Informations about the package php-sdk

Peggy Pay PHP SDK
Use this SDK for easy communication with Peggy Pay.
Install
composer require peggyforms/php-sdk dev-master
Current version: 1.1.17
Basic Usage
Init
You have to start always by initialize the PeggyPay object with your API key. You can find your API key in your account
Get submission by hash
Easily get a submission by its Hash code. Every redirect of Peggy Pay sends the submission hash in the parametere: peggyHash
Easily get field submitted value:
This is the way to get the payment status of an order:
ADVANCED usage - Dynamic content
For plans with AJAX / HTTP features you can:
- populate choicefields, lists, ajax proxy and datagrids.
- create custom field validation
- respond to the POST submit action
Choicefields
Datagrid
Validation
You can validate your form fields using the default validation tools in the editor. When you need custom valdation, you can use Javascript. Or you can setup to validate via an HTTP request. This example is for validating a field via an HTTP request.
Populate the Ajax Proxy field
The Ajax Proxy field can be very useful if you have 1 web service which provides multiple data sets. For example, if your API call returns a list of products and a list of countries, the AJAX proxy field is very useful. Only 1 HTTP request will be made and all the dependent fields will use this result as data source.
In this example we use typeless objects, but you can use any JSON-serializable object.
Populate pricefields within ajax proxy:
The POST submit action
This example reacts on the POST submit action. The hash of the submission will always be added as 'submissionHash'.
Use your custom props in your thanks page or email body by writing {POST:data.StatusMessage}
in the Peggy Pay editor, in example in the [Form] => [Thanks] body:
Read more
Populate the Price field
Price fields are used to collect amounts in your form in a very flexible way. With dynamic data you also can collect amounts via your webservices via an HTTP request.
Check this screenshot of the price field settings:
It is highly recommended to fill the Id parameter if possible.
To populate a Discount field, use: