Creating a payment request

1. Create a payment request

Payment requests can be created that specify:

FieldDescriptionRequired
AmountThe amount the customer is required to payYes
DescriptionA string description that will describe the reason for the payment to the customerYes
CustomerIdThe Id of the customer who will be making the paymentYes
VaultIdthe Id of the vault into which the funds will be paid. This vault must belong to the customer specified by CustomerIdYes
OnSuccessA url that will be called when the payment succeedsNo
OnFailA url that will be called if the payment failsNo
DataA dictionary of key value pairs that will be posted to the OnSuccess and OnFail methodsNo

To create a payment request issue a post to https://pay.nfiniti.co/PaymentRequest/Create.

The body of the post should be as follows.

{
	aescription : "Test Payment",
	amount : 100.00,
	customerId : "da99e8fe-e97f-44ef-ba77-8bdf2c6512da",
	walletId "ee0a2167-fccf-4b79-86ef-c06f1a230305",
	data {
 		metaDataId_0 1234;
  	metaDataId_1 : "Test Stuff"
	},
	onSuccess : "https://an.example.callback/id=abc",
	tenant "tenantId"
}

The Hosted Payment System will return a response such as:

{
	paymentRequestUrl: "https://pay.nfiniti.co/pay/28afb9f2-9619-46ac-9784-208408851560"
}

The customer who should make the payment can then be directed to the paymentRequestUrl.