Making a Credit Card Charge
How to Make a Simple Charge
Required Data
The Amount to charge
A screenflow field or data stored in a record.
Tokenized credit card number
Output from the Paytram Credit Card Input custom Flow component
The raw credit card info is entered into a special protected field and traded for a secure token. This token is used to process the transaction through Salesforce.
Named Credential
API Name of the Credential you created with the Configuration steps above. Note: Cardknox has 2 named credentials. Some processes require specifying one of them, and some both.
This will generally be constant, but can vary if you are using Paytram with multiple gateway accounts
External Credential
API Name of the Credential you created with the Configuration steps above.
This will usually be constant on all Flows you create to use with Paytram
Paytram External Credential
API Name of the Credential you created with the Configuration steps above.
This will usually be constant on all Flows you create to use with Paytram
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
Create your Flow
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’)
For Stripe Users: Due to technical limitations, we cannot charge a card without saving it first. See the below sections on saving cards. You can then charge the saved card. If desired, you can delete the saved card each time post transaction.
Start by creating a new Screen Flow. Collect the required data for the charge, either from record data, or screen input fields.
Below is a sample Flow that illustrates getting an Opportunity record (which has an Amount field that can be used as the Amount to Charge), and displaying a screen with user inputs for the credit card number. This screen can also contain additional, optional info like Billing Name and Address, if desired, or a currency field to enter the Amount to Charge manually. The Paytram Charge Card Subflow is mapped with data, and will return a response with a success or error message. If successful, a payment record is created. If not, an error message is displayed on the Flow Screen.
You will need to add two of the custom Paytram components to this Screen Flow. These components are found in the Custom Components section of the Flow components area (the left side of every Flow Screen page).
The Credit Card Input (prefixed with the name of the gateway) component displays the secure credit card, expiration, and CVV fields on the page. These fields will not display on the Screen Flow builder canvas, but will display in debug or when the Flow runs. This component trades the raw credit card information with a secure token, which is used in the next step in the Flow to make the actual charge.
Make sure you are using the correct Credit Card input component. It is called "{Gateway name} Credit Card Input". Do not use the "Secure Credit Card Input" component. That one is used for Paytram free only.
The Paytram Process Card Button component is used in place of the default ‘Next’ or ‘Make Charge’ button so you will likely want to place it on the bottom of the screen. This button is responsible for securely trading the raw credit card information for the secure token, and then navigating to the next step of the Flow.
- Add both components to your Screen Flow. 
- You must configure the Paytram Process Card Button component first. 
- The API Name is your choice. This example uses ‘processbtn’. 
- The Label will be the text of the button. For example, ‘Process Card’, ‘Next’, or ‘Make Charge’ are suitable labels, but you can enter any term appropriate to your use case. 
- Navigate on Click checkbox: This is almost always set to True (GlobalConstant.True). It sets the behavior of the Flow to move to the next Flow Component when clicked. 
- Next, configure the Credit Card Input component. 
- The API Name is your choice. In this example, the API Name is ‘credit_card_fields’. Keep note of the name as you will need it for the next step in your Flow. 
- External Named Credential: Example ‘AcceptBlueExternal’, ‘AuthorizenetExternal’, or 'stripeExternal' (Important: Use the exact API Name, not the Label.) Refer to the Configuration section above if you are unsure about the correct name. 
- Named Credential Paytram: Example ‘AcceptBluePaytram’ or ‘AuthorizenetPaytram’ or 'stripePaytram' (Important: Use the exact API Name, not the Label.) Refer to the Configuration section above if you are unsure about the correct name. 
- Action: The process card button component.‘Action’. The first part of this will be the API name of the Process Card Button component lat you named earlier. For example, ‘processbtn.action’. 
- Label: Credit Card field label (Optional) 
- Using Sandbox: True or False depending on whether you are using a Sandbox. 
- Because you will use the Paytram Process Card Button instead of the standard ‘Next’ or ‘Finish’ button, configure the Flow Footer to hide the standard button. 
- Once you have completed the fields, click Done. 
Transacting the charge
To transact the credit card charge, you will next configure the Charge Card/ACH subflow and map its fields. Note: The actual name of the subflow is prefixed with the gateway name- so you will see something like 'Paytram - Accept Blue - Charge Card/ACH')
- Add the Charge Card/ACH Subflow to your Flow canvas below your Screen Flow element. Map the Output fields as follows: 
- CC_CreditCardToken: This is the output token of the Credit Card Input component you configured in the previous step. In this example, the API name is ‘credit_card_fields’, therefore the path is All Resources > creditcardscreen > credit_card_fields > Credit Card Token. 
- Info_Amount: This maps the value for the amount you want to charge. This may be sourced from a previous step in the screenflow or directly from a record, depending on how you designed the Flow. 
- Info_CardorACHorAUTH: Enter ‘Card’ or ‘ACH’ or ‘AUTH, depending on whether you want to charge a Credit Card, charge an ACH method, or charge (capture) a previously made Credit Card Authorization. To make an AUTH transaction (Authorize) instead of a charge (Capture), see here. 
- Info_NamedCredential: Enter the API name of the Named credential. In this example, ‘AcceptBlue’. 
- The other ‘Info_’ fields are self-explanatory and optional. 
Handling the Response
When the Flow runs and returns a response from the Gateway, it will contain the following Values.
WasError
Boolean
True or False if there was and Error processing the transaction
ErrorMessage
Text
The error message returned from the Gateway
TransactionID
Text
If succesful, the transaction ID will appear here.
GatewayLogRecord
Record
A record created with every call to the gateway (charge, refund, save card, etc), that can be used for auditing and record keeping
Use these values to update or create records according to your workflow needs.
Last updated