Using Purchase Order Payment Method
First read more about Purchase Order Payment Method to learn about the purchase order payment method.
To use purchase order payment method, it should be enabled on our admin panels as per your request. Contact your VONQ Partner Account Manager to get it enabled. Once it is enabled, the paymentMethodsAvailable
array of orderJourney
state submodule will have purchase_order
option and the end user will see "Purchase Order" in the "Select a payment method" dropdown in "Payment Method" step of the order journey.
Purchase Order requires Wallet payment method to also have been enabled.
Disabling purchase order method in some use cases
If the purchase order is enabled globally in our admin panels however you want to disable purchase order method for certain business use cases then you can read Payment Methods Configuration.
If user does not have a "contract only" basket, in which case, we enforce "ATS Managed" option, you can specify this payment method as the selected payment method for your end user. 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.purchaseOrder
window.hapi.campaign.state.campaignForm = {
...window.hapi.campaign.state.campaignForm.value, //notice the .value
paymentMethod: selectedPaymentMethod
}
There is also an optional field called poNumber
that you can specify in campaignForm
object of campaign
state submodule. To set it programmatically, use the following code snippet:
const poNumber = "123"
window.hapi.campaign.state.campaignForm = {
...window.hapi.campaign.state.campaignForm.value, //notice the .value
poNumber: poNumber
}
It is also required to pass a walletId
when ordering a campaign but this is automatically handled by HAPI Elements.
There is no way to overwrite walletId
and even if there was, our backend does not allow using someone else's wallet for ordering campaigns.