la-sportive/sdk 问题修复 & 功能扩展

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

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

la-sportive/sdk

Composer 安装命令:

composer require la-sportive/sdk

包简介

La Sportive SDK for a fast implementation

README 文档

README

Concept

La Sportive wants to help clubs by giving them cashback when customers buy articles.

This SDK is here to help you declare what customers successfully buy on your ecommerce website.

Installation

composer require la-sportive/sdk '^0.1'

Using this SDK

First, when customer is redirected to your ecommerce website, a token will be provided to you through parameter session. Save this token.

    <?php
    session_start();
    
    $_SESSION['laSportiveSession'] = $_GET['session']

First you need to initialize the component

    <?php
    $laSportiveCommunicator = new \LaSportive\SDK\Communicator()
    $laSportiveCommunicator->init()

And finally, when you have a confirmed transaction, you can send it to La Sportive service

    <?php
    session_start();
    
    $transaction = new \LaSportive\SDK\Entity\Transaction();
    
    // Some custom reference for your internal purpose
    $transaction->setExternalReference('REF12354');
    
    // The cashback you want to apply
    $transaction->setCashbackReference('CB12354');
    
    // A custom label
    $transaction->setLabel('Some running shoes');
    
    // The transaction amount in € with no coma. 10.50€ will be set as 1050€
    // So in this exemple this is a 75€ transaction
    $transaction->setAmount(7500);
    
    $laSportiveCommunicator->commitTransaction($_SESSION['laSportiveSession'], $transaction);

And that's all ! You will then find all your transactions and stats on La Sportive service.

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: Unknown
  • 更新时间: 2016-11-08

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固