AddressRequest Class

Contains address request data that is sent to a gateway adapter during a service call.

CommercePayments

Contains information about the payment method’s address. Use this information in authorization, sale, and tokenization requests. The payment gateway adapter uses information in an AddressRequest object to construct a JSON request to send to the payment gateway.

The constructor of this class takes no arguments. For example:

CommercePayments.AddressRequest adr = new CommercePayments.AddressRequest();

The following are constructors for AddressRequest.

Constructs a sample address. This constructor is intended for test usage and throws an exception if used outside of the Apex test context.

global AddressRequest(String street, String city, String state, String country, String postalCode)

  • street:

    Type: String

    Street

    for the payment method’s address.

  • city:

    Type: String

    City

    for the payment method’s address.

  • state:

    Type: String

    State

    for the payment method’s address.

  • country:

    Type: String

    Country

    for the payment method’s address.

  • postalCode:

    Type: String

    Postal code

    for the payment method’s address.

The following are properties for AddressRequest.

  • city

    City of the payment method address.

  • companyName

    Company name of the payment method address.

  • country

    Country for the payment method address.

  • postalCode

    Postal code for the payment method address.

  • state

    State for the payment method address.

  • street

    Street for the payment method address.

City of the payment method address.

global String city {get; set;}

Type: String

Company name of the payment method address.

global String companyName {get; set;}

Type: String

Country for the payment method address.

global String country {get; set;}

Type: String

Postal code for the payment method address.

global String postalCode {get; set;}

Type: String

State for the payment method address.

global String state {get; set;}

Type: String

Street for the payment method address.

global String street {get; set;}

Type: String

The following are methods for AddressRequest.

  • equals(obj)

    Maintains the integrity of lists of type AddressRequest by determining the equality of external objects in a list. This method is dynamic and is based on the equals method in Java.

  • hashCode()

    Maintains the integrity of lists of type AddressRequest.

  • toString()

    Converts a date to a string.

Maintains the integrity of lists of type AddressRequest by determining the equality of external objects in a list. This method is dynamic and is based on the equals method in Java.

global Boolean equals(Object obj)

  • obj:

    Type:

    Object External object whose key is to be validated.

Type: Boolean

Maintains the integrity of lists of type AddressRequest.

global Integer hashCode()

Type: Integer

Converts a date to a string.

global String toString()

Type: String