I have been trying to build an Alipay payment plugin for WooCommerce. I use credentials obtained from https://isandbox.alipaydev.com/. This website provides both Buyer account credentials and Merchant account credentials. I used Merchant account credentials for backend (integrated with plugin) and use Buyer account for the purchase.
When I make a purchase Alipay website says payment was successful and but when the plugin tries to verify the payment using notify_verify URL (http://notify.alipay.com/trade/notify_query.do?) their response always returns false.
When I try with a different verification URL (https://mapi.alipay.com/gateway.do?service=notify_verify&) they respond with
<alipay>
<is_success>F</is_success>
<error>ILLEGAL_PARTNER</error>
</alipay>
My question is if it was an illegal partner, how was I able to make a payment which was generated by same partnerId?
You are trying wrong URL.
For test purposes you should use
https://openapi.alipaydev.com/gateway.do?