elad/cardcom
Composer 安装命令:
composer require elad/cardcom
包简介
Cardcom iframe php package
README 文档
README
cardcom iframe php package
Installation
Note: Cardcom Iframe is currently in beta.
composer require elad/cardcom
Basic Usage
use Cardcom\Iframe; use Cardcom\Invoice; use Cardcom\InvoiceProduct; use Cardcom\Setting; require 'vendor/autoload.php'; Setting::setTerminal(<yourTrminal>); Setting::setUser(<yourUser>);
Create iframe
$iframe = new Iframe(); $iframe->setPrice(15); $iframe->docTypeToCreate = 400; //$iframe->setGoodUrl("http://secure.Cardcom.co.il/DealWasSuccessful.aspx"); $iframe->setGoodUrl("http://cardcom.try/response2.php"); $iframe->setErrorUrl("http://cardcom.try/error.php");
Create invoice
$invoice = new Invoice("elad gasner", "elad@closeapp.co.il"); $product = new InvoiceProduct("מעיל", 5, 1); $product2 = new InvoiceProduct("מעיל רוח", 5, 2); $invoice->setProducts([$product, $product2]); $iframe->setInvoice($invoice);
Get iframe link
$iframe = new Iframe(); $iframe->setPrice(15); $iframe->setInvoice($invoice); //you can any property from the cardcom api $iframe->docTypeToCreate = 400; $iframe->setGoodUrl("http://cardcom.try/response2.php"); $iframe->setErrorUrl("http://cardcom.try/error.php"); // get iframe link $result = $iframe->getIframe(); if ($result->isSuccess()) { $link = $result->getUrl(); }else{ $result->getError(); }
Good Luck!
统计信息
- 总下载量: 139
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 2
- 点击次数: 1
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2017-07-16