Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draft: Start of Paytr integration #1361

Draft
wants to merge 8 commits into
base: master
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
43 changes: 43 additions & 0 deletions packages/payment-processor/src/payment/paytr.ts
pclaesen marked this conversation as resolved.
Show resolved Hide resolved
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
// import { constants, ContractTransaction, Signer, BigNumberish, providers, BigNumber, ethers } from 'ethers';

// import { ClientTypes, ExtensionTypes } from '@requestnetwork/types';
// import { getPaymentNetworkExtension } from '@requestnetwork/payment-detection';
// import { EvmChains } from '@requestnetwork/currency';

// import { ITransactionOverrides } from './transaction-overrides';
// import {
// getAmountToPay,
// getProvider,
// getRequestPaymentValues,
// getSigner,
// validateErc20FeeProxyRequest,
// validateRequest,
// } from './utils';
// import { IPreparedTransaction } from './prepared-transaction';

// //Paytr custom import
// import { abi as ABI_0_1_0 } from './../../../smart-contracts/src/lib/artifacts/Paytr/0.1.0.json';

// export function encodePayErc20FeeRequest(
// request: ClientTypes.IRequestData,
// amount?: BigNumberish,
// feeAmountOverride?: BigNumberish,
// ): string {
// validateErc20FeeProxyRequest(request, amount, feeAmountOverride);

// const tokenAddress = request.currencyInfo.value;
// const { paymentReference, paymentAddress, feeAddress, feeAmount } =
// getRequestPaymentValues(request);
// const amountToPay = getAmountToPay(request, amount);
// const feeToPay = BigNumber.from(feeAmountOverride || feeAmount || 0);
// const paytrInterface = new ethers.utils.Interface(ABI_0_1_0);

// return paytrInterface.encodeFunctionData('payOutERC20Invoice', [
// tokenAddress,
// paymentAddress,
// amountToPay,
// `0x${paymentReference}`,
// feeToPay,
// feeAddress || constants.AddressZero,
// ]);
// }
Loading
Loading