定制 eiriksm/finn-transfer-sdk 二次开发

按需修改功能、优化性能、对接业务系统,提供一站式技术支持

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

eiriksm/finn-transfer-sdk

最新稳定版本:1.1.0

Composer 安装命令:

composer require eiriksm/finn-transfer-sdk

包简介

SDK for communicating with FINN transfer API

README 文档

README

Test

SDK for transferring ads to finn.no

You need an agreement to use this API, and the complete documentation can be found here.

This library implements the REST API part described in that documentation.

Installation

composer require eiriksm/finn-transfer-sdk

Usage

<?php use eiriksm\FinnTransfer\AdTypes\TractorXml; use eiriksm\FinnTransfer\FinnTransfer; use GuzzleHttp\Client; $partner_id = 'mypartnerid'; $provider = 'myprovider'; // Start by constructing an ad type. For example a tractor ad. $ad = new TractorXml($partner_id, $provider); // Then set some properties. We probably want to set an ad title, and a price, // for example. $ad->setHeading('Used tractor for sale'); $ad->setMotorPrice(10000); // For this example, we will also set postcode, since that is required. $ad->setZipCode(9300); // And maybe something a bit more specific. It has a 200 horse power engine. $ad->setEngineEffect(200); // We can also set arbitrary properties that are defined in the DTD for this ad // type. For tractor that would be http://www.iad.no/dtd/IADIF-tractor-21.dtd // where we can see there is something called TRACTOR_EQUIPMENT for example. We // can find a list of valid values at https://www.finn.no/finn/referencevalue?adType=TRACTOR&xmlCode=TRACTOR_EQUIPMENT $ad->TRACTOR_EQUIPMENT = 'KOMPLETT_FRONTLASTER'; // Now, there is probably a whole lot more you want to set on the ad, but those // were some examples. In the end, use this method to get the xml. This will // also validate the XML according to the spec. $xml = $ad->getXml(); // Next step would be to send this XML to finn.no. $transfer = new FinnTransfer(); $transfer->setAd($ad); // By default we are working against the dev environment of finn.no, but use // this method to do it live(tm). $transfer->getClient()->setLiveMode(); // Then get a HTTP client somehow. $http_client = new Client(); // Now transfer the ad. $result_xml = $transfer->transfer($http_client);

统计信息

  • 总下载量: 36.95k
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 0
  • 点击次数: 1
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 0
  • Watchers: 1
  • Forks: 1
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2026-01-04

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固