(payload: PaymentPayload)
| 331 | * Encode a payment payload as a base64 string for the X-Payment header. |
| 332 | */ |
| 333 | export function encodePaymentHeader(payload: PaymentPayload): string { |
| 334 | return Buffer.from(JSON.stringify(payload)).toString('base64') |
| 335 | } |
| 336 | |
| 337 | /** |
| 338 | * Handle a 402 response by creating and encoding a payment. |
no test coverage detected