hdelima / rdstation-api
简单的RD Station包装器
dev-main
2023-07-21 20:15 UTC
Requires (Dev)
- phpunit/phpunit: ^9
- vlucas/phpdotenv: ^5.5
This package is auto-updated.
Last update: 2024-09-21 22:57:43 UTC
README
需求
- curl_init
- curl_setopt
如何使用
use Hdelima\RDStation\RDStation; # set .env RDSTATION_PUBLIC_KEY=token_here $rdStation = new RDStation(env('RDSTATION_PUBLIC_KEY')); # $rdStation->{verb}(url, $args = [], $timeout = 10); # verbs: post, get, put, patch, delete # return array $rdStation->post('conversions', [ 'event_type' => 'CONVERSION', // optional default CONVERSION 'event_family' => 'CDP', // optional default CDP 'payload' => [ 'conversion_identifier' => 'CONVERSÃO TESTE', // required default CONVERSION 'email' => 'email@domain.com', // required // oother fields... ] ]);
运行测试
$ phpunit tests