YS CART - NewebPay
Adds NewebPay MPG payment and official logistics methods to YS CART as an external provider plugin.
by YangSheep · github.com/ya19880104/ys-cart-newebpay · website
Install
No release zip yet. The repository archive installs, but the folder name will carry the branch suffix and updates will not flow:
wp plugin install https://github.com/ya19880104/ys-cart-newebpay/archive/refs/heads/main.zipStandalone NewebPay provider plugin for YS CART.
Features
- NewebPay MPG form-post checkout using AES-256-CBC (
EncryptType=0). - Credit card, installment, ATM virtual account, CVS code, barcode, LINE Pay, and Apple Pay gateway variants.
- NotifyURL and ReturnURL handlers using YS CART payment lifecycle service.
- PayUni-style YS CART admin settings with API, payment, logistics, installment, callback, and log tabs.
- NewebPay query API wrapper.
- Credit-card close/refund and e-wallet refund wrappers.
- NewebPay official logistics API integration:
- Store map (
storeMap) for 7-ELEVEN, FamilyMart, HiLife, and OK mart. - Shipment create, shipment number lookup, print label, query, modify, trace, and status notify handlers.
- C2C store-to-store: 7-ELEVEN, FamilyMart, HiLife, OK mart.
- B2C bulk warehouse pickup: 7-ELEVEN.
- YS CART-compatible
cvs_store_*, shipping-label, tracking, and pipeline storage.
- Store map (
- Bundled YS Plugin Hub Client for updates from yangsheep.com.tw.
Requirements
- WordPress with YS CART active.
- PHP 8.1 or later.
- NewebPay MerchantID, HashKey, and HashIV.
Installation
- Install and activate YS CART.
- Install and activate this plugin.
- Open YS CART payment settings and configure NewebPay.
- Enable the payment and logistics methods you want to expose at checkout.
Callback URLs
Set these in NewebPay if the merchant portal requires explicit URLs:
- NotifyURL:
/wp-json/ys-ecommerce/v1/newebpay/notify - ReturnURL:
/wp-json/ys-ecommerce/v1/newebpay/return - Store callback:
/wp-json/ys-ecommerce/v1/newebpay/store-callback - Shipping notify:
/wp-json/ys-ecommerce/v1/newebpay/shipping-notify
The plugin also sends these URLs in each MPG request. Store callback and shipping notify routes are provider-facing callback routes and should not be called by browser UI.
Headless logistics
For convenience-store logistics, request the YS CART store-map route with the selected shipping method ID:
{
"shipping_id": "ys_ec_newebpay_ship_711_c2c"
}
Route:
POST /wp-json/ys-ecommerce-headless/v1/stores/newebpay/map-url
Submit the returned action_url and fields as a top-level browser form post
or popup form post.
Release
Build the distributable ZIP:
php bin/build-release.php
The ZIP is written to artifacts/ys-cart-newebpay-{version}.zip.
Security Notes
- HashKey and HashIV are stored through YS CART encrypted settings.
- Secrets are never exposed to frontend JavaScript.
- NotifyURL verifies
TradeShabefore decryptingTradeInfo. - Optional
CheckCodeis verified when NewebPay includes it. - Raw callback payload is stored only when debug mode is enabled.