Hello Square Support Team,
I’m currently using the Square Mobile Payments SDK v2.3.0 to process payments on iOS .
My goal is to accept partial authorization for Square Gift Cards, so that if a customer’s gift card balance is less than the total amount, the payment can still capture the available balance (e.g., $5 out of $10 requested), and then allow the user to continue paying the remaining amount with another method.
However, in my tests:
-
I have set acceptPartialAuthorization = true and autocomplete = false (as required by the documentation).
-
The merchant account is enabled for Gift Cards and is in production mode.
-
The payment attempt is made with a real Square Gift Card that has insufficient funds.
-
My code is :
let paymentParams = PaymentParameters(paymentAttemptID: paymentAttemptID, amountMoney: SquareMobilePaymentsSDK.Money( amount: UInt(amount), currency: .USD ), processingMode: .autoDetect ) if let tipAmount = tipAmount, tipAmount > 0 { paymentParams.tipMoney = SquareMobilePaymentsSDK.Money( amount: UInt(tipAmount), currency: .USD ) } paymentParams.acceptPartialAuthorization = true paymentParams.autocomplete = false paymentParams.delayDuration = 60 paymentParams.delayAction = .complete let promptParams = PromptParameters( mode: .default, additionalMethods: .all ) // 获取当前最顶层的 view controller guard let windowScene = UIApplication.shared.connectedScenes.first as? UIWindowScene, let window = windowScene.windows.first, let rootViewController = window.rootViewController else { lastMessage = "❌ Unable to get root view controller for payment" isProcessingPayment = false return } let presentingController = findTopViewController(from: rootViewController) MobilePaymentsSDK.shared.paymentManager.startPayment( paymentParams, promptParameters: promptParams, from: presentingController, delegate: self ) -
The request correctly includes these parameters in the API payload:
-
paymentParams.acceptPartialAuthorization = true is missing in the payload
content-length: 1494
accept-language: en-us
square-version: 2022-12-14
content-type: application/json
accept-encoding: gzip
accept: application/json
user-agent: Mozilla/5.0 (iPhone16,2; CPU iPhone OS 26.1 like Mac OS X; en-us) Version/2.3.0 com.squareup.readersdk/6761001 PointOfSaleSDK/6.76.1{“revenue_association_tags”: “[redacted]”,
“amount_money”: {
“amount”: 4315,
“currency”: “USD”
},
“idempotency_key”: “501D5932-07F3-442D-A0F3-”,
“device_details”: “[redacted]”,
“delay_duration”: “PT0H1M”,
“geo_location”: “[redacted]”,
“peripheral_metadata”: “[redacted]”,
“delay_action”: “COMPLETE”,
“card_present_options”: “[redacted]”,
“source_id”: “[redacted]”,
“autocomplete”: false,
“location_id”: “LGNF7V8G9NBNN”
}
Return
date: Sun, 05 Oct 2025 05:03:52 GMT
content-length: 1855
square-version: 2022-12-14
x-frame-options: DENY
connection: keep-alive
content-type: application/json
strict-transport-security: max-age=31536000
{
“errors”: [
{
“code”: “INSUFFICIENT_FUNDS”,
“detail”: “Authorization error: ‘INSUFFICIENT_FUNDS’”,
“category”: “PAYMENT_METHOD_ERROR”
},
{
“code”: “GIFT_CARD_AVAILABLE_AMOUNT”,
“detail”: “246”,
“category”: “PAYMENT_METHOD_ERROR”
}
],
“payment”: {
“id”: “nbg2OfQtQLAuBTaoOH9tUwycYt9YY”,
“created_at”: “2025-10-05T05:03:51.898Z”,
“updated_at”: “2025-10-05T05:03:51.960Z”,
“amount_money”: {
“amount”: 4315,
“currency”: “USD”
},
“status”: “FAILED”,
“delay_duration”: “PT0H1M”,
“source_type”: “CARD”,
“card_details”: {
“status”: “FAILED”,
“card”: {
“card_brand”: “SQUARE_GIFT_CARD”,
“last_4”: “8304”,
“exp_month”: 12,
“exp_year”: 2099,
“cardholder_name”: “SQUARE GIFT CARD”,
“fingerprint”: “sq-1-NCGw32sN9FWsPTcgoL3Xhs_vsK9eWEHx71ACV_IKVRf7-ocHhm-”,
“card_type”: “DEBIT”,
“prepaid_type”: “PREPAID”,
“bin”: “778273”
},
“entry_method”: “SWIPED”,
“auth_result_code”: “5”,
“errors”: [
{
“code”: “INSUFFICIENT_FUNDS”,
“detail”: “Authorization error: ‘INSUFFICIENT_FUNDS’”,
“category”: “PAYMENT_METHOD_ERROR”
}
],
“device_details”: {
“device_id”: “DEVICE_VENDOR_ID:–4E4C-A273-F8EDC83E132C”,
“device_name”: “iPhone”,
“device_installation_id”: “DEVICE_VENDOR_ID:-9338-4E4C-A273-F8EDC83E132C”
},
“card_payment_timeline”: {
“authorized_at”: “2025-10-05T05:03:51.960Z”
}
},
“location_id”: “”,
“order_id”: “”,
“total_money”: {
“amount”: 4315,
“currency”: “USD”
},
“approved_money”: {
“amount”: 0,
“currency”: “USD”
},
“delay_action”: “COMPLETE”,
“delayed_until”: “2025-10-05T05:04:51.898Z”,
“device_details”: {
“device_id”: “DEVICE_VENDOR_ID:91319BD7-9338–A273-”,
“device_name”: “iPhone”,
“device_installation_id”: “DEVICE_VENDOR_ID:-9338-4E4C-A273-F8EDC83E132C”
},
“application_details”: {
“square_product”: “SQUARE_POS”,
“application_id”: “-”
},
“version_token”: “”
}
}