ccrz.ccApiStoredPayment.fetch
Executes a SOQL query of stored payment records, and returns a list of records that
match you query.
Compatibility
This reference applies to:
Release | Managed Package Version | API Version |
---|---|---|
B2B Commerce for Visualforce Winter ’21 | 4.13 | 12 |
B2B Commerce for Visualforce Spring ’20 | 4.12 | 11 |
B2B Commerce for Visualforce Summer ’19 | 4.11 | 10 |
B2B Commerce for Visualforce Spring ’19 | 4.10 | 9 |
B2B Commerce for Visualforce Summer ’18 | 4.9 | 8 |
Signature
global static Map<String, Object> fetch(Map<String, Object>)
Service Layer Classes
- Data Service Provider
- ccrz.ccServiceStoredPayment
Inputs (Required)
Map<String, Object> that must include the following required keys:
- ccrz.ccApi.API_VERSION
- The version of the B2B Commerce for Visualforce API to reference for the method call. We recommend that you use the ccrz.ccApi.CURRENT_VERSION constant whenever possible, and only reference a specific version for compatibility if necessary.
Inputs (Optional)
The input map can also include the following keys:
- ccrz.ccApi.API_SIZING
- Map<String, Object> that specifies options for how the method returns data.
- ccrz.ccApiStoredPayment.ACCOUNTTYPES
- List<String> of specific ccrz__AccountType__c values on ccrz__E_StoredPayment__c records to query, such as purchase order (PO), credit card, and so on. For more information about payment types, see https://help.salesforce.com/articleView?id=b2b_commerce_payment_types.htm.
- ccrz.ccApiStoredPayment.BYASC
- Boolean
Value Usage true Sort the returned stored payment records in ascending order. false (default) Sort the returned stored payment records in descending order. - ccrz.ccApiStoredPayment.BYUSER
- String that specifies the Salesforce ID of a user. This method returns only the ccrz__E_StoredPayment__c records where the ccrz__User__c field references this user ID.
- ccrz.ccApiStoredPayment.EFFACT
- String that specifies the Salesforce ID of an effective account for filtering the query.
- ccrz.ccApiStoredPayment.ID
- String that specifies the Salesforce ID of the stored payment record to query.
- ccrz.ccApiStoredPayment.IDS
- Set<String> that specifies the Salesforce IDs of the stored payment records to query.
- ccrz.ccApiStoredPayment.ISENABLED
- Boolean
Value Usage true Return only stored payment records where the ccrz__Enabled__c field is true. false (default) Ignore the value of the ccrz__Enabled__c field. - ccrz.ccApiStoredPayment.ISREADONLY
- Boolean
Value Usage true Return only stored payment records where the ccrz__ReadOnly__c field is true. false (default) Ignore the value of the ccrz__ReadOnly__c field. - ccrz.ccApiStoredPayment.STOREFRONT
- String that specifies the name of a storefront for filtering the query.
Outputs
Map<String, Object> that can include the following keys:
- ccrz.ccApi.API_VERSION
- Integer that indicates which API version was used for the query.
- ccrz.ccApi.SUCCESS
- Boolean
Value Usage true The call completed. false The call encountered errors. - ccrz.ccApiStoredPayment.STOREDPAYMENTLIST
- List<Map<String, Object>>, where each Map<String, Object> represents a ccrz__E_StoredPayment__c record.
- ccrz.ccApiSubscription.SUBSCRIPTIONS
- List<Map<String, Object>>, where each Map<String, Object> represents a ccrz__E_Subscription__c record associated with a returned ccrz__E_StoredPayment__c record.
Example
Fetch stored payment records by ID, and capture the first result's method of payment.
Map<String, Object> storedPaymentQuery = new Map<String, Object>{
ccrz.ccApi.API_VERSION => ccrz.ccApi.CURRENT_VERSION,
ccrz.ccApiStoredPayment.IDS => new Set<String>{'stored_payment_ID_1', 'stored_payment_ID_2'}
};
try {
Map<String, Object> storedPaymentResults = ccrz.ccApiStoredPayment.fetch(storedPaymentQuery);
if (storedPaymentResults.get(ccrz.ccApiStoredPayment.STOREDPAYMENTLIST) != null) {
List<Map<String, Object>> outputPaymentsList = (List<Map<String, Object>>) storedPaymentResults.get(ccrz.ccApiStoredPayment.STOREDPAYMENTLIST);
String paymentTypes = (String) outputPaymentsList[0].get('accountType');
}
} catch (Exception e) {
// Error handling...
}