First Payment Flow
Initialize the widget with the relevant details Here are some commonly used properties. All the properties are listed here.| Property name | Type or example | Description | 
|---|---|---|
| minimumAuthorizationUsdAmount | number, eg. 199 (for $1.99) | The minimum USD equivalent the user must authorize from their wallet in the selected token to complete the payment. If no value is set, the invoice amount will be used. | 
| awaitConfirmation | boolean (default is true) | Controls whether confirmation of the transaction on-chain is part of the payment flow. If false, the user will only wait for the PayIn to be created before the component’s state is set to “complete”. | 
| invoiceRefId | string | A reference to an invoice being paid. This will be blank if you are creating a new subscription in Chargebee | 
| awaitConfirmation | boolean (default is true) | If the user is signing up with a free trial, this should be false because no payment happens today If the user is upgrading and should pay today, this should be set to true | 
| billDate | number (date in seconds) | Bill date when the payment is due. Pays immediately if left empty | 
onPayInCreated event handler to create the Chargebee subscription.
Here is a sample approach:
The object passed to onPayInCreated function contains the Loop payIn object with ID. Call a server endpoint that creates the Chargebee user and subscription: 
- Chargebee Customer.create- returns the customer
- Chargebee subscription.createWithItems- creates the subscription for the customer and returns the first invoice.
PayIn in Loop to reflect the correct invoiceRefId
Sample Loop SDK call to update: 
Processing Next invoices
To process follow-up invoices, the Loop flow is very simple. SDK Samplepayin.created event will trigger to confirm the payin has been successfully created. 
On the due date, Loop will process the payment and send a payment.processed event that confirms the transaction has been processed. 
More information about the webhook structure can be found on the Webhooks Event page.
If there is a pending payin that is 10 minutes past due, the missed_payin.payment webhook will fire.