Please see the developer docs for help with getting the above information.
see ./ams-dotnet/src/example/Program.cs for more demo usage.
Meter event upload
meter/createSession uses the regular signed AMS transport. Use its session ID
to call meter/uploadEvent through ExecuteWithHeaders:
var request = new AlipayMeterUploadEventRequest { Meters = meters };
var response = client.ExecuteWithHeaders(
request,
new Dictionary<string, string> { ["X-Session-Id"] = sessionId });
The SDK sends meter/uploadEvent to the gateway URL configured on the client,
without sandbox path rewriting, request signing, response signature verification,
or automatic retries. This API requires HTTP/2.
Advanced Topic
Integration Best Practice
Create optimal payment experiences for your customers by following these best practices for integrations.
Using API Mock
We provide an API mocking tool(currently in BETA version) for you to easily test exceptional cases.
Below are some of the default out-of-box mocking rules that basically use the payment amount value to identify the desired mock response:
API
when which input parameter
equals what
then you get a response of
ams/api/v1/payments/pay
payToAmount.value
9901
UNKNOWN_EXCEPTION
ams/api/v1/payments/pay
payToAmount.value
9902
network timeout
ams/api/v1/payments/inquiryPayment
payToAmount.value of the corresponding PAY request
9903
UNKNOWN_EXCEPTION
ams/api/v1/payments/inquiryPayment
payToAmount.value of the corresponding PAY request
Pass all the acceptance test cases in the Alipay Developer Center to ensure a high quality integration. Especially, test exceptions by using test cases.
Alipay AMS(Alipay Merchant Services) C# Bindings
## DocumentationPlease see the API docs for the most up-to-date documentation.Usage
Preparing
You need the following Integration information before starting:
Please see the developer docs for help with getting the above information.
see
./ams-dotnet/src/example/Program.csfor more demo usage.Meter event upload
meter/createSessionuses the regular signed AMS transport. Use its session ID to callmeter/uploadEventthroughExecuteWithHeaders:The SDK sends
meter/uploadEventto the gateway URL configured on the client, without sandbox path rewriting, request signing, response signature verification, or automatic retries. This API requires HTTP/2.Advanced Topic
Integration Best Practice
Create optimal payment experiences for your customers by following these best practices for integrations.
Using API Mock
We provide an API mocking tool(currently in BETA version) for you to easily test exceptional cases.
Below are some of the default out-of-box mocking rules that basically use the payment amount value to identify the desired mock response:
To use this mocking tool:
Acceptance testing
Pass all the acceptance test cases in the Alipay Developer Center to ensure a high quality integration. Especially, test exceptions by using test cases.
To get help
If you have any question or feedbacks regarding this sdk, please contact us at sandbox_service@alibaba-inc.com.
For other tech integration related issues, please reach us through overseas_support@service.alibaba.com.
FAQ
What if I only need to use the digital signature feature ?
See Digital signature for details about the signature algorithm used for data transmission.
./ams-dotnet/src/com/alipay/ams/util/SignatureUtil.csprovides static utility methods that you can directly use.Change history