SDKs
PHP SDK
Integrate Notch Pay into your PHP applications
Notch Pay PHP SDK
The Notch Pay PHP SDK provides a convenient way to integrate Notch Pay into your PHP applications, including frameworks like Laravel, Symfony, and WordPress.
Installation
Basic Usage
Initialize the SDK
Create a Payment
Retrieve a Payment
List Payments
Create a Transfer
Check Balance
Laravel Integration
Installation
Service Provider (Laravel 5.4 and below)
Add the service provider to your config/app.php
file:
Configuration
Publish the configuration file:
Update your .env
file with your Notch Pay credentials:
Usage in Laravel
Routes
WordPress Integration
If you’re using WordPress, you can use the PHP SDK to create a custom payment integration:
Create a Payment Form Shortcode
Usage in WordPress
Add the payment form to any page or post using the shortcode:
API Reference
The PHP SDK provides access to all Notch Pay API endpoints:
Payments
$notchpay->payments->create($data)
- Create a payment$notchpay->payments->retrieve($reference)
- Retrieve a payment$notchpay->payments->list($params)
- List payments$notchpay->payments->cancel($reference)
- Cancel a payment
Transfers
$notchpay->transfers->create($data)
- Create a transfer$notchpay->transfers->retrieve($reference)
- Retrieve a transfer$notchpay->transfers->list($params)
- List transfers$notchpay->transfers->cancel($reference)
- Cancel a transfer$notchpay->transfers->createBulk($data)
- Create a bulk transfer
Customers
$notchpay->customers->create($data)
- Create a customer$notchpay->customers->retrieve($id)
- Retrieve a customer$notchpay->customers->update($id, $data)
- Update a customer$notchpay->customers->list($params)
- List customers$notchpay->customers->delete($id)
- Delete a customer
Beneficiaries
$notchpay->beneficiaries->create($data)
- Create a beneficiary$notchpay->beneficiaries->retrieve($id)
- Retrieve a beneficiary$notchpay->beneficiaries->update($id, $data)
- Update a beneficiary$notchpay->beneficiaries->list($params)
- List beneficiaries$notchpay->beneficiaries->delete($id)
- Delete a beneficiary
Balance
$notchpay->balance->retrieve()
- Check balance$notchpay->balance->retrieveCurrency($currency)
- Check balance for a specific currency$notchpay->balance->history($params)
- List balance history
Webhooks
$notchpay->webhooks->create($data)
- Create a webhook$notchpay->webhooks->retrieve($id)
- Retrieve a webhook$notchpay->webhooks->update($id, $data)
- Update a webhook$notchpay->webhooks->list($params)
- List webhooks$notchpay->webhooks->delete($id)
- Delete a webhook
Error Handling
The SDK throws exceptions that you can catch and handle:
Webhook Verification
Verify webhook signatures to ensure they’re coming from Notch Pay: