brunopazz/zoop-sdk
Composer 安装命令:
composer require brunopazz/zoop-sdk
包简介
SDK da plataforma digital da ZOOP
README 文档
README
Composer
$ composer require "brunopazz/zoop-sdk"
credit card + Split
$credentials = new Credentials("xxx","zpk_test_xxxx", "xxxxxx","PRODUCTION"); $transaction = new Transactions(); $transaction->setAmount(704); $transaction->setCurrency("BRL"); $transaction->setDescription("MinhaLoja"); $transaction->setPaymentType("credit"); $transaction->setCapture(true); $transaction->setOnBehalfOf("f90083c033c24bae834a41077e03ba31"); $transaction->setReferenceId("ref1234".rand(1,100000)); $transaction->setUsage("single_use"); $transaction->setType("card"); $transaction->setCardNumber("4916521617351812"); $transaction->setHolderName("Teste card"); $transaction->setExpirationMonth("10"); $transaction->setExpirationYear("22"); $transaction->setSecurityCode("123"); $transaction->setStatementDescriptor("MinhaLoja"); $transaction->setInstallmentPlan("with_interest", "12"); $zoop = new Zoop($credentials); $authorize = $zoop->Authorize($transaction); //$capture = $zoop->Capture($authorize->getOnBehalfOf(),$authorize->getId(),$authorize->getAmount()*100); //$cancel = $zoop->Cancel($capture->getOnBehalfOf(),$capture->getId(),$capture->getAmount()*100); $split = new Split(); $split->setLiable(true) ->setAmount(100) ->setChargeProcessingFee(true) //->setPercentage(50) ->setRecipient("0a4775ddea084632973fca5b384847fd"); $splitResponse = $zoop->Split($split,$authorize->getId()); if($splitResponse->hasSplitted()){ print "OK"; }else print $splitResponse->toJSON();
Boleto Bancário + Split
$credentials = new Credentials("xxx","zpk_test_xxxx", "xxxxxx","PRODUCTION"); $transaction = new Boleto(); $transaction->setAmount(704); $transaction->setCurrency("BRL"); $transaction->setDescription("minhaloja"); $transaction->setPaymentType("boleto"); $transaction->setOnBehalfOf("f90083c033c24bae834a41077e03ba31"); $transaction->setExpirationDate("2019-11-20"); $transaction->setPaymentLimitDate("2019-11-20"); $transaction->setBodyInstructions("teste de instrucao"); $customer = new Customer(); $customer->setFirstName("Bruno Teste"); $customer->setTaxpayerId("30628284812"); $customer->setEmail("minhaloja@gmail.com"); $customer->setAddressLine1("ruas de testes"); $customer->setAddressLine2("bairro teste"); $customer->setAddressNeighborhood("centro"); $customer->setAddressCity("Sao paulo"); $customer->setAddressState("SP"); $customer->setAddressPostalCode("04742350"); $customer->setAddressCountryCode("BR"); $zoop = new Zoop($credentials); $authorize = $zoop->Boleto($transaction,$customer); $split = new Split(); $split->setLiable(true) ->setAmount(100) ->setChargeProcessingFee(true) //->setPercentage(50) ->setRecipient("0a4775ddea084632973fca5b384847fd"); $splitResponse = $zoop->Split($split,$authorize->getId()); if($splitResponse->hasSplitted()){ print "OK"; }else print $splitResponse->toJSON();
Seller (IN DEVELOPMENT)
$credentials = new Credentials("xxx","zpk_test_xxxx", "xxxxxx","PRODUCTION"); $seller = new Seller($credentials); print_r($seller->getById("0c2fb87678664ce694c3ace391923f9d"));
Zero Dolar Auth
$credentials = new Credentials("xxx","zpk_test_xxxx", "xxxxxx","PRODUCTION"); $card = new Card(); $card->setCardNumber("4916521617351812"); $card->setHolderName("Teste card"); $card->setExpirationMonth("12"); $card->setExpirationYear("28"); $card->setSecurityCode("188"); $customer = new Customer(); $customer->setFirstName("Bruno"); $customer->setLastName("Paz"); $customer->setTaxpayerId("23628284802"); $customer->setEmail("minhaloja@gmail.com"); //$customer->setAddressLine1("ruas de testes"); //$customer->setAddressLine2("bairro teste"); //$customer->setAddressNeighborhood("centro"); //$customer->setAddressCity("Sao paulo"); //$customer->setAddressState("SP"); //$customer->setAddressPostalCode("08742350"); //$customer->setAddressCountryCode("BR"); $zoop = new Zoop($credentials); $ZeroAuth = $zoop->ZeroDolarAuth($card,$customer); if($ZeroAuth->isValidCard()){ $transaction = new Transactions(); $transaction->setAmount(704); $transaction->setCurrency("BRL"); $transaction->setDescription("minhaloja"); $transaction->setPaymentType("credit"); $transaction->setCapture(true); $transaction->setOnBehalfOf("f90083c033c24bae834a41077e03ba31"); $transaction->setReferenceId("ref1234".rand(1,100000)); $transaction->setCustomer($ZeroAuth->getCustomer()); $transaction->setStatementDescriptor("minhaloja"); $transaction->setInstallmentPlan("with_interest", "12"); $zoop = new Zoop($credentials); $authorize = $zoop->Authorize($transaction); if($authorize->isAuthorized()){ $split = new Split(); $split->setLiable(true) //->setAmount(100) ->setChargeProcessingFee(true) ->setPercentage(50) ->setRecipient("0a4775ddea084632973fca5b384847fd"); $splitResponse = $zoop->Split($split,$authorize->getId()); print $splitResponse->toJSON(); }else{ print $authorize->toJSON(); } }
Split
... $split = new Split(); $split->setLiable(true) ->setAmount(100) ->setChargeProcessingFee(true) //->setPercentage(50) ->setRecipient("0a4775ddea084632973fca5b384847fd"); $splitResponse = $zoop->Split( $split, "{TRANSACTION_ID}"); if($splitResponse->hasSplitted()){ print "OK"; }else print $splitResponse->toJSON();
brunopazz/zoop-sdk 适用场景与选型建议
brunopazz/zoop-sdk 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 417 次下载、GitHub Stars 达 2, 最近一次更新时间为 2019 年 06 月 08 日, 在 PHP 生态内属于活跃度较高的组件。
我们在过去多个企业项目中使用过 brunopazz/zoop-sdk 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 brunopazz/zoop-sdk 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
统计信息
- 总下载量: 417
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 2
- 点击次数: 5
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2019-06-08