Using ATS Managed Payment Method
First read more about ATS Managed Payment Method to learn about the ATS managed payment method.
The paymentMethodsAvailable
array of orderJourney
state submodule will have ats_managed
option however the end user will not see "ATS managed" in the "Select a payment method" dropdown in "Payment Method" step of the order journey.
Disabling purchase order method in some use cases
There is no way to disable ATS Managed payment method.
If user has a "contract only" basket, we enforce "ATS Managed" option however you can specify this payment method as the selected payment method for your end user based on your business requirements. To do that you would set paymentMethod
property of campaignForm
object of campaign
state submodule.
//use the enum instead of hardcoded string
const selectedPaymentMethod = window.hapi.orderJourney.utils.paymentMethodKeys.atsManaged
window.hapi.campaign.state.campaignForm = {
...window.hapi.campaign.state.campaignForm.value, //notice the .value
paymentMethod: selectedPaymentMethod
}
For ATS Managed payment method to work, the request should not contain walletId
and poNumber
and this is already automatically handled by HAPI Elements.
Even if you have set poNumber
, it will be discarded.