axguowen / lakala-sdk-php
Lakala SDK for PHP
dev-master
2024-03-23 05:49 UTC
Requires
- php: >=7.2.5
- axguowen/http-client: ^1.0
This package is auto-updated.
Last update: 2024-12-23 07:18:42 UTC
README
一个基于PHP的Lakala SDK
安装
composer require axguowen/lakala-sdk-php
使用
use axguowen\Lakala; // 配置参数 $config = [ // appid 'appid' => 'OP00000003', // 商户证书序列号 'serial_no' => '00dfba8194c41b84cf', // 商户号 'merc_id' => '8221210594300JY', // 终端号 'term_no' => 'A0073841', // 证书私钥内容 'private_key' => '-----BEGIN PRIVATE KEY----- MIIEvgIBADANBgkqhkiG9w0BAQEFAASCBKgwggSkAgEAAoIBAQDvDBZyHUDndAGx rIcsCV2njhNO3vCEZotTaWYSYwtDvkcAb1EjsBFabXZaKigpqFXk5XXNI3NIHP9M 8XKzIgGvc65NpLAfRjVql8JiTvLyYd1gIUcOXMInabu+oX7dQSI1mS8XzqaoVRhD ZQWhXcJW9bxMulgnzvk0Ggw07AjGF7si+hP/Va8SJmN7EJwfQq6TpSxR+WdIHpbW dhZ+NHwitnQwAJTLBFvfk28INM39G7XOsXdVLfsooFdglVTOHpNuRiQAj9gShCCN rpGsNQxDiJIxE43qRsNsRwigyo6DPJk/klgDJa417E2wgP8VrwiXparO4FMzOGK1 5quuoD7DAgMBAAECggEBANhmWOt1EAx3OBFf3f4/fEjylQgRSiqRqg8Ymw6KGuh4 mE4Md6eW/B6geUOmZjVP7nIIR1wte28M0REWgn8nid8LGf+v1sB5DmIwgAf+8G/7 qCwd8/VMg3aqgQtRp0ckb5OV2Mv0h2pbnltkWHR8LDIMwymyh5uCApbn/aTrCAZK NXcPOyAn9tM8Bu3FHk3Pf24Er3SN+bnGxgpzDrFjsDSHjDFT9UMIc2WdA3tuMv9X 3DDn0bRCsHnsIw3WrwY6HQ8mumdbURk+2Ey3eRFfMYxyS96kOgBC2hqZOlDwVPAK TPtS4hoq+cQ0sRaJQ4T0UALJrBVHa+EESgRaTvrXqAECgYEA+WKmy9h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/cCMgfTWQ5eKYC7Zm16zk7n4CP6IIgZIqm TVGsIGKk8RzWseyWPB3lfqMDR52V1tdA1S8lJ7a2Xnpt5M2jkDXoArl3SVSwCb4D AmThYhak48M++fUJNYII9JBGRdRGbfJ2GSFdPXgesUL2CwlReQwbW4GZkYGOg9LK CNPK6XShlNdvgPv0CCR08KCYRwC3HZ0y1F0NjaKzYdGNPrvOq9lA495ONZCvzYDo gmsu/kd6eqxTs/JwdaIYr4sCMg8Z -----END CERTIFICATE-----', // 是否测试环境 'test_env' => true, ]; // 创建聚合收银台服务 $aggregationCashdesk = \axguowen\Lakala::service('AggregationCashdesk', $config); // 收银台订单创建 $counterOrderSpecialCreate = $aggregationCashdesk->counterOrderSpecialCreate('order10102032033', 1599, '订单标题', [ 'notify_url' => 'http://xxx.xxx.com/notify', ]); // 打印创建结果 var_dump($counterOrderSpecialCreate);