承接 escapework/tray-php 相关项目开发

从需求分析到上线部署,全程专人跟进,保证项目质量与交付效率

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

escapework/tray-php

Composer 安装命令:

composer require escapework/tray-php

包简介

Library PHP pra integrar com o Tray Checkout

README 文档

README

Library PHP pra integrar com o Tray Checkout.

Instalação

Adiciona a linha abaixo no seu composer.json e execute um composer update.

    "require": {
        "escapework/tray-php": "0.1.*"
    }

Criando transações

use EscapeWork\Tray\Transaction;

$transaction = new Transaction();
$transaction->setOrderNumber('seu-id-do-pedido');
$transaction->setPriceDiscount(0);
$transaction->setUrlSeller('http://seu-site.com/url-de-retorno');
$transaction->setUrlNotification('http://seu-site.com/url-de-notificacao');
$transaction->setPostalCodeSeller('91780010');
$transaction->setShippingType('Grátis');
$transaction->setShippingPrice(0);

# produtos
$transaction->addProduct(array(
    'code'        => 'your-product-code',
    'description' => 'your-product-description',
    'quantity'    => 1,
    'price_unit'  => 'your-product-price',
));

$transaction->create();

$redirectUrl = $transaction->getUrl() . $transaction->getTokenTransaction();

Depois disto, você só precisa redirecionar o usuário para a $redirectUrl.

Notificação de status

$transaction = new Transaction();
$transaction->setTokenTransaction('token-da-notificacao');
$transaction->notification();


# depois disso, você pode consultar tudo isto:
$transaction->getOrderNumber();
$transaction->getFree();
$transaction->getTransactionId();
$transaction->getStatusId();
$transaction->getStatusName();
$transaction->getTokenTransaction();

# payment
$transaction->payment->getPricePayment();
$transaction->payment->getPaymentResponse();
$transaction->payment->getUrlPayment();
$transaction->payment->getTid();
$transaction->payment->getSplit();
$transaction->payment->getPaymentMethodId();
$transaction->payment->getPaymentMethodName();
$transaction->payment->getLinhaDigitavel();

Referências

Licença

MIT License.

统计信息

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

GitHub 信息

  • Stars: 3
  • Watchers: 8
  • Forks: 1
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2013-06-28

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固