Jetpay Developer Guide
Receive payments
Collect payment method at checkout
10 min
use this flow when you need to collect payment details at the time of payment this is ideal for guest checkout, one time payments, or customers without a saved payment method this flow supports both credit card and eft payment methods the collection method differs by payment type, but the overall process remains the same supporting multiple payment methods at checkout platforms that want to support both credit card and eft payments must implement their own payment method selection logic jetpay provides the underlying apis for each payment type but does not provide a unified checkout interface after creating the contact and debit transaction, route the customer through the appropriate payment flow based on their selected method prerequisites docid zgmim7qkrraox9jjaqrl your docid\ aex0ssfndr xgalxg2 zf where funds will be deposited flow overview sequencediagram actor customer participant frontend as platform frontend participant backend as platform backend participant jetpay as jetpay api %% step 1 create contact backend >>jetpay create contact jetpay >>backend contact id %% step 2 create debit backend >>jetpay create debit jetpay >>backend debit transaction id %% step 3 prepare checkout backend >>frontend checkout session info %% step 4 customer provides payment method customer >>frontend enter payment method alt credit card note right of backend debit is paid automatically jetpay >>backend payment result else eft backend >>jetpay pay debit jetpay >>backend debit status end implementation details create a contact see exact endpoint schema https //extapi jetpay baselinepayments com/docs#tag/contacts (v0)/operation/create contact contact put if you are not yet familiar with creating contacts with jetpay, please review the docid\ bzwf0wyooqbkgsfugenh0 guide create a debit transaction once the contact is created, a debit transaction must be created for the amount being collected you can view the creation of the debit transaction as creating a "payment intent" that has no payment method attached to it yet the debit is created in a "requested" state and will be completed once payment details are attached and the transaction is paid use your contact id ( contact id ) and your merchant bank account id ( to bank account ) to create a debit transaction base url="https //extapi demo jetpay baselinepayments com" api token="\<your api token>" curl x put "$base url/debit" \\ h "authorization bearer $api token" \\ h "content type application/json" \\ d '{ "amount" 10000, "statement" "test statement", "note" "test note", "to bank account" "platform bank abc", "contact id" "contact 123" }'import requests base url = "https //extapi demo jetpay baselinepayments com" api token = "\<your api token>" headers = { "authorization" f"bearer {api token}", "content type" "application/json" } payload = { "amount" 10000, "statement" "test statement", "note" "test note", "to bank account" "platform bank abc", "contact id" "contact 123" } response = requests put(f"{base url}/debit", headers=headers, json=payload) debit = response json() print(debit)const base url = "https //extapi demo jetpay baselinepayments com"; const api token = "\<your api token>"; const headers = { "authorization" `bearer ${api token}`, "content type" "application/json" }; const payload = { amount 10000, statement "test statement", note "test note", to bank account "platform bank abc", contact id "contact 123" }; async function createdebit() { const res = await fetch(`${base url}/debit`, { method "put", headers, body json stringify(payload) }); const debit = await res json(); console log(debit); collect payment method details and pay the debit at this stage, the implementation diverges depending on the payment type see either docid\ j7anvg6p9wfsonnofaaua or docid\ hbe uvqoeyxundh7co5cw for sample implementation you will see that the create debit endpoint request is the same, regardless of payment method type you plan to accept option a bank account for eft payments, you must collect the customer's bank account details and pad agreement before paying the debit jetpay does not yet provide a hosted bank collection form you are responsible for presenting a secure form in your application to collect bank details > docid\ hbe uvqoeyxundh7co5cw if you plan to manage your own pad agreements, please see our docid\ k8gcdqgtg1u1ud8h pf2m option b credit card for credit card payments, collect card details by retrieving a single use payment url and render it in an iframe to securely collect card details and pay the debit > docid\ j7anvg6p9wfsonnofaaua track status updates via events/webhooks as the transaction moves through its lifecycle, an event is created for each state update the most efficient way to track these updates in your system is to register for webhooks if you are not yet familiar with our webhooks system, please review the docid 79a4cgvetacholkpjyd5c guide