Skip to main content

Tokens and Memberships purchase

Overview

To purchase memberships or tokens, call the openUI function with the required configuration. This method is similar to the stored value purchase process.

Usage Example

Here is an example of how to use the openUI function to purchase a membership or decom tokens:

typescript
import { Passport } from '@credenza3/passport-evm'

const passport = new Passport()
await passport.init()

passport.openUI(Passport.pages.PAYMENT, {
  title: 'Purchase',
  subtitle: 'Select a payment method and complete your purchase',
  payments: {
    credenzaStoredValue: {
      disabled: false
    },
    stripe: {
      disabled: false
    }
  },
  tokens: [{
    contractAddress: ""
    tokenId: "",
    amount?: 1
  }],
  memberships: [
    {
      contractAddress: ""
      typeId?: ""
    }
  ]
  email: {
    templateId: 'custom-template-id'  // Optional custom email template
  }
})

This is going to open passport window where a user can finish his transaction:

Entering Payment Details

After confirming their stored value selection, users see the Order Summary modal. Here, they can choose a payment method such as Credit Card or Credenza Balance. For credit card payments, they'll input their card number and can use the Autofill link for convenience. They then click the Pay button.

Confirming Payment

Upon successful payment, a Success! modal confirms the transaction. Users can acknowledge the message and proceed with other activities.