spgateway demo
this is a standalone demo for NewebPay(Spgateway) that third-party cash flow and logistics company in taiwan, refer by durpal plugin
Characteristics
- standalone
- use csv format as database
Quick start
you MUST regist a account in NewebPay(Spgateway) and get HashKey/HashIV/MerchantID
You can replace HashKey/HashIV variables in common.inc
define('HashKey', "GeQKWY3khCXGnSzS4kjYn9YBAGaZfZR8"); define('HashIV', "X7JTqiNUPIYXnGPN");
and csv path
define('TRANSACTION_LOG', "/tmp/t"); define('ORDER_LOG', "/tmp/o");
once run it under your web server, you can see as below(step 1):
and you can directly press Go
buttom to next step(step 2)
notice that
- replace your MerchantID in
MerchantID
field - the default
action
value is test website, please replace it under procution - TradeInfo/TradeSha is generated automatically
- if you under
localhost
domain, please us ngrok to explose your website CREDIT
field MUST be 1(only support creditcard payment inpayment_methods
)
in step 2, we generate TradeInfo/TradeSha automatically and you could press Go
to send data to Spgateway gateway by POST
method, please refer as following:
Then you could fill test data to simulate transaction and just press button to send
then you can see the processing animation and it also return trasaction data by POST
to your NotifyURL
filed
finally return to ReturnURL
as below:
Todos
- we use mcrypt_encrypt/mcrypt_decrypt to implement aes encrypt/decrypt, please replace it with openssl_encrypt/openssl_decrypt relatively
- support multi
payment_methods
License
MIT