Skip to content
Andrew Jones edited this page Apr 16, 2021 · 17 revisions

Request Url: /apis/payments

Request Body:

Amount=200&BookingId=4354&Charges=10&Currency=€&Comments=Test from iPro&PaymentMethod=PayPal&PaymentScheduleIds=1,2&PaymentDate=2015-08-22&Status=1&PropertyId=,BalanceDueDate==2015-09-22&PaymentToken=d7124bc2-7276-473e-9c37-a1b154b8404e&CardPartialNumbers=1234&IsDeferredPayment=&SagepaySecurityKey=&SagepayVendorTxCode=&SagepayVPSTxId=&SagepayTxAuthNo=&CardType=VISA&SendEmail=false
  • Amount : (Compulsory) You must push the amount the guest has paid

  • BookingID : (Compulsory) You must push the correct BookingID when creating a new payment

  • PaymentSchedules : (Compulsory) This should always be set to 1,2

  • Status : (Compulsory) 0, 1, 2

0 = Cleared Payment Status

1 = Not Cleared Payment Status

2 = Deferred Payment Status - The money will be paid at a later date but has been accepted

  • Currency : (Compulsory) You must push correct currency for the booking, iPro does not allow multi currency payments for one booking

  • PaymentDate : (Compulsory) You must set the date in format yyyy-mm-dd

  • PaymentMethod : (Compulsory) You must use an exact word match with payment methods setup in iPro

  • Comments : (Optional) We recommend recording the source of the payment i.e Guest Portal, Checkout Page, Payment page

  • AddBookingTag : (Optional) You can choose to add booking tag(s) based on the payment status i.e. Payment Failed, Payment Processed

  • RemoveBookingTag : (Optional) You can choose to remove specific tags base on the payment status

  • PaymentToken : (Optional) When you use payment provider which supports token payment (such as SagePay), you can pass the payment token to us, so that the user can charge the cost from the card in our site via payment token system.

  • CardPartialNumbers : (Optional) You should provide the last 4 digits of the credit card number when you pass the payment token.

  • SagepaySecurityKey : (Optional) Required to link payment to a live SagePay transaction

  • SagepayVendorTxCode : (Optional) Required to link payment to a live SagePay transaction

  • SagepayVPSTxId : (Optional) Required to link payment to a live SagePay transaction

  • SagepayTxAuthNo : (Optional) Required to link payment to a live SagePay transaction

  • SendEmail : (Optional) true or false, determines if a payment received email is sent to the guest (default is true)

  • balanceDueDate : If wish to override the balance due date, you can send when the next payment is due. This is required if you are making instalment payments

Response:

{
  "Success": true,
  "PaymentId": 1207
}

Payment Schedules:

For advanced setup's it is possible to assign payments to individual payment schedules by setting the scheduleID. However we recommend allowing iPro to allocate the money automatically by always pushing 1,2

How to record a failed payment

If a payment has failed, you can record this within iPro so that the team are aware of an attempted failed payment.

1/ Create the payment as normal with the amount they attempted to pay and set the status = 1 (Uncleared)

2/ You will then add the parameter AddBookingTag=, depending on the client setup the ID will be different for 'Payment Failed' but you should assign the tag 'Payment Failed'

3/ Within the comments, you want to insert the response from the payment provider i.e. Card declined.

This will create a log of the payment and clearly identify that the guest attempted payment.

How to process a payment when a website booking is in process

In this scenario we are assuming you have followed our [https://github.com/iprosoftware/api-csharp-client/wiki/Create-Booking](Create Booking) guide, so we have an active provisional booking that now needs the payment assigned.

If the payment was successful, you will insert the payment as above and you will then add the parameter RemoveBookingTag=12 where 12 = Website Booking in Progress. This will ensure that the booking is not automatically cancelled and the guest sent a re-engagement email for cart abandonment.

Clone this wiki locally