Square沙箱测试账户无法处理JPY支付请求求助
Hey there, let's work through this issue where your Square sandbox can only process USD payments but throws an error for JPY or other currencies. Here are the key steps to resolve it:
1. Enable Target Currencies in Your Sandbox Merchant Account
Square sandbox merchant accounts default to only supporting USD out of the box. You'll need to manually add and enable the currencies you want to use:
- Log into your Square Sandbox Dashboard
- Navigate to Settings > Business > Currencies
- Look for the currency you want (like JPY) and click "Enable"
- Confirm the setup—this lets your sandbox business accept payments in that currency
2. Double-Check Your API Request Parameters
Make sure your payment API call correctly specifies the currency and uses the right amount format:
- Ensure the
currencyfield in youramount_moneyobject is set to the uppercase code (e.g.,"JPY"instead of"jpy") - Remember that some currencies (like JPY) don't use subunits, so the
amountshould be an integer representing the full value (e.g., 1000 for ¥1000) - Example request snippet (using Square Payments API):
{ "source_id": "cnon:card-nonce-ok", "amount_money": { "amount": 1000, "currency": "JPY" }, "idempotency_key": "your-unique-key-here" }
3. Verify Sandbox Account Permissions
Occasionally, sandbox accounts might have restrictions that block multi-currency processing. To check:
- In the Sandbox Dashboard, go to Settings > Users > Permissions
- Confirm your account has full access to "Payments" and "Currency Management" features
- If you're using a test sub-account, ensure it inherits the necessary permissions from the main sandbox merchant
4. Use the Latest Square API Version
Older versions of the Square API might have limited support for multi-currency transactions. Update your API client to use the latest stable version to avoid compatibility issues.
Quick Note on Testing
When testing non-USD payments, use Square's official test cards that match the currency. For example, you can use the universal test card 4111 1111 1111 1111 for most currencies, but ensure your sandbox account has that currency enabled first.
内容的提问来源于stack exchange,提问作者Mahesh Yadav

