Backend SDK (Payments)
This page compliments the Basic Payment Integration guide. Here you will find additional information regarding functions used in the Payments Integration Guide.
Note: We show here an example for NFT checkout,
but its the same process for Token checkout as well,
the only difference being the name of the function and the id
parameter.
The `getNftPurchaseData` callback function
In this function you are expected to define the transaction parameters, and define your desired settlement type. (For more info about settlement types see: Flow of Funds)
For each settlement type you will have to adjust your getNftPurchaseData
parameters accordingly:
See source repository for full example: https://github.com/paytweed/demo-v2-next/blob/main/services/tweed.service.ts
Note how we provide different parameters based on the type of the settlement.
The nftId
should correlate to the nftId
passed from the frontend in the buyWithFiat
function call.
Correctly specifiying your ABI:
The abi
parameter should contain the name of the function and its arguments declerations,
similar to the following example:
safeMint(sendTo address, tokenId uint256, tokenUri string)
.
The arguments needs to get populated into thecustomMintParams
object like so:
Last updated