Amazon Pay
Quick Start
- Sign up at pay.amazon.com and obtain API credentials
- Create a terminal in the Admin Console with the parameters below
- Start processing — the adapter is pre-built and ready to use
Overview
Amazon Pay — Payments (Amazon ecosystem)
| Provider ID | amazonpay |
| Category | E-Wallets |
| Website | pay.amazon.com |
Supported operations: Finalize Session (payments_authorize) Get Charge Status (payments_status) Refund (payments_refund)
Authentication
Method: RSA-PSS-SHA256 Signature (AMZN-PAY-RSASSA-PSS-V2)
Complex cryptographic scheme:
Step 1: Canonical Request
{HTTP_METHOD}\n
{CANONICAL_URI}\n\n
{CANONICAL_HEADERS}\n
{SIGNED_HEADERS}\n
{HASHED_PAYLOAD}
Step 2: Signed Headers
x-amz-pay-date:{iso8601_date}
x-amz-pay-host:{host}
x-amz-pay-region:{region}
Step 3: RSA-PSS Signature
signature = rsa_pss_sign(
canonical_request,
private_key,
salt_length: -1, // maximum
mgf1_md: SHA256
)
Step 4: Authorization Header
Authorization: AMZN-PAY-RSASSA-PSS-V2 PublicKeyId={public_key}:SignedHeaders={headers}:Signature={base64(signature)}
Additional headers:
x-amz-pay-date: 2024-01-15T10:30:00Z
x-amz-pay-host: pay-api.amazon.com
x-amz-pay-region: na
Configuration
Required Parameters
| Parameter | Description |
|---|---|
base_url | Base API URL (default) |
public_key | Public Key ID |
private_key_pem | Private Key in PEM format |
host | Host API (default) |
region | Region: na, eu, jp (default: na) |
Status Mapping
| Provider Status | 4pay Status | Description |
|---|---|---|
SUCCEEDED | Charged | Payment successful |
FAILED | Failure | Payment failed |
CANCELLED | Failure | Payment cancelled |
(other) | Pending | Processing |
SUCCEEDED | Refunded | |
FAILED | Failure | |
(other) | PartiallyRefunded |
API Reference
| Method | Endpoint | Description |
|---|---|---|
| POST | /checkoutSessions/{id}/finalize | |
| GET | /charges/{charge_id} | |
| POST | /refunds | |
| POST | /checkoutSessions/abc123/finalize |