reyesoft / mercadopago
此库帮助您通过MercadoPago进行支付,甚至包括使用二维码
1.1.4
2023-02-15 19:03 UTC
Requires
- php: >=7.2
- ext-gd: *
- endroid/qr-code: ^3.2
- pablorsk/dx-php: 2.2.8
Requires (Dev)
- codedungeon/phpunit-result-printer: 0.19.10
- phpunit/phpunit: ^7
- reyesoft/ci: 1.2.0
- v1.1.x-dev
- 1.1.4
- 1.1.3
- 1.1.2
- 1.1.1
- 1.1.0
- v1.0.x-dev
- 1.0.4
- 1.0.3
- 1.0.2
- 1.0.1
- 1.0.0
- v0.0.x-dev
- 0.0.2
- 0.0.1
- dev-fix/deprecated-doctrine-annotation-dx-bump
- dev-fix/doctrine-inflector
- dev-dx-bump
- dev-bump/dx-php
- dev-changed/dx-php-2.2.3
- dev-dx-php-1.7.3-updated-with-fix
- dev-dx-php-updated-with-psr-4-fixes
- dev-fix-dev-mercadopago-dx-php
- dev-migration-to-mercadopago-dx-php
- dev-feature/order_qr
- dev-readme-description
- dev-readme-gitignore
- dev-fix-circleci
This package is auto-updated.
Last update: 2024-09-15 22:06:59 UTC
README
此库可以帮助您生成二维码,用于通过MercadoPago进行支付,包括使用二维码支付。使用了[endroid/qr-code] (https://github.com/endroid/qr-code) 和 mercadopago/dx-php)
安装
composer require reyesoft/mercadopago
使用方法
创建POS
$mp = new \MP('client_id', 'client_secret'); // $mp = new \MP('your_access_token'); $pos = new MercadoPagoPos($mp, 'MyTestPos'); $filename = __DIR__ . '/image/mercadopago-qr-code.png'; $pos->getQrCode()->writeFile($filename);
您可以从https://www.mercadopago.com/mla/account/credentials获取MercadoPago凭证
使用订单填充POS
$order_data = [ 'external_reference' => 'id_interno', 'notification_url' => 'www.yourserver.com/endpoint', 'items' => [ [ 'title' => 'api_smsc_com_ar', 'quantity' => 1, 'currency_id' => 'ARS', 'unit_price' => 450, ], ], ]; $order = $pos->createAnOrder(); $result = $order->sendData($order_data);
这将生成类似的二维码
支持我们
Reyesoft是一家位于阿根廷San Rafael的软件公司。您可以在我们的网站上找到所有项目的概述。
PHP 7.4
docker run -it --rm --name php74 -e PHP_EXTENSIONS="gd" -v "$PWD":/usr/src/app thecodingmachine/php:7.4-v4-cli bash