tourze/wechat-pay-score-bundle
Symfony bundle that wires WeChat Pay's credit score (支付分) service into your app, bundling the API client, order and authorization flows, callback handling, and configuration so you can support pay-after-use and deposit-free scenarios with minimal setup.
Install the package with Composer and confirm Laravel package discovery:
composer require tourze/wechat-pay-score-bundle
If the package does not auto-register, add its service provider in config/app.php. Publish any package config (check the README for the exact tag) and move credentials into .env:
WECHAT_PAY_MCH_ID=
WECHAT_PAY_APP_ID=
WECHAT_PAY_SERIAL_NO=
WECHAT_PAY_PRIVATE_KEY_PATH=
WECHAT_PAY_API_V3_KEY=
WECHAT_PAY_PLATFORM_CERT_PATH=
Look first at:
README.md for the supported Laravel versions and the exposed facade/service name.config/ for credential keys and HTTP client options.src/ for the public service classes and DTOs.0.0.1...0.1.0 diff, since the release notes only link to the changelog.tests/ for sandbox or fake-gateway examples.A sensible first use case is a sandbox WeChat Pay Score order: create a score service order, return the prepay parameters to the client, then query the order by out-trade number to confirm the package signs and parses responses correctly. Do not start with production credentials.
Keep the package behind your own application service rather than injecting it directly into controllers. A typical flow:
ScoreOrderService::create() builds your domain order, calls the package to create the WeChat Pay Score order, and stores the returned prepay ID.Use Laravel’s container and configuration system:
$score = app(WechatPayScore::class);
$result = $score->createOrder([
'out_order_no' => $order->out_trade_no,
'appid' => config('wechat-pay-score.app_id'),
'mchid' => config('wechat-pay-score.mch_id'),
'description' => $order->description,
'amount' => ['total' => $order->total_cents],
]);
Wrap package exceptions in your own domain exceptions so controllers and jobs do not depend on the package’s exception hierarchy. Log the WeChat request-id / Wechatpay-Request-ID header on every call; it is the most useful value when debugging failed signatures or malformed requests.
For integration testing, prefer a contract test around your wrapper with a fake HTTP client or a package-provided sandbox mode. If the package exposes no fake, bind a test double for the service and keep one sandbox integration test that exercises real signing.
0.1.0 only links to the changelog. Pin the version in composer.json and review the diff before upgrading; there is no prior assessment to rely on for compatibility.out_order_no values and handle duplicate callbacks. The package may retry or expose retry behavior; make your listeners idempotent regardless..env credentials, run php artisan config:cache in deployments. Stale config is a common cause of signature failures.How can I help you explore Laravel packages today?