signifyd / signifyd-php
Signifyd PHP客户端API插件
Requires
- php: >=5.5.0
- monolog/monolog: >=1.16.0
Requires (Dev)
- php: >=5.5.0
- phpunit/phpunit: ^7
- dev-main
- v5.4.0.x-dev
- v5.3.0.x-dev
- v5.2.1.x-dev
- v4.1.3.x-dev
- 4.1.3
- v4.1.2.x-dev
- 4.1.2
- v4.1.1.x-dev
- 4.1.1
- v4.1.0.x-dev
- 4.1.0
- 4.0.2
- v4.0.1.x-dev
- 4.0.1
- 4.0.0.x-dev
- 4.0.0
- 3.1.3
- 3.1.2
- 3.1.1
- 3.1.0
- 3.0.1
- 3.0.0
- 2.0.0
- v1.2.0
- v1.1.2
- v1.1.1
- v1.1.0
- v1.0.1
- v1.0.0
- v0.2.0
- v0.1.7
- v0.1.6
- v0.1.5
- v0.1.4
- v0.1.3
- v0.1.2
- v0.1.1
- v0.1.0
- dev-MAG-932
- dev-MS-272
- dev-MAG-820
- dev-MAG-830
- dev-MAG-830-remove
- dev-MAG-831
- dev-MAG-815
- dev-MAG-827
- dev-MAG-786
- dev-MAG-796
- dev-MAG-798
- dev-MAG-800
- dev-MAG-803
- dev-MAG-805
- dev-MAG-806
- dev-MAG-816
- dev-MAG-817
- dev-MAG-821
- dev-MAG-822
- dev-v5.3.0-MAG-786
- dev-MAG-793
- dev-MAG-778
- dev-MAG-767
- dev-MAG-765
- dev-MAG-745
- dev-MAG-754
- dev-MAG-726
- dev-MAG-826
- dev-MAG-702
- dev-MAG-679
- dev-MAG-670
- dev-MAG-659
- dev-MAG-653
This package is not auto-updated.
Last update: 2024-09-19 21:21:42 UTC
README
注意:V2 SDK已弃用 请参考我们的 V3 API文档 并下载页面顶部链接的OpenAPI规范,以生成适用于Signifyd反欺诈API最新版本的PHP和其他SDK。
Signifyd V2 PHP SDK
此存储库包含对已弃用的 Signifyd V2 API 的PHP SDK客户端。
概述
本文档将概述Signifyd PHP库中可用的方法,并会提供这些方法的示例。
支持
如有疑问或问题,请联系我们的 支持团队。您可以在此 处 提交反馈和改进建议。
示例
如果您正在寻找经过测试且可正常工作的示例代码,请查看 sdk-examples
存储库。
要求
PHP >= 5.6.0
- 为了使用API,您需要提供您的API密钥。您可以在您的 账户页面 上找到您的API密钥。
安装SDK
使用composer
Signifyd PHP SDK可在Packagist上找到。要将它添加到您的项目中,只需运行以下命令以获取最新版本
$ php composer.phar require signifyd/signifyd-php
如果您想指定一个版本,可以将其添加到命令中
$ php composer.phar require signifyd/signifyd-php:DESIRED_VERSION_HERE
或者,在您的 composer.json
中的 "require"
关键字下添加此行
{
"require" : {
...
"signifyd/signifyd-php": "DESIRED_VERSION_HERE"
}
}
将 DESIRED_VERSION_HERE
替换为您业务最合适的版本描述。有关版本号的更多信息,请查看Composer文档。
https://getcomposer.org.cn/doc/articles/versions.md#writing-version-constraints
添加此行后,您必须运行以下命令安装Signifyd PHP SDK依赖项
$ php composer.phar install
入门
有3个API类,每个类代表API的3个主要部分
CASE API 与Signifyd提交进行审查的订单相关联的案例一起工作。案例包含支付、收件人、产品、运输和账户信息。
GUARANTEE API 与担保一起工作,这是一种财务责任转移,可以保护在线零售商免受退款的影响。查看我们的产品手册了解更多信息。
WEBHOOKS API 与webhooks一起工作,这些是通过HTTP POST发送到您在SIGNIFYD设置中的通知页面配置的URL的消息。当调查的生命周期中发生某些事件时,会发送webhook消息。它们允许您的应用程序接收有关案例的推送更新,而不是轮询SIGNIFYD以获取状态更改。
API类
CaseApi
CaseApi是将Signify API的主要案例功能映射到类中的类。该类包含与Signify调查(称为案例)一起工作的方法。
有几种方式可以实例化CaseApi类。用法示例
<?php // This might differ depending on the location of the file from which you your project require __DIR__ . '/vendor/autoload.php'; $caseApi = new \Signifyd\Core\Api\CaseApi(["apiKey" => "your api key"]);
或使用设置类
<?php // This might differ depending on the location of the file from which you your project require __DIR__ . '/vendor/autoload.php'; $settings = new \Signifyd\Core\Settings(["apiKey" => "your api key"]); $caseApi = new \Signifyd\Core\Api\CaseApi($settings);
类方法
所有方法都接受两种类型的数据作为参数。
参数是一个数组,这意味着模型的构造函数将根据传递给构造函数的数据设置类的属性值。
参数作为一个对象,这意味着在实例化类之后,您可以使用设置器向模型添加数据。
createCase($case);
提交一个欺诈审查订单。有几种方法可以将数据发送到createCase方法。一种方法是将包含所有所需数据的数组发送到createCase方法。如果您知道需要发送哪些数据,这非常有用。
有关可以添加的数据的更多信息,请检查CaseModel
模型。
.... // Case data $caseData = [ "purchase" => [ // Data related to purchase event represented in this Case Creation request. ], "recipient" => [ // Data related to person or organization receiving the items purchased. ], "card" => [ // Data related to the card that was used for the purchase and its cardholder. ], "userAccount" => [ //User account if exists before placing an orders these data values are details from that account. ], "seller" => [ // All data related to the seller of the product. ] ]; $caseResponse = $caseApi->createCase($caseData); ....
另一种方法是使用模型的设置器和获取器来添加数据。
.... $case = \Signifyd\Models\CaseModel(); // Purchase array data or Purchase Object $case->setPurchase($purchase); // Recipient array data or Recipient Object $case->setRecipient($recipient); // Card array data or Card Object $case->setCard($card); // userAccount array data or userAccount Object $case->setUserAccount($userAccount); // Seller array data or Seller Object $case->setSeller($seller); $caseResponse = $caseApi->createCase($case);
发送到我们API的一个JSON对象示例
{ "purchase": { "orderSessionId": "uha3d98weicm20eufhlqe", "browserIpAddress": "192.168.1.1", "orderId": "4fj58as", "createdAt": "2016-07-11T17:54:31-05:00", "paymentGateway": "stripe", "paymentMethod": "credit_card", "transactionId": "1a2sf3f44f21s1", "currency": "USD", "avsResponseCode": "Y", "cvvResponseCode": "M", "orderChannel": "PHONE", "receivedBy": "John Doe", "totalPrice": 74.99, "products": [ { "itemId": "1", "itemName": "Sparkly sandals", "itemUrl": "http://mydomain.com/sparkly-sandals", "itemImage": "http://mydomain.com/images/sparkly-sandals.jpeg", "itemQuantity": 1, "itemPrice": 49.99, "itemWeight": 5 }, { "itemId": "2", "itemName": "Summer tank top", "itemUrl": "http://mydomain.com/summer-tank", "itemImage": "http://mydomain.com/images/summer-tank.jpeg", "itemQuantity": 1, "itemPrice": 19.99, "itemWeight": 2 } ], "shipments": [ { "shipper": "UPS", "shippingMethod": "ground", "shippingPrice": 10, "trackingNumber": "3A4U569H1572924642" }, { "shipper": "USPS", "shippingMethod": "international", "shippingPrice": 20, "trackingNumber": "9201120200855113889012" } ] }, "recipient": { "fullName": "Bob Smith", "confirmationEmail": "bob@gmail.com", "confirmationPhone": "5047130000", "organization": "SIGNIFYD", "deliveryAddress": { "streetAddress": "123 State Street", "unit": "2A", "city": "Chicago", "provinceCode": "IL", "postalCode": "60622", "countryCode": "US", "latitude": 41.92, "longitude": -87.65 } }, "card": { "cardHolderName": "Robert Smith", "bin": 407441, "last4": "1234", "expiryMonth": 12, "expiryYear": 2015, "billingAddress": { "streetAddress": null, "unit": "2A", "city": "Chicago", "provinceCode": "IL", "postalCode": "60622", "countryCode": "US", "latitude": 41.92, "longitude": -87.65 } }, "userAccount": { "email": "bob@gmail.com", "username": "bobbo", "phone": "5555551212", "createdDate": "2013-01-18T17:54:31-05:00", "accountNumber": "54321", "lastOrderId": "4321", "aggregateOrderCount": 40, "aggregateOrderDollars": 5000, "lastUpdateDate": "2013-01-18T17:54:31-05:00" }, "seller": { "name": "We sell awesome stuff, Inc.", "domain": "wesellawesomestuff.com", "shipFromAddress": { "streetAddress": "1850 Mercer Rd", "unit": null, "city": "Lexington", "provinceCode": "KY", "postalCode": "40511", "countryCode": "US", "latitude": 38.07, "longitude": -84.53 }, "corporateAddress": { "streetAddress": "410 Terry Ave", "unit": "3L", "city": "Seattle", "provinceCode": "WA", "postalCode": "98109", "countryCode": "US", "latitude": 47.6, "longitude": -122.33 } } }
此方法将返回一个包含caseId
属性的CaseResponse
对象。如果发生错误,CaseResponse
将设置isError
属性为true
,并且errorMessage
属性将包含接收到的错误消息。如果请求无法执行,则错误消息可以为空,但在此情况下,signifyd_connect.log将记录错误。
getCase($caseId);
通过调查ID或案件ID检索单个案件的相关详细信息。
.... $caseId = 123456789; $caseResponse = $caseApi->getCase($caseId); ....
此方法将请求发送到我们的API端点以获取一个案件。此方法的参数需要发送案件ID,可选参数是entry。
此方法将返回一个包含所有属性填充的CaseResponse
对象。如果发生错误,CaseResponse
将设置isError
属性为true
,并且errorMessage
属性将包含接收到的错误消息。如果请求无法执行,则错误消息可以为空,但在此情况下,signifyd_connect.log将记录错误。
addFulfillment($fulfillments);
此方法将请求发送到我们的API端点以添加订单的履行情况。一种方法是将包含所有所需数据的数组发送到addFulfillment方法。
有关可以添加的数据的更多信息,请检查Fulfillment
模型。
.... $fulfillmentData = [ // Fulfilment data ]; $caseResponse = $caseApi->addFulfillment($fulfillmentData); ....
此方法将返回一个包含objects
属性填充的FulfillmentBulkResponse
对象,其中所有属性都已填充。如果发生错误,FulfillmentBulkResponse
将设置isError
属性为true
,并且errorMessage
属性将包含接收到的错误消息。如果请求无法执行,则错误消息可以为空,但在此情况下,signifyd_connect.log将记录错误。
updatePayment($paymentUpdate);
通过发送更新信息来更新支付数据。此方法将请求发送到我们的API端点以更新现有案件中的支付信息。
有关可以添加的数据的更多信息,请检查PaymentUpdate
模型。
.... $paymentUpdate = new Signifyd\Models\PaymentUpdate([ // Payment update data ]); // Add data to payment update $caseResponse = $caseApi->updatePayment($paymentUpdate); ....
此方法将返回一个包含属性填充的CaseResponse
对象。如果发生错误,CaseResponse
将设置isError
属性为true
,并且errorMessage
属性将包含接收到的错误消息。如果请求无法执行,则错误消息可以为空,但在此情况下,signifyd_connect.log将记录错误。
GuaranteeApi
GuaranteeApi是映射Signify API主要保证功能的类。此类包含处理保证的方法。
有几种方式可以实例化GuaranteeApi类。用法示例
<?php // This might differ depending on the location of the file from which you your project require __DIR__ . '/vendor/autoload.php'; $guaranteeApi = new \Signifyd\Core\Api\GuaranteeApi(["apiKey" => "your api key"]);
或使用设置类
<?php // This might differ depending on the location of the file from which you your project require __DIR__ . '/vendor/autoload.php'; $settings = new \Signifyd\Core\Settings(["apiKey" => "your api"]); $guaranteeApi = new \Signifyd\Core\Api\GuaranteeApi($settings);
类方法
所有方法都接受两种类型的数据作为参数。
参数是一个数组,这意味着模型的构造函数将根据传递给构造函数的数据设置类的属性值。
参数作为一个对象,这意味着在实例化类之后,您可以使用设置器向模型添加数据。
createGuarantee($guarantee);
提交一个请求以保证现有案件。
有关可以添加的数据的更多信息,请检查Guarantee
模型。
.... $guarantee = new \Signifyd\Model\Guarantee(['caseId' => 123456]); $guaranteeResponse = $guaranteeApi->createGuarantee($quarantee); ....
此方法将返回一个包含属性填充的GuaranteeResponse
对象。如果发生错误,GuaranteeResponse
将设置isError
属性为true
,并且errorMessage
属性将包含接收到的错误消息。如果请求无法执行,则错误消息可以为空,但在此情况下,signifyd_connect.log将记录错误。
cancelGuarantee($guarantee);
对于不再需要保证的订单,可以取消保证。
有关可以添加的数据的更多信息,请检查Guarantee
模型。
.... $quarantee = new \Signifyd\Model\Guarantee(['caseId' => 123456789]); $guaranteeResponse = $guaranteeApi->cancelGuarantee($quarantee); ....
此方法将返回一个包含属性填充的GuaranteeResponse
对象。如果发生错误,GuaranteeResponse
将设置isError
属性为true
,并且errorMessage
属性将包含接收到的错误消息。如果请求无法执行,则错误消息可以为空,但在此情况下,signifyd_connect.log将记录错误。
WebhookApi
WebhookApi 是一个类,用于映射 Signify API 的主要 Webhook 功能。这个类包含与 Webhook 相关的方法。
有多种方法可以实例化 WebhookApi 类。使用示例
<?php // This might differ depending on the location of the file from which you your project require __DIR__ . '/vendor/autoload.php'; $webhooksApi = new \Signifyd\Core\Api\WebhooksApi(["apiKey" => "your api key"]);
或使用设置类
<?php // This might differ depending on the location of the file from which you your project require __DIR__ . '/vendor/autoload.php'; $settings = new \Signifyd\Core\Settings(["apiKey" => "your api key"]); $webhooksApi = new \Signifyd\Core\Api\WebhooksApi($settings);
类方法
所有方法都接受两种类型的数据作为参数。
参数是一个数组,这意味着模型的构造函数将根据传递给构造函数的数据设置类的属性值。
参数作为一个对象,这意味着在实例化类之后,您可以使用设置器向模型添加数据。
validWebhookRequest($request, $hash, $topic);
检查 Webhook 回调是否有效。
.... $valid = $webhooksApi->validWebhookRequest($request, $hash, $topic); ....
这是一个辅助函数,不与 signifyd 连接。如果请求有效,此方法将返回布尔值 true
;如果请求无效,将返回 false
。
createWebhooks($webhooks);
在 Signifyd 中创建 Webhook。
有关可以添加的数据的更多信息,请检查 Wehbook
模型。
.... $webhook1 = new \Signifyd\Model\Webhook([ // Webhook data ]); $webhook2 = new \Signifyd\Model\Webhook([ // Webhook data ]); $webhooks = [$webhook1, $webhook2]; $webhooksBulkResponse = $webhooksApi->createWebhooks($webhooks); ....
此方法将返回一个 WebhooksBulkResponse
,其中将包含填充了所有属性的 WebhooksResponse
对象。如果发生错误,则 WebhooksBulkResponse
将设置 isError
属性为 true
,并且 errorMessage
属性将包含接收到的错误消息。如果请求无法执行,则错误消息可能为空,但在此情况下,signifyd_connect.log 将记录错误。
updateWebhooks($webhooks);
在 Signifyd 中更新 Webhook。
有关可以添加的数据的更多信息,请检查 Wehbook
模型。
.... $webhook1 = new \Signifyd\Model\Webhook([ // Webhook data ]); $webhook2 = new \Signifyd\Model\Webhook([ // Webhook data ]); $webhooks = [$webhook1, $webhook2]; $webhooksBulkResponse = $webhooksApi->updateWebhooks($webhooks); ....
此方法将返回一个 WebhooksBulkResponse
,其中将包含填充了所有属性的 WebhooksResponse
对象。如果发生错误,则 WebhooksBulkResponse
将设置 isError
属性为 true
,并且 errorMessage
属性将包含接收到的错误消息。如果请求无法执行,则错误消息可能为空,但在此情况下,signifyd_connect.log 将记录错误。
getWebhooks();
检索 Signifyd 中设置的 Webhook 列表。
.... $webhooksBulkResponse = $webhooksApi->getWebhooks(); ....
此方法将返回一个 WebhooksBulkResponse
,其中将包含填充了所有属性的 WebhooksResponse
对象。如果发生错误,则 WebhooksBulkResponse
将设置 isError
属性为 true
,并且 errorMessage
属性将包含接收到的错误消息。如果请求无法执行,则错误消息可能为空,但在此情况下,signifyd_connect.log 将记录错误。
updateWebhook($webhook);
更新 Signifyd 中的单个 Webhook。
有关可以添加的数据的更多信息,请检查 Wehbook
模型。
.... $webhook = new \Signifyd\Model\Webhook([ // Webhook data ]); $webhooksResponse = $webhooksApi->updateWebhook($webhook); ....
此方法将返回一个填充了属性的 WebhooksResponse
。如果发生错误,则 WebhooksResponse
将设置 isError
属性为 true
,并且 errorMessage
属性将包含接收到的错误消息。如果请求无法执行,则错误消息可能为空,但在此情况下,signifyd_connect.log 将记录错误。
deleteWebhook($webhook);
从 Signifyd 中删除 Webhook。
有关可以添加的数据的更多信息,请检查 Wehbook
模型。
.... $webhook = new \Signifyd\Model\Webhook([ // Webhook data ]); $webhooksResponse = $webhooksApi->deleteWebhook($webhook); ....
此方法将返回一个填充了属性的 WebhooksResponse
。如果发生错误,则 WebhooksResponse
将设置 isError
属性为 true
,并且 errorMessage
属性将包含接收到的错误消息。如果请求无法执行,则错误消息可能为空,但在此情况下,signifyd_connect.log 将记录错误。
SDK API 响应
CaseResponse
CaseResponse 是调用 case api 时返回的响应
属性
您可以通过使用响应中的 getter 方法访问任何值
FulfillmentBulkResponse
Fulfillment bulk response 是在调用 case api 的 addFulfillment 方法时返回的响应
属性
您可以通过使用响应中的 getter 方法访问任何值
GuaranteeResponse
GuaranteeResponse 是调用 guarantee api 时返回的值
属性
您可以通过使用响应中的 getter 方法访问任何值
WebhooksResponse
WebhoookResponse 是在调用更新和删除 Webhook 的 webhook api 方法时返回的值
属性
您可以通过使用响应中的 getter 方法访问任何值
WebhooksBulkResponse
Webhoook bulk response 是在调用获取、创建和更新 Webhook 的 webhook api 方法时返回的值
属性
您可以通过使用响应中的 getter 方法访问任何值
SDK 设置
设置
包含送货/账单地址
属性
SDK 模型
Address
Address 包含送货/账单地址。地址对象是用于在您的商店中放置的订单的地址信息的容器。可以在命名空间 "Signifyd\Models" 下找到地址类,位于 lib/Models/Address.php。
// instantiating the address model class $addressData = ['streetAddress' => '2 Brodway', '...']; $address = new \Signifyd\Models\Address($addressData);
或
// instantiating the address model class $address = new \Signifyd\Models\Address(); $address->setSteetAddress('2 Brodway');
Card
Card 包含用于购买的卡及其持卡人的数据。卡对象是用于在您的商店中放置的订单的卡信息的容器。可以在命名空间 "Signifyd\Models" 下找到卡类,位于 lib/Models/Card.php。
// instantiating the card model class $cardData = ['cardHolderName' => 'John Doe', '...']; $card = new \Signifyd\Models\Card($cardData);
或
// instantiating the card model class $card = new \Signifyd\Models\Card(); $card->setCardHolderName('John Doe');
CaseModel
CaseModel 包含与案件相关的数据。案件对象是用于在案件创建时发送到我们的 API 的与案件相关的信息的容器,作为 JSON 字符串。可以在命名空间 "Signifyd\Models" 下找到案件类,位于 lib/Models/CaseModel.php。案件对象具有来自 "Signifyd\Models" 命名空间的其他对象属性,以便简化正确对象的创建,我们的 API 可以无错误地处理。
// instantiating the case model class $caseData = ['purchase' => new \Signifyd\Model\Purchase(), '...']; $caseModel = new \Signifyd\Models\CaseModel($caseData);
或
// instantiating the case model class $caseModel = new \Signifyd\Models\CaseModel(); $caseModel->setPurchase(new \Signifyd\Model\Purchase());
DiscountCode
任何在结账时使用的折扣代码、优惠券或促销代码,以在订单中获得折扣。您只能提供折扣代码和折扣金额或折扣百分比。discountCode对象是存储您商店中放置的订单的折扣代码相关信息的容器。discountCode类位于“Signifyd\Models”命名空间下,位于lib/Models/DiscountCode.php。discountCode对象具有“Signifyd\Models”命名空间中的其他对象的属性,以方便创建我们的API能够无错误处理的正确对象。
// instantiating the discount code model class $discountCodeData = ['code' => '598218sdareqw74fds', '...']; $discountCode = new \Signifyd\Models\DiscountCode($discountCodeData);
或
// instantiating the discount code model class $discountCode = new \Signifyd\Models\DiscountCode();
保证
保证数据保证对象是发送到我们API的保证信息的容器。保证类位于“Signifyd\Models”命名空间下,位于lib/Models/Guarantee.php。保证对象具有“Signifyd\Models”命名空间中的其他对象的属性,以方便创建我们的API能够无错误处理的正确对象。
// instantiating the guarantee model class $guaranteeData = ['caseId' => 1234567890]; $guarantee = new \Signifyd\Models\Guarantee($guaranteeData);
或
// instantiating the guarantee model class $guarantee = new \Signifyd\Models\Guarantee();
支付更新
支付更新数据paymentUpdate对象是存储您商店中放置的订单的支付更新信息的容器。paymentUpdate类位于“Signifyd\Models”命名空间下,位于lib/Models/PaymentUpdate.php。
// instantiating the payment update model class $paymentUpdateData = ['paymentGateway' => 'Authorizenet', '...']; $paymentUpdate = new \Signifyd\Models\PaymentUpdate($paymentUpdateData);
或
// instantiating the payment update model class $paymentUpdate = new \Signifyd\Models\PaymentUpdate();
产品
交易中购买的产品产品对象是存储您商店中放置的订单的产品信息的容器。产品类位于“Signifyd\Models”命名空间下,位于lib/Models/Recipient.php。
// instantiating the product model class $productData = ['itemId' => 1251541, '...']; $product = new \Signifyd\Models\Product($productData);
或
// instantiating the product model class $product = new \Signifyd\Models\Product();
购买
此案例创建请求中表示的购买事件相关数据。购买对象是存储您商店中放置的订单信息的容器。购买类位于“Signifyd\Models”命名空间下,位于lib/Models/Purchase.php。
// instantiating the purchase address model class $purchaseData = ['orderSessionId' => '1121aseaa324321ahiuhfsdiuhaiufds', '...']; $purchase = new \Signifyd\Models\Purchase($purchaseData);
或
// instantiating the purchase address model class $purchase = new \Signifyd\Models\Purchase();
收件人
与购买的商品接收者或组织相关的数据。收件人对象是存储您商店中放置的订单的收件人信息的容器。收件人类位于“Signifyd\Models”命名空间下,位于lib/Models/Recipient.php。
// instantiating the recipient model class $recipientData = ['fullName' => 'John Doe', '...']; $recipient = new \Signifyd\Models\Recipient($recipientData);
或
// instantiating the recipient model class $recipient = new \Signifyd\Models\Recipient();
卖家
与产品卖家相关的所有数据。除非您在运营市场,代表多个在您的网站上注册了卖家账户的卖家(例如Ebay)列出商品,否则此信息是可选的。卖家对象是存储您商店中放置的订单的卖家信息的容器。卖家类位于“Signifyd\Models”命名空间下,位于lib/Models/Seller.php。
// instantiating the seller model class $sellerData = ['name' => 'My company', '...']; $seller = new \Signifyd\Models\Seller($sellerData);
或
// instantiating the seller model class $seller = new \Signifyd\Models\Seller();
装运
与此次购买相关的装运。装运对象是存储您商店中放置的订单的装运信息的容器。装运类位于“Signifyd\Models”命名空间下,位于lib/Models/Shipment.php。
// instantiating the shipment model class $shipmentData = ['shipper' => 'Fedex', '...']; $shipment = new \Signifyd\Models\Shipment($shipmentData);
或
// instantiating the shipment model class $shipment = new \Signifyd\Models\Shipment();
团队
// instantiating the team model class $teamData = ['teamId' => 1, '...']; $team = new \Signifyd\Models\Team($teamData);
或
// instantiating the team model class $team = new \Signifyd\Models\Team();
用户账户
userAccount对象是存储您商店中放置的订单的用户账户信息的容器。userAccount类位于“Signifyd\Models”命名空间下,位于lib/Models/UserAccount.php。
// instantiating the user account model class $userData = ['emailAddress' => 'john@doe.com', '...']; $userAccount = new \Signifyd\Models\UserAccount($userData);
或
// instantiating the user account model class $userAccount = new \Signifyd\Models\UserAccount();
Webhook
Webhook数据webhook对象是存储您商店中放置的订单的用户账户信息的容器。webhook类位于“Signifyd\Models”命名空间下,位于lib/Models/Webhook.php。
// instantiating the webhook model class $webhookData = ['event' => '', 'url' => 'Your Url']; $webhook = new \Signifyd\Models\Webhook($webHookData);
或
// instantiating the webhook model class $webhook = new \Signifyd\Models\Webhook();