API – Create New Payment Profile Process

General

To create a payment profile in LoanPro, you will need to create a customer if the customer the you want to link the payment profile to doesn’t exist. Next, you should create the payment profile in Secure Payments (formerly PCI Wallet). Finally, use the token in the Secure Payments response to create the payment profile in LoanPro.

To create a customer, please refer to API – Creating a Customer.

Create Payment Method in PCI Wallet

Due to PCI-Compliance, LoanPro only supports creating a payment profile through an iframe. This will require an iframe and JavaScript on your web page. For full Secure Payments Documentation please see the Secure Payments help material here: https://pciwallet.simnang.com/docs.html#pci-wallet

To add the iframe, add the following HTML to your page (replace <obo token> with your obo token; replace <payment token> with your payment account token):

For adding card information:

<iframe src="https://pciwallet.simnang.com/api/capture-form/<YOUR OBO TOKEN>" style="width: 800px; height: 700px; border: 1px solid black;" 
frameborder="0" border="0" cellspacing="0">
<p>Your browser does not support iframes.</p>
</iframe>

For adding bank/checking account information:


<iframe src="https://pciwallet.simnang.com/api/check-capture-form/<YOUR OBO TOKEN>?account_type=<ACCOUNT TYPE>"
style="width: 800px; height: 700px; border: 1px solid black;" frameborder="0" border="0" cellspacing="0">
<p>Your browser does not support iframes.</p>
</iframe>

For editing card information:

<iframe src="https://pciwallet.simnang.com/edit-form/<obo token>?account=<payment token>" frameborder="0" border="0" cellspacing="0">
<p>Your browser does not support iframes.</p>
</iframe>

For adding bank/checking account information:


<iframe src="https://pciwallet.simnang.com/check-edit-form/<obo token>?account=<payment token>" frameborder="0" border="0" cellspacing="0">

<p>Your browser does not support iframes.</p>
</iframe>

You will also need to add a JavaScript event handler for the “message” event. When a payment account is successfully made for Secure Payments, it will emit a JavaScript message event with the payment token that will be stored in LoanPro. This token removes your server from needing to be PCI Compliant and you can store it in your own database, pass it to your own server, etc. To let your page handle the message event, add the following JavaScript to your code:

window.addEventListener("message", receiveMessage, false);

function receiveMessage(event) {
if(event.origin === 'https://pciwallet.simnang.com' && event.data.status == 200){
token = event.data.token;
      //// Send your token to your server to save to LoanPro
}
}

You will need to send the payment profile token to LoanPro as outlined below. We recommend that this part is done on your server to avoid leaking your LoanPro API credentials.

 

Create Payment Profile in LoanPro

Once you have received your token from Secure Payments, it’s time to use it to create a payment profile inside of LoanPro. To do this, you’ll send a PUT request to the customers entity of the created customer. Below is a sample request for a credit card:

PUT https://loanpro.simnang.com/api/public/api/1/odata.svc/Customers(<Customer ID here>)


{
"id": "2", //customerid
"PaymentAccounts": {
"results": [
{
"active": 1,
"title": "(Credit Card Title)",
"type": "paymentAccount.type.credit",
"CreditCard": {
"token": "(credit card token)"
}
}
]
},
"__update": true,
"__id": "2" //customerid
}

To create a profile for a checking account, the request would be as follows

PUT https://loanpro.simnang.com/api/public/api/1/odata.svc/Customers(<Customer ID here>)
{ 
"id":"2", //customerid
"PaymentAccounts":{
"results":[
{
"CheckingAccount":{
"accountType":"bankacct.type.checking",
"token":"(bank account token)"
},
"active":1,
"isPrimary":1,
"isSecondary":0,
"title":"Checking Account",
"type":"paymentAccount.type.checking"
}
]
},
"__update":true,
"__id":"2" //customerid
}

As you can see, there a few differences in the formatting between “CheckingAccount” and “CreditCard”. The most important change is the designation of the “accountType” in the CheckingAccount. You’ll also need to have the type changes from paymentAccount.type.credit to paymentAccount.type.checking. Because of these differences, we will discuss the fields for both requests at the same time.

  • token – this is the token you received from Secure Payments of the token representing the payment profile
  • isPrimary – Whether or not it is the primary payment profile for the customer (1 – Yes, 0 – No)
    • Please note there can only be one primary payment profile per customer
  • isSecondary – Whether or not it is the secondary payment profile for the customer (1 – Yes, 0 – No)
    • Please note there can only be one secondary payment profile per customer
  • title – The title of the payment profile
  • type – the payment profile type (see API – Payment Profile Collections for more details)
  • active – Whether or not the payment profile is active (1 – Yes, 0 – No)


How did we do?


Powered by HelpDocs (opens in a new tab)