Skip to content
Open
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
51 changes: 51 additions & 0 deletions es/sdk/web/checkout-sdk/hooks/useSelectPaymentModal.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -173,6 +173,57 @@ El objeto `settings` puede incluir las siguientes propiedades:
| `onError` | `(error: Error) => void` | Callback cuando ocurre un error |
| `onClose` | `() => void` | Callback cuando se cierra el modal |
| `txData` | `string` | Datos de transacción codificados para la compra |
| `forteConfig` | `object` | Configuración de Forte |

#### forteConfig
Se debe proporcionar el objeto forteConfig para habilitar los pagos con Forte.

El protocolo debe establecerse como `custom_evm_call` o `mint`, según si la transacción es un minteo o una transacción general.
Además, se debe proporcionar una cadena `sellerAddress`, que indica la dirección del vendedor en el caso de una transacción o la dirección del contrato en el caso de un minteo.

El calldata puede ser una cadena con el calldata (igual que el `txData` ya proporcionado) o un objeto calldata estructurado, que detalla el nombre de la función y los argumentos. Es fundamental que el calldata estructurado incluya una dirección de receptor, como se muestra en el siguiente ejemplo.

```tsx
const structuredCalldata = {
functionName: 'mint',
arguments: [
{
type: 'address',
value: '${receiver_address}' // The address of the receiver of the minted NFTs
},
{
type: 'uint256[]',
value: ['1']
},
{
type: 'uint256[]',
value: ['1']
},
{
type: 'bytes',
value: toHex(0)
},
{
type: 'address',
value: currencyAddress
},
{
type: 'uint256',
value: price
},
{
type: 'bytes32[]',
value: [toHex(0, { size: 32 })]
}
]
}

forteConfig: {
protocol: 'custom_evm_call',
calldata: structuredCalldata,
sellerAddress: '0x184D4F89ad34bb0491563787ca28118273402986'
}
```

#### closeSelectPaymentModal
`() => void`
Expand Down
51 changes: 51 additions & 0 deletions ja/sdk/web/checkout-sdk/hooks/useSelectPaymentModal.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -173,6 +173,57 @@ type UseSelectPaymentModalReturnType = {
| `onError` | `(error: Error) => void` | エラー発生時のコールバック |
| `onClose` | `() => void` | モーダルが閉じられたときのコールバック |
| `txData` | `string` | 購入用のエンコード済みトランザクションデータ |
| `forteConfig` | `object` | Forteの設定 |

#### forteConfig
Forte決済を有効にするには、forteConfigオブジェクトを指定する必要があります。

プロトコルは、取引がミントか一般的な取引かに応じて、`custom_evm_call` または `mint` のいずれかに設定してください。
また、取引の場合は販売者のアドレス、ミントの場合はコントラクトのアドレスを示す `sellerAddress` 文字列を必ず指定してください。

calldataは、(すでに提供されている `txData` と同じ)calldataの文字列、または関数名と引数を詳細に記述した構造化calldataオブジェクトのいずれかを指定できます。特に、構造化calldataの場合は、下記の例のように受取人アドレスを指定する必要があります。

```tsx
const structuredCalldata = {
functionName: 'mint',
arguments: [
{
type: 'address',
value: '${receiver_address}' // The address of the receiver of the minted NFTs
},
{
type: 'uint256[]',
value: ['1']
},
{
type: 'uint256[]',
value: ['1']
},
{
type: 'bytes',
value: toHex(0)
},
{
type: 'address',
value: currencyAddress
},
{
type: 'uint256',
value: price
},
{
type: 'bytes32[]',
value: [toHex(0, { size: 32 })]
}
]
}

forteConfig: {
protocol: 'custom_evm_call',
calldata: structuredCalldata,
sellerAddress: '0x184D4F89ad34bb0491563787ca28118273402986'
}
```

#### closeSelectPaymentModal
`() => void`
Expand Down
52 changes: 52 additions & 0 deletions sdk/web/checkout-sdk/hooks/useSelectPaymentModal.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -176,6 +176,58 @@ The `settings` object can include the following properties:
| `onError` | `(error: Error) => void` | Callback when an error occurs |
| `onClose` | `() => void` | Callback when the modal is closed |
| `txData` | `string` | Encoded transaction data for the purchase |
| `forteConfig` | `object` | Forte configuration |

#### forteConfig

The forteConfig object must be provided to enable Forte payments.
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

forteConfig for consistency


The protocol must be set to either `custom_evm_call` and or `mint` depending on whether the transaction is a mint or a general transaction.
Comment thread
SamueleA marked this conversation as resolved.
Outdated
Furthermore, a `sellerAddress` string must be provided, indicating the address of the seller in the case of a transaction or the address of the contract in the case of a mint
Comment thread
SamueleA marked this conversation as resolved.

The calldata can be either string with the calldata (the same as the `txData` already provided) or a structured calldata object, detailing the function name and the arguments. Crucially, the structured calldata requires a receiver address to be specified as shown in the example below.
Comment thread
SamueleA marked this conversation as resolved.
Outdated

```tsx
const structuredCalldata = {
functionName: 'mint',
arguments: [
{
type: 'address',
value: '${receiver_address}' // The address of the receiver of the minted NFTs
},
{
type: 'uint256[]',
value: ['1']
},
{
type: 'uint256[]',
value: ['1']
},
{
type: 'bytes',
value: toHex(0)
},
{
type: 'address',
value: currencyAddress
},
{
type: 'uint256',
value: price
},
{
type: 'bytes32[]',
value: [toHex(0, { size: 32 })]
}
]
}

forteConfig: {
protocol: 'custom_evm_call',
calldata: structuredCalldata,
sellerAddress: '0x184D4F89ad34bb0491563787ca28118273402986'
}
```

#### closeSelectPaymentModal

Expand Down