handleAction
In order code scenarios, the MPP calls the server API userInitiatedPay to decode the code value and obtain the payment information. When the value of the actionForm.actionType parameter in the userInitiatedPay response is HANDLE_BY_SDK
, the MPP calls the handleAction API to further process the payment.
Method signature
copy
public void handleAction(Context context, ActionParams params);
Request parameters
Item | Type | Description | Required |
context | Context | The context of the Android activity or application | M |
params | The data that the SDK needs to further process the payment | M |
Response parameters
N/A
Sample
Sample for order code:
copy
//Step 1: Send a userInitiatedPay request to decode the code
//Step 2: If the value of the actionForm.actionType parameter in the userInitiatedPay response is "HANDLE_BY_SDK"
if(actionType.equals("HANDLE_BY_SDK")) {
ActionParams params = new ActionParams();
params.sdkActionPayload = response.actionForm.sdkActionPayload;
AlipayPlusClientMPM.getInstance().handleAction(context, params);
return;
} else {
// Invoke the cashier after receiving the request from Alipay+
}