beratkrdr / yurtici-kargo-entegrasyon-php
借助这个库,您可以通过Yurtiçi Kargo实现货物的创建、查询状态和取消货物。
This package is auto-updated.
Last update: 2024-09-27 16:46:22 UTC
README
Yurtiçi Kargo - Php 集成库
借助这个库,您可以通过Yurtiçi Kargo实现货物的创建、查询状态和取消货物。
示例代码 »
错误报告 · 建议/需求
目录
项目介绍
借助这个库,您可以通过Yurtiçi Kargo实现货物的创建、查询状态和取消货物。
为了进行Yurtiçi Kargo集成,您需要申请Web服务用户名和密码。您可以从Yurtiçi Kargo市场营销负责人处获取集成文档,从而访问集成信息、参数和示例。
为了确保代码无故障运行,服务器需要开放80端口和套接字,以及openssl、SOAP、curl等插件。
示例代码
必填参数
wsUserName
: Web服务用户名
wsPassword
: Web服务密码
wsLanguage
: Web服务语言选项(例如:'TR')
cleanResult
: 使结果数组更简洁。 (true/false)(默认:true)
testMode
: 测试模式 (true/false)
注意:上述参数适用于所有示例。
创建货物
必填参数
cargoKey
: 货物密钥(每个发货项必须是唯一的)
invoiceKey
: 发票密钥(每个发货项必须是唯一的)
receiverCustName
: 收件人名称(至少5个字符,至少包含4个字母。)
receiverAddress
: 收件人地址(至少5个字符,最多200个字符。如果cityName和townName字段中已发送,则不应在此字段中发送。)
receiverPhone1
: 收件人电话-1(带区号,10位数字组成。)
<?php require_once "../src/class.php"; $yurtici = new yurticiKargo(array( 'wsUserName' => "{wsUserName}", 'wsPassword' => "{wsPassword}", 'wsLanguage' => "{wsLanguage}", // Default: TR 'cleanResult' => true, // Default: true [true/false] 'testMode' => true // Default: false [true/false] )); $response = $yurtici->createShipment(array( "cargoKey" => "123456", 'invoiceKey' => "654321", 'receiverCustName' => "John Doe", 'receiverAddress' => "Lorem Ipsum is simply dummy text of the printing and typesetting industry.", 'cityName' => "City", 'townName' => "Town", 'receiverPhone1' => "05554443322", 'emailAddress' => "johndoe@gmail.com", 'orgReceiverCustId' => '9999' )); ?>
结果
Array
(
[outFlag] => 0
[outResult] => Başarılı
[count] => 1
[jobId] => 2198077
[shippingOrderDetailVO] => Array
(
[cargoKey] => 123456
[invoiceKey] => 654321
)
)
查询货物
必填参数
keys
: 货物/发票密钥
keyType
: 在keys参数中确定指定密钥的类型。 0 – 货物密钥 / 1 – 发票密钥
addHistoricalData
: 为发送项的运输活动报告指定。
onlyTracking
: 只报告跟踪链接。
<?php require_once "../src/class.php"; $yurtici = new yurticiKargo(array( 'wsUserName' => "{wsUserName}", 'wsPassword' => "{wsPassword}", 'wsLanguage' => "{wsLanguage}", // Default: TR 'cleanResult' => true, // Default: true [true/false] 'testMode' => true // Default: false [true/false] )); $response = $yurtici->queryShipment('123456', 0, false, true); ?>
结果
Array
(
[outFlag] => 0
[outResult] => Başarılı
[count] => 1
[senderCustId] => 1010954
[shippingDeliveryDetailVO] => Array
(
[cargoKey] => 123456
[invoiceKey] => 654321
[jobId] => 2198077
[operationCode] => 0
[operationMessage] => Kargo İşlem Görmemiş.
[operationStatus] => NOP
)
)
取消货物
必填参数
cargoKeys
: 货物密钥
<?php require_once "../src/class.php"; $yurtici = new yurticiKargo(array( 'wsUserName' => "{wsUserName}", 'wsPassword' => "{wsPassword}", 'wsLanguage' => "{wsLanguage}", // Default: TR 'cleanResult' => true, // Default: true [true/false] 'testMode' => true // Default: false [true/false] )); $response = $yurtici->cancelShipment('123456'); ?>
结果
Array
(
[outFlag] => 0
[outResult] => Başarılı
[count] => 1
[senderCustId] => 1010954
[shippingCancelDetailVO] => Array
(
[cargoKey] => 123456
[docId] => 0
[invoiceKey] => 654321
[jobId] => 2198077
[operationCode] => 3
[operationMessage] => Verisi İptal Edilmiştir.Kargo Çıkışı Engellendi.
[operationStatus] => CNL
)
)
联系信息
Berat Kırdar项目链接:https://github.com/beratkrdr/yurtici-kargo-entegrasyon-php