ShippingMethod Class

Represents a shipping method listed in payment requests sent in enhanced Messaging channels.

Namespace

RichMessaging

Example

1public with sharing class MessagingShippingMethods {
2    
3    @InvocableMethod
4    public static List<List<RichMessaging.ShippingMethod>> getShippingMethods(){
5        Double amount = 0.25;
6        List<List<RichMessaging.ShippingMethod>> result = new List<List<RichMessaging.ShippingMethod>>();
7        
8        List<RichMessaging.ShippingMethod> options = new List<RichMessaging.ShippingMethod>{
9            new RichMessaging.ShippingMethod('doordash', amount, '1 hour delivery to your door', 'ddash'),
10            new RichMessaging.ShippingMethod('UPS', amount, '2 days delivery', 'UPS')
11        };
12        result.add(options);
13        return result;
14    }
15    
16}

ShippingMethod Constructors

The following are constructors for ShippingMethod.

ShippingMethod(label, amount, detail, identifier)

Creates a new instance of the RichMessaging.ShippingMethod class.

Signature

public ShippingMethod(String label, Double amount, String detail, String identifier)

Parameters

label
Type: String
The label of the shipping method.
amount
Type: Double
The amount of the shipping method.
detail
Type: String
Details about the shipping method.
identifier
Type: String
The identifier of the shipping method.

ShippingMethod()

Creates a new instance of the RichMessaging.ShippingMethod class.

Signature

public ShippingMethod()

ShippingMethod Properties

The following are properties for ShippingMethod.

amount

The amount of the shipping method.

Signature

public Double amount {get; set;}

Property Value

Type: Double

amountValue

The amount value of the shipping method.

Signature

public Double amountValue {get; set;}

Property Value

Type: Double

detail

Details about the shipping method.

Signature

public String detail {get; set;}

Property Value

Type: String

detailValue

The detail value of the shipping method.

Signature

public String detailValue {get; set;}

Property Value

Type: String

identifier

The identifier of the shipping method.

Signature

public String identifier {get; set;}

Property Value

Type: String

identifierValue

The identifier value of the shipping method.

Signature

public String identifierValue {get; set;}

Property Value

Type: String

label

The label of the shipping method.

Signature

public String label {get; set;}

Property Value

Type: String

labelValue

The label value of the shipping method.

Signature

public String labelValue {get; set;}

Property Value

Type: String

shippingMethodType

The shipping method type. Read only.

Signature

public String shippingMethodType {get; set;}

Property Value

Type: String