Charging Previously Saved Cards
The screenshots and names of Components and Fields were taken on an installation that was using the ‘Accept Blue’ gateway. Other gateways screens and components will be similar but a bit different, and the names of the fields will be specific to the gateway you are configuring for (eg. ‘Authorize.net Credit Card Fields Component’ instead of ‘Accept Blue Credit Card Fields Component’)
Required Data
Named Credential
API Name of the Credential you created with the Configuration steps above.
This will generally be constant, but can vary if you are using Paytram with multiple gateway accounts
The Amount to charge
A screenflow field or data stored in a record.
Customer Profile ID
Payment Method record
Customer Payment ID
Payment Method record
Logical next steps to do in your Screenflow
Create a record in Salesforce that represents the charge that was made (e.g., a Payment record)
Show the error message response
Charging a saved payment method is somewhat similar to charging a new card. Instead of showing credit card inputs on a form to collect details of the card, you will present users with a list of Payment Records related to the Contact or Account you wish to charge. Once a Payment Record is selected in the Flow, its field data, including the Customer Profile ID and Payment Profile ID will be available to pass to the Charge Payment Method Subflow.
- Use a Get Records element to retrieve the Payment Methods that are related to the Contact you wish to charge, for the gateway you want to charge to (if using multiple gateways or gateway accounts). 
- Display the retrieved payment methods in a picklist, datatable, or any other component that allows the user to view and select the desired payment method. Store the values of the selected payment method. 
- Add the Charge Payment Method Subflow to your Flow. 
- Map the following fields: 
- Info_Amount: The amount to charge. 
- Info_CustomerProfileId: The Customer Profile Id from the selected payment method. 
- Info_PaymentProfileId: The Payment Profile Id of the selected payment method. 
- Info_NamedCredential: ‘AcceptBlue’. 
- Info_Description and info_Invoice: optional 
 
- Check the Manually Assign Variables checkbox. Then create: 
- Text variables for the Error Message and Transaction ID responses 
- A record variable for the GatewayLogRecord that is created when the charge card transaction is made. 
- A boolean variable for the WasError response. This is a true/false value that tells you if the transaction was successful or not. 
 
Use a Decision element to determine whether to display the error message (if applicable) or create a payment record in Salesforce if the payment was successful.
Last updated