Helper functions

getMapping

Returns the mapping data of a specific payment reference.

function getMapping(bytes memory _paymentReference) public view returns(PaymentERC20 memory) {
        return paymentMapping[_paymentReference];
    }

The paymentMapping keeps track of the payment data in the form of a Struct PaymentERC20:

struct PaymentERC20 {
        uint256 amount;
        uint256 feeAmount;
        uint256 wrapperSharesReceived;
        uint40 dueDate;
        address payer;
        address payee;
        address feeAddress;
        bool shouldPayoutViaRequestNetwork;
}

Interact with the getMapping function:

const paytrContract = new ethers.Contract(paytrContractAddress, PaytrABI, signer);

await paytrContract.getMapping(_paymentReference); //pass in bytes

//example
await paytrContract.getMapping("0x494e56332d32343034");
)

Last updated