konfig/splitit-web-php-guzzle6-sdk

v3.0.5 2024-09-19 15:11 UTC

README

Splitit的Web API

Packagist

目录

安装与使用

要求

此库需要 PHP ^7.0

Composer

要通过Composer安装绑定,请将以下内容添加到composer.json

{
  "repositories": [
    {
      "type": "vcs",
      "url": "https://github.com/konfig-dev/splitit-web-php-guzzle6-sdk.git"
    }
  ],
  "require": {
    "konfig/splitit-web-php-guzzle6-sdk": "3.0.5"
  }
}

然后运行composer install

手动安装

下载文件并包含autoload.php

<?php
require_once('/path/to/splitit-web-php-guzzle6-sdk/vendor/autoload.php');

入门

请按照安装程序进行操作,然后运行以下命令

<?php
require_once(__DIR__ . '/vendor/autoload.php');

$splitit = new \Splitit\Client(
    getenv("SPLITIT_CLIENT_ID"),
    getenv("SPLITIT_CLIENT_SECRET")
);

$result = $splitit->installmentPlan->checkEligibility(
    "X-Splitit-IdempotencyKey_example", 
    "", 
    [
        "total_amount" => 3.14,
        "number_of_installments" => 1,
        "purchase_method" => "InStore",
    ], 
    [
        "card_brand" => "Mastercard",
        "card_type" => "Credit",
    ], 
    [
    ], 
    "string_example"
);

参考

splitit.installmentPlan.checkEligibility

🛠️ 使用

$result = $splitit->installmentPlan->checkEligibility(
    "X-Splitit-IdempotencyKey_example", 
    "", 
    [
        "total_amount" => 3.14,
        "number_of_installments" => 1,
        "purchase_method" => "InStore",
    ], 
    [
        "card_brand" => "Mastercard",
        "card_type" => "Credit",
    ], 
    [
    ], 
    "string_example"
);

⚙️ 参数

x_splitit_idempotency_key: string
x_splitit_touch_point: string

TouchPoint

PlanData: PlanData
CardDetails: CardData
BillingAddress: AddressData
ShopperIdentifier: string

🔄 返回

InstallmentsEligibilityResponse

🌐 端点

/api/installmentplans/check-eligibility POST

🔙 返回目录

splitit.installmentPlan.get

🛠️ 使用

$result = $splitit->installmentPlan->get(
    "installmentPlanNumber_example", 
    "X-Splitit-IdempotencyKey_example", 
    ""
);

⚙️ 参数

installment_plan_number: string
x_splitit_idempotency_key: string
x_splitit_touch_point: string

TouchPoint

🔄 返回

InstallmentPlanGetResponse

🌐 端点

/api/installmentplans/{installmentPlanNumber} GET

🔙 返回目录

splitit.installmentPlan.getEligibilityTermsAndCondition

🛠️ 使用

$result = $splitit->installmentPlan->getEligibilityTermsAndCondition(
    "ipn_example", 
    "X-Splitit-IdempotencyKey_example", 
    ""
);

⚙️ 参数

ipn: string
x_splitit_idempotency_key: string
x_splitit_touch_point: string

TouchPoint

🔄 返回

EligibilityTermsAndConditionResponse

🌐 端点

/api/installmentplans/{ipn}/legal GET

🔙 返回目录

splitit.installmentPlan.post

🛠️ 使用

$result = $splitit->installmentPlan->post(
    "X-Splitit-IdempotencyKey_example", 
    "", 
    True, 
    True, 
    [
    ], 
    [
        "total_amount" => 3.14,
        "purchase_method" => "InStore",
    ], 
    [
    ], 
    [
    ], 
    [
    ], 
    [
    ], 
    [
    ], 
    "None", 
    "string_example"
);

⚙️ 参数

x_splitit_idempotency_key: string
x_splitit_touch_point: string

TouchPoint

AutoCapture: bool
Attempt3dSecure: bool
Shopper: ShopperData
PlanData: PlanDataModel
BillingAddress: AddressDataModel
RedirectUrls: InitiateRedirectionEndpointsModel
UxSettings: UxSettingsModel
EventsEndpoints: EventsEndpointsModel
ProcessingData: ProcessingData
x_splitit_test_mode: string
splititclientinfo: string

🔄 返回

InitiatePlanResponse

🌐 端点

/api/installmentplans/initiate POST

🔙 返回目录

splitit.installmentPlan.post2

🛠️ 使用

$result = $splitit->installmentPlan->post2(
    True, 
    True, 
    "X-Splitit-IdempotencyKey_example", 
    "", 
    True, 
    [
    ], 
    [
        "total_amount" => 3.14,
        "purchase_method" => "InStore",
    ], 
    [
    ], 
    [
        "type" => "Card",
    ], 
    [
    ], 
    [
    ], 
    [
    ], 
    "None", 
    "string_example"
);

⚙️ 参数

AutoCapture: bool
TermsAndConditionsAccepted: bool
x_splitit_idempotency_key: string
x_splitit_touch_point: string

TouchPoint

Attempt3dSecure: bool
Shopper: ShopperData
PlanData: PlanDataModel
BillingAddress: AddressDataModel
PaymentMethod: PaymentMethodModel
RedirectUrls: RedirectionEndpointsModel
ProcessingData: ProcessingData
EventsEndpoints: EventsEndpointsModel
x_splitit_test_mode: string
splititclientinfo: string

🔄 返回

InstallmentPlanCreateResponse

🌐 端点

/api/installmentplans POST

🔙 返回目录

splitit.installmentPlan.refund

🛠️ 使用

$result = $splitit->installmentPlan->refund(
    3.14, 
    "installmentPlanNumber_example", 
    "X-Splitit-IdempotencyKey_example", 
    "", 
    "FutureInstallmentsFirst", 
    "string_example"
);

⚙️ 参数

Amount: float
installment_plan_number: string
x_splitit_idempotency_key: string
x_splitit_touch_point: string

TouchPoint

RefundStrategy:
ReferenceId: string

🔄 返回

InstallmentPlanRefundResponse

🌐 端点

/api/installmentplans/{installmentPlanNumber}/refund POST

🔙 返回目录

splitit.installmentPlan.search

🛠️ 使用

$result = $splitit->installmentPlan->search(
    "X-Splitit-IdempotencyKey_example", 
    "", 
    "string_example", 
    "string_example", 
    [
        "key": "string_example",
    ]
);

⚙️ 参数

x_splitit_idempotency_key: string
x_splitit_touch_point: string

TouchPoint

installment_plan_number: string
ref_order_number: string
extended_params: array<string, string>

🔄 返回

InstallmentPlanSearchResponse

🌐 端点

/api/installmentplans/search GET

🔙 返回目录

splitit.installmentPlan.updateOrder

🛠️ 使用

$result = $splitit->installmentPlan->updateOrder(
    "installmentPlanNumber_example", 
    "X-Splitit-IdempotencyKey_example", 
    "", 
    "string_example", 
    "string_example", 
    True, 
    "Pending", 
    3.14
);

⚙️ 参数

installment_plan_number: string
x_splitit_idempotency_key: string
x_splitit_touch_point: string

TouchPoint

RefOrderNumber: string
TrackingNumber: string
Capture: bool
ShippingStatus:
新金额: float

🔄 返回

分期计划更新响应

🌐 端点

/api/installmentplans/{分期计划编号}/updateorder PUT

🔙 返回目录

splitit.installmentPlan.updateOrder2

🛠️ 使用

$result = $splitit->installmentPlan->updateOrder2(
    "X-Splitit-IdempotencyKey_example", 
    "", 
    "string_example", 
    "string_example", 
    True, 
    "Pending", 
    3.14, 
    [
    ]
);

⚙️ 参数

x_splitit_idempotency_key: string
x_splitit_touch_point: string

TouchPoint

RefOrderNumber: string
TrackingNumber: string
Capture: bool
ShippingStatus:
新金额: float
标识符: IdentifierContract

🔄 返回

分期计划更新响应

🌐 端点

/api/installmentplans/updateorder PUT

🔙 返回目录

splitit.installmentPlan.verifyAuthorization

🛠️ 使用

$result = $splitit->installmentPlan->verifyAuthorization(
    "installmentPlanNumber_example", 
    "X-Splitit-IdempotencyKey_example", 
    ""
);

⚙️ 参数

installment_plan_number: string
x_splitit_idempotency_key: string
x_splitit_touch_point: string

TouchPoint

🔄 返回

验证授权响应

🌐 端点

/api/installmentplans/{分期计划编号}/verifyauthorization GET

🔙 返回目录

作者

此PHP包由Konfig自动生成