Send

Send Token in Escrow

Send any ERC20 token to the seller in escrow.


sendTokenToSellerInEscrow

Call the sendTokenToSellerInEscrow(args) function to send the choosen ERC20 token to the seller or merchant. This works only if before a order is created createOrder(args)

Import Functions

To use the function you need to import the libarary class called PalindromePaySend.

import {
  PalindromePayConnect,
  PalindromePayCreatePayment,
  PalindromePaySend,
} from '@Palindromepay/sdk'

Interfaces

// Input
export interface ISendTokenToSellerInEscrow {
  token: string;
  to: string;
  paymentSystemUID: string;
  amount: string | BigNumber;
  orderID: string;
  title: string;
  signer: any;
}

// Output
export interface IStates {
  status: boolean;
  tx: ITx;
}

Function

PalindromePaySend.sendTokenToSellerInEscrow(args)

token: string; to: string; paymentSystemUID: string; amount: string | BigNumber; orderID: string; title: string; signer: any; Params

NameTypeDescription
tokenstringtoken address - it can be passed any ERC20 token address
tostringaddress of the recipient - seller or merchant
paymentSystemUIDstringpaymentSystemUID generated over the system
amountstringamount you want to send
orderIDstringthe orderID to recognize the order
titlestringtitle of max length 42
signeranysigner to send transactions

Example Code

try {
  const args: ISendTokenToSellerInEscrow = {
    token: '0x17d348eAA30F191eE34c3dE874Ba9989f259e44c',
    to: 'your account address',
    paymentSystemUID: 'your paymentID address',
    amount: '100',
    orderID: '2',
    title: 'IPhone S6',
    signer: 'here the signer',
  }
  const res: IStatus = await PalindromePaySend.sendTokenToSellerInEscrow(args)
} catch (e) {
  console.log(e)
}
Previous
Create Payment