customsumit/adapter-php 问题修复 & 功能扩展

解决BUG、新增功能、兼容多环境部署,快速响应你的开发需求

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

customsumit/adapter-php

最新稳定版本:1.0.7

Composer 安装命令:

composer require customsumit/adapter-php

包简介

PHP Security Adapter

README 文档

README

When a customer creates a roof kit on the kitbuildr and clicks the Add to Basket button the kitbuildr will attempt to POST the kit data to the merchant's website so that the kit can be added to the merchant ecommerce website's basket. The kit data is packaged and encrypted into a single data object before being sent across the wire to the ecommerce basket endpoint.

This PHP Security Adapter provides a common way to decrypt the kit data payload using the merchant specific private key (provided by Optagon).

Once the kit data has been decrypted the merchants ecommerce basket code must process the kit data and insert a product into the basket representing that kit.

The Security Adapter can then respond to the kitbuildr to indicate success and the kit was added to the merchant basket.

Usage


use CustomSumIT\Adapter\Adapter;

try {
	$Adapter = new Adapter ( $privateKey );

	// KitBuilder Kit Data
	$kit = $Adapter->data;

	// Add to cart START
	$addtoCartSuccess = true;
	// Add to cart END

	// Send a response to the Kit Builder
	$Adapter->setReturnUrl ( $returnUrl )->setAddedToCart ( $addtoCartSuccess )->respond ();
} catch ( Exception $e ) {
	// Log $e->getMessage() for debugging
}

Kit Data

The kit data object POSTed to the merchant website will contain:

[
    'kit_url'    => {string} URL of the kit that will allow the customer to reload that kit in the kitbuildr,
    'kit_price'  => {float}, Price of the kit excluding VAT,
    'kit_system' => {string} System code for the kit (e.g. 'classicbond', 'skyguard'),
    'kit_size'   => {float}  Area of the roof in sqm,
    'kit_ref'    => {string} Unique kit reference
]

kitbuildr® Requirements

The kitbuildr requires the basket endpoint on the merchant's website to which the kit data can be POSTed during the Add To Basket process. (e.g. https://www.merchant-domain.co.uk/add-to-basket.php). This is dependant on the merchant's particular ecommerce implementation.

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: MIT
  • 更新时间: 2018-03-22