---
schema_version: "1"
id: 8d31839e081871a12a1408b003b7e4acbdb771500f44e37022bb2be974140272
title: setGatewayAuthCode(gatewayAuthCode)
collection: legacydeveloper
version: current
locale: en-us
portal_url: https://docs.salesforce.com/legacydeveloper/current/en-us/apexref/apex_commercepayments_PostAuthorizationResponse_setGatewayAuthCode.md
canonical_url: https://developer.salesforce.com/docs/atlas.en-us.apexref.meta/apexref/apex_commercepayments_PostAuthorizationResponse_setGatewayAuthCode.htm
source_site: developer.salesforce.com
content_type: documentation
content_hash: 19405ff7ed656b746fca43a52167882837b80e7dce75a3da14277ede46b99fe5
description: Sets the authorization code that the gateway returned. Maximum length of 64 characters.
---
# setGatewayAuthCode(gatewayAuthCode)

Sets the authorization code that the gateway returned. Maximum length of 64 characters.

## Signature

global void setGatewayAuthCode(String gatewayAuthCode)

## Parameters

- **gatewayAuthCode**:
    
    Type: [String](https://developer.salesforce.com/docs/atlas.en-us.apexref.meta/apexref/apex_methods_system_string.htm#apex_methods_system_string "Contains methods for the String primitive data type.")
    
    The authorization code returned by the gateway.

## Return Value

Type: void