programster/leaddyno
最新稳定版本:0.2.1
Composer 安装命令:
composer require programster/leaddyno
包简介
An SDK for interfacing with the Leaddyno RESTful API
关键字:
README 文档
README
An SDK for interfacing with the LeadDyno RESTful API in PHP.
This package makes use of the PSR-17 and PSR-18 interfaces, so this package should be able to work
with any existing mechanism you use to send messages. If you are not sure what this means, then
we would recommend that you just install the guzzlehttp/guzzle package, and follow the example
in the README.
Usage
Installation
Install this in your codebase with composer like so:
composer require programster/leaddyno
Example Code
The following example creates a LeadDyno client, and uses it to tell LeadDyno that there was a sale that was the result of a specific affiliate code.
<?php use Programster\LeadDyno\LeadDyno; use Programster\LeadDyno\LineItem; use Programster\LeadDyno\LineItemCollection; require_once(__DIR__ . "/../vendor/autoload.php"); $myLeadDynoApiKey = "xxxxxxxxxxxxxxxxxxxxxxxxxx"; $leadDyno = new LeadDyno( $myLeadDynoApiKey, new \GuzzleHttp\Psr7\HttpFactory(), new \GuzzleHttp\Client(), ); $lineItems = new LineItemCollection( new LineItem( sku: "Botswana1", description: "A ticket to Botswana", quantity: "1", amount: "123.45", ), ); $response = $leadDyno->createPurchase( customerEmail: "test-customer@somedomain.com", purchaseAmount: 123.45, purchaseId: "9eb2d2b1-f4fb-4b2c-84e3-688f950db50d", planCode: "Default", affiliateCode: "someAffiliateCode", description: "Description of purchase goes here.", lineItems: $lineItems, ); if ($response->getStatusCode() === 201) { // Purchase succssfully registered... } else { // Handle error response here... }
统计信息
- 总下载量: 4
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 0
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2025-04-22