payway_partner 2.0.1
payway_partner: ^2.0.1 copied to clipboard
ABA PayWay partner API client for Dart and Flutter. Register merchants, decrypt the pushback and inquire merchant info.
2.0.1 #
- Docs: test commands in the README are safe to paste into zsh.
- First release published automatically from GitHub Actions.
2.0.0 #
First release under the new name payway_partner, the successor of
dart_payway_partner 1.x.
To migrate, replace the dependency and imports:
package:dart_payway_partner/dart_payway_partner.dart →
package:payway_partner/payway_partner.dart.
Breaking changes #
- fields are camelCase (
registerRef,pushbackUrl,merchantKey, ...); JSON keys sent to PayWay are unchanged PaywayPartnerRegisterMerchant.currency(USD/KHR) is required, as per ABA docs;typedefaults to0- one
PaywayPartnerStatus(code,message,tranId,traceId,correlationId,isSuccess) replacesPaywayPartnerRegisterMerchantResponseStatusandPaywayPartnerCheckMerchantResponseStatus PaywayPartnerCheckMerchantResponseis renamedPaywayPartnerInquiryResponse(used bycheckMerchantandgetMcInfo)- network failures and bodies without a PayWay status throw
PaywayPartnerExceptioninstead of returning a fakePTL46 PaywayPartnerClientFormRequestServiceis replaced byPaywayPartnerRequestBuilder(registerMerchant,checkMerchant,getMcInfo,signedBody,hash)PaywayPartnerClientService,EncoderService,PaywayPartnerLogger(logger class),PlatformHttpClientAdapter,dioLoggerInterceptorare removed; RSA/HMAC is inPaywayPartnerCrypto- the package no longer exports
debugPrint,listEquals,kIsWebor the string/list extensions, which clashed withpackage:flutter/foundation.dart - the per-call
enabledLoggerflag is removed: passloggertoPaywayPartnerService PaywayPartner.refererDomain(unused) is removed;partnerRefereris sent asReferer- dependencies
intlandloggerare removed - requires Dart 3.9+ (Flutter 3.35+), needed by
json_annotation4.12 - models use
json_serializable:fromMap/toMapare replaced by generatedfromJson/toJson(PayWay snake_case keys;PaywayPartneruses its Dart field names) - decryption errors (
decryptPushback,decryptMerchantCredential,decryptMcInfo,decryptMerchantData) throwPaywayPartnerExceptioninstead ofFormatException/ArgumentError PaywayPartnerStatus.successCodeis replaced byPaywayPartnerStatusCode.successPaywayPartnerExceptiontakes aPaywayPartnerErrorTypeas first argument- the
encryptdependency is replaced bypointycastle4 (drops the discontinuedjspackage);PaywayPartnerCrypto.toPublicKeyPemis removed, keys in any supported format are accepted directly - license changed from GPL-2.0 to MIT
Security #
- TLS certificates are validated again (the IO adapter accepted any certificate)
PaywayPartner.toString()no longer printspartnerKey/partnerPrivateKey
Features #
getMcInfo: inquiry merchant info via merchant public keydecryptPushbackdecodes thereturn_paramsPayWay sends topushback_url- typed
PaywayPartnerMerchantCredential(decryptMerchantCredential,toGetMcInfoMerchant) andPaywayPartnerMerchantInfo(decryptMcInfo) PaywayPartnerServiceaccepts injecteddio,clock,cryptoandlogger; one HTTP client is reused for all callsPaywayPartner.sandboxBaseUrl/productionBaseUrl; endpoint paths asPaywayPartnerService.*Path- register merchant sends
merchant_typeandreference_id, as per ABA docs PaywayPartnerStatusCode: named constants for every documented status coderegisterMerchant,checkMerchantandgetMcInfoaccept aCancelToken(re-exported fromdio)PaywayPartnerException.type(PaywayPartnerErrorType) andisRetryableUser-Agent: payway-partner-dart/<version>header;PaywayPartnerService.sdkVersion- RSA keys accepted as PEM
PUBLIC KEY/RSA PUBLIC KEY/ bare base64, andRSA PRIVATE KEY/PRIVATE KEY(PKCS#8)
Fixes #
- ABA's real status is kept on error responses (e.g.
PTL02 Wrong Hash) instead of alwaysPTL46 request_timeis generated in UTC, as per ABA docs, and validated- RSA chunk sizes are derived from the key, so 2048 bit keys work (was hard-coded to 1024 bit)
- decryption no longer corrupts multi-byte (e.g. Khmer) text split across chunks
- merchant
rsa_public_keyis accepted as bare base64 (auto PEM wrap)
Tooling #
lints6 pluspublic_member_api_docs, strict casts and raw types; analysis passes with--fatal-infos- every public API member is documented; code is
dart formatted (checked in CI) - GitHub Actions CI: generated code freshness, analysis, unit tests, optional sandbox tests, publish dry-run, example analysis
Tests #
- moved to the
kechankrisna/payway-partnerrepository; conformance vectors shared with the Node and PHP SDKs - offline unit tests (fake HTTP adapter, throwaway keys); sandbox tests tagged
integrationand skipped without.env
1.0.2+3 #
- add ABA_PARTNER_REFERER_DOMAIN as Referer
- change from tran_id to support trace_id and correlation_id
1.0.2+2 #
- fix date_format from yMddhhmmss to yMMddhhmmss
1.0.2+1 #
- add ABA_PARTNER_REFERER_DOMAIN as Referer
1.0.2 #
- fixed kIsWeb
1.0.1 #
- fixed env base uri
- add comment as doc
1.0.0 #
- Initial version.