signifyd/signifyd-php

Signifyd PHP客户端API插件


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();