AppFrontier

PayPal Salesforce Integration Chargent

Integrating PayPal Payflow Pro and Salesforce using Chargent


Connect PayPal Payflow Pro and Salesforce with Chargent,

the leading payments app on the Salesforce AppExchange. See all Payflow transactions, manage refunds, send payment links and more, all inside Salesforce.

Not yet a Chargent customer?
Contact us for a no-obligation 30 day trial, and see for yourself!



Overview


This guide shows you how you can easily connect the PayPal Payflow Pro payment gateway to Salesforce, in order to charge credit cards directly from Salesforce, either via embedded buttons or scheduled batches for recurring payments.

Payflow is PayPal's secure, open payment gateway. With Chargent's ability to send payments directly from Salesforce to Payflow using an API, you can have total control over the payment process. Payflow allows merchants to choose any Internet Merchant Account to accept debit or credit card payments and connect to any major processor. You can also select PayPal as your credit card processor (see PayPal Payments Pro).

Note: This is primarily a synchronous integration, meaning that transactions sent to PayPal Payflow Pro from Salesforce will receive the PayPal Payflow Pro responses (approved / declined with related information) and store them in Salesforce. Transactions that are not initiated from Salesforce (if any) will not be synced from PayPal Payflow Pro to Salesforce.


Installation and Configuration of Chargent


  1. Install both Chargent Base and Chargent Transactions into your Salesforce org.

  2. Configure Chargent according to the step by step Quick Start Guide.

  3. For Chargent versions prior to 5.57 you may need to activate the Remote Site Settings in Salesforce if they aren’t already active for PayPal Payflow Pro.

    • Click the gear icon on the top right and select Settings
    • Under Security select Remote Site Settings
    • Locate PayflowProAPI and click edit
    • Check the Active box
    • Click Save
    • Do the same for PayflowProTestAPI




Connecting PayPal Payflow Pro & Salesforce using the Chargent Setup Wizard

  1. Click on the App Launcher on the top left side in Salesforce.

  2. app

  3. Select Chargent as the App

  4. Select the Chargent Settings Tab

  5. Choose Chargent Setup Wizard

  6. Do you have a Payment Gateway account - Select Yes

  7. Select Payflow Pro (PayPal) as your Payment gateway

  8. Select Test Transactions for testing or Live Transactions if you are looking to process real time payments.

  9. Follow the prompts to configure your gateway.

You will need the following information:

  • Add your credentials based on your Sandbox or Live Payflow Pro account.

    • Merchant Login that you login to Payflow Pro with
    • Password from Payflow Pro
    • Partner ID from Payflow Pro
    • (for the test account it will be "PayPal", but for production if you signed up through a Bank rather than directly with PayPal it may be different)

  • Will you be using tokenization? (recommended)

  • What currency will you be using? (USD, CAD, etc..)

  • What payment methods will you be accepting?

  • Credit cards and/or ACH (electronic check)

    • What Credit Card types will you be accepting? (Visa, Mastercard, etc…)

  • Payment Console Setup (Premium feature for Platform Edition)

    • Show Charge Button
    • Show / Create Update Token Button
    • Show Authorize Button



Connecting PayPal Payflow Pro & Salesforce (Chargent versions prior to v5.40)


  1. Click on the AppLauncher on the top left side in Salesforce.

  2. app

  3. In the Search for apps or items box, Search for Gateways and select

  4. gateways

  5. Click New and select Payflow Pro (PayPal) as the Gateway Type

  6. Map the following fields in Chargent with your credentials from Payflow Pro:

    • Chargent Merchant Reference = Merchant Login (from Payflow Pro)

    • Chargent Merchant Security Key = Password (from Payflow Pro)

    • Chargent Merchant Reference = Partner ID from Payflow Pro (for the test account it will be "PayPal", but for production if you signed up through a Bank rather than directly with PayPal it may be different)

  7. Setup the following Gateway fields

    • Check the Active box - To make the Gateway active

    • Use Tokenization - If you are planning on using Payflow tokenization

    • Available Card Types - Select the cards you will be accepting (this is based on your gateway settings and what card types they can process - Visa, Mastercard, American Express, etc..)

    • Check the PayFlow User Recurring Profiles checkbox in the Chargent Gateway record if you wish to use tokens longer than 12 months (You may need to add this field to your Page Layout if you are on v5.40 and don’t see it)

    • Available Payment Methods - Will you be accepting just Credit Cards or ACH (also known as electronic check, e-check, or direct debit)

    • Available Currencies - What currencies will you accept (this is based on your payment gateway and the currencies they accept payment in.

    • Credit Card / Bank Account Data Handling - This lets Chargent know when to clear the information in Salesforce. You have 4 options.

      • Never Clear
      • Clear After Successful Charge
      • Clear After All Transactions
      • Clear When Token is Present (recommended)

      • new gateway

        card type

      When using Payment Requests or Payment Console the following should also be set. Please note these features come with Sites and Platform edition & require activation in your Production Org.

    • Available PR Transaction Types

      • Charge Full Amount - Charges the credit card immediately

      • Authorize Full Amount - This option won’t charge the card but only holds the funds available until you charge the card.

      • Authorize Minimum Amount - This option won’t charge the card but only holds the minimum amount that your gateway will allow. You will need to charge the correct amount in order to capture the transaction

      • pr transaction

      • Show Charge Button

      • Show Authorize Button

      • advance



Configure your PayPal Fraud Settings


Even though you have set up a test account, PayPal uses the same security as their regular accounts, to provide as close to the live experience as possible. So you may need to adjust your Fraud Settings or you will sometimes receive an error with message "Under Review by Fraud Service" when submitting test transactions.

  • Go to Service Settings > Fraud Protection > Test Setup > Edit Standard Filters

  • Change the settings as desired for testing and click Deploy

  • Go to Account Administration > Transaction Settings to set a maximum amount per transaction as well.

  • manager

Note: You may also need to whitelist your IP address for testing.

  • Go to Service Settings
  • Fraud Protection
  • Manage Standard Filter Lists
  • Edit
  • Enter IP Address in the box
  • Click Add
  • Click Save

  • modify



Testing Credit Cards using Payflow Pro from Salesforce

  • Create a new Chargent Order record and enter sample data to run a test transaction.

    • Account Name
    • Charge Amount ($0-$1000 recommended, > $2001 will be declined in tests)
    • Check the Manual Charge box
    • Billing Information:

      • Billing First Name
      • Billing Last Name
      • Billing Address
      • Billing City
      • Billing State / Province
      • Billing Zip Code / Postal Code
      • Billing Country
      • Billing Email Address (optional but allows a receipt to be sent on approved transactions).
      • Credit Card Number

      • Payflow Pro’s suggested test credit card numbers

        • American Express 378282246310005
        • American Express 371449635398431
        • American Express Corporate 378734493671000
        • Diners Club 30569309025904
        • Discover 6011111111111117
        • Discover 6011000990139424
        • JCB 3530111333300000
        • JCB 3566002020360505
        • MasterCard 2221000000000009
        • MasterCard 2223000048400011
        • MasterCard 2223016768739313
        • MasterCard 5555555555554444
        • MasterCard 5105105105105100
        • Visa 4111111111111111
        • Visa 4012888888881881
        • Visa 4222222222222

      • Expiration Date Month
      • Expiration Date Year

      • You can use any expiration date in the future in the format MM/YY

Gateway field should be populated if you have more than one active gateway record in Chargent (which you probably will not at this point). With 2+ active gateways you will need to specify which gateway one to use.

  • Click Save

  • Click the "Charge" button in your newly created Salesforce order record.

  • Enter the CSC (Card Security Code). This will be 3 digits for Visa, Mastercard, Discover or 4 digits for American Express.

  • charge

  • You will see a popup with an Approved message.

  • back record

When you click Back to Record button on the popup dialog box, the Salesforce page will refresh and you can then click on Related to see the Transactions with the date, type, and amount of the transaction.

chargent order

Testing ACH / Electronic Check using Payflow Pro from Salesforce

Please make sure you have ACH enabled with PayPal Payflow Pro first, otherwise you will run into errors. You also need to make sure you have tokenization disabled as tokenization doesn’t work for ACH using Payflow Pro.

  • Routing Number: 111111118
  • Account Number: 1111111111

electronic

  • Create a new Chargent Order record and enter sample data to run a test transaction.

    • Account
    • Charge Amount
    • Manual Charge box should be checked
    • Billing Address
    • Billing City
    • Billing State / Province
    • Billing Zip Code / Postal Code
    • Bank Account Type indicate checking or savings
    • Bank Routing Number = 111111118
    • Bank Account Number = 1111111111
    • Bank Account Name = Name of the person who holds the bank account.
    • Bank Name = Name of the institution (Wells Fargo, Bank of America, Citibank, etc…)
    • Gateway If you have more than one Active gateway record in Chargent (which you probably will not at this point), you will need to specify which gateway one to use.

  • Click the Charge button and you will see a popup with an Approved message.

  • back

When you click Back to Record button on the popup dialog box, the Salesforce page will refresh and you can then click on Related to see the Transactions with the date, type, and amount of the transaction.

ORD

Test transactions are simulated and do not incur any fees or have any money change hands. When you check the Test Endpoint box on the Gateway record in your Salesforce Production Org, Chargent sends your transactions to a test server. If you are in your Salesforce Sandbox it will automatically send the transaction to your test environment with your gateway.

To view the Credit Card Processor that you have selected for testing, see the PayPal Manager.

There are methods for testing the Card Security Code (CSC) and Address Verification Settings (AVS). For more details, please see the PayPal Payflow Gateway documentation.

  • For CSC approval, use a value 000-300

  • For AVS approval, use a zipcode < 50000 and first 3 digits of the street number < 333

If you receive an Error and the test transaction is not approved, you may need to adjust the Fraud settings in the PayPal Manager under Service Settings > Fraud Manager > Test Settings

  • You may need to disable AVS matching to get approved test transactions

  • Sign into the PayPal Manager interface to see the test transactions under Search Transactions - (Use the First Name to search for the transaction).

  • search

Your connection between Salesforce and PayPal Payflow Pro is now set up and working. Let's proceed to the final tests before the system goes live.


Sending Live Transactions from a Salesforce Sandbox


When Chargent is installed in a Salesforce Sandbox, transactions are always sent to the payment gateway's test / sandbox / development environment, regardless of whether Chargent's Test Endpoint checkbox is checked. This is done as a security precaution, to prevent real transactions from being accidentally sent from a Salesforce Sandbox.

When Chargent is installed in a production or developer Salesforce org, the Test Endpoint checkbox on the Gateway record will select between sending to the payment gateway's live and test environments. (There are a few exceptions, such as Stripe, which has a single endpoint to send transactions to, and different credentials for live versus test transactions).

If you wish to send live transactions from a Salesforce Sandbox, as a final step in testing, simply use Chargent's Endpoint Override field on the Gateway record, and enter the production endpoint of your chosen gateway there.

Here is the production endpoint URL for Chargent's integration with PayFlow Pro:

  • https://payflowpro.paypal.com

Note that the full endpoint URL must be entered in the Endpoint Override field, and the domain must be present in the Remote Site Settings (for standard Chargent integrations it should be already present).


Going into Production

There are many options for additional customization of how Chargent works within Salesforce beyond the basic setup described above. Once you have configured Chargent to your satisfaction, and have completely set up and tested any integration or automation with your other business processes, it is time to move into production.

Your Payflow account and associated services can have either a Test or a Live status

Test: All transaction information is sent to test servers at PayPal. You should run transaction or configure settings in Test status to get comfortable with the services. No money trades hands in test transactions. For services, when you purchase a service, it is in Test status. Configure the service as per your business needs when it is in Test status.

Live: All transactions that you submit are sent to the financial institutions for processing and real money is transferred. For your services, the settings that you configured when in Test status go into effect, and impact your transactions accordingly.

Once you have completed your testing, you can activate your Payflow account by clicking on the Activate Your Account button which is located under the Your Account Status section of the PayPal Manager Home page. This will allow you to process transactions using real currency. Active accounts perform Live transactions.

account

Live versus Test Mode

When you log on to PayPal Manager you will be notified which mode your account is in.

When your account is active and Payflow is in Live Status, you still have the option to troubleshoot problems by submitting test transactions. Just check the Test Endpoint button on the Chargent Gateway record to send a transaction to the test server, and use a test credit card account number.

Because your Payflow account will now have a history of both Test and Live transactions, PayPal Manager allows you to specify which type of transaction to view or perform. For active accounts, the Transaction Mode field appears on task pages to enable you to specify either Test or Live transactions.

Once Payflow Status is Live, you may wish to run some additional Test transactions

  • Just leave the Test Endpoint checkbox in the gateway checked

  • Use the Test Credit Card Numbers and records in the Testing Credit Cards section above.

If your test transactions in both Test and Live Status were successful, you are ready to run Live transactions with PayPal's Payflow Pro and Salesforce.

  • Uncheck the Test Endpoint checkbox in your Salesforce Gateway record

  • Check to make sure the Transaction Process Mode in the PayPal Manager is set to LIVE

  • You can now run live transactions using valid credit card numbers

    • If you wish to test some live transactions with your own credit card, you can void them immediately after, to prevent the transactions from settling. Just go to the transaction record in Salesforce and click the Void button.

    • If you do run live transactions as a test, it is recommended to make them very low amounts to minimize any impact, in the event you forget to void them.

    • For Visa live transaction tests, you can submit $0.00 transactions


transaction


Tokenization

Tokenization with PayPal's Payflow Pro gateway operates differently than other payment gateway integrations in Chargent. Payflow Pro uses both Reference Transaction tokens and Recurring Billing Profile IDs.

Reference Transaction tokens expire in 12 months and are simply the previous transaction ID which can be used to submit a new transaction. The token is submitted instead of sensitive cardholder data, PayFlow Pro will draw all necessary payment data from previous transaction.

Recurring Payment Profile’s don’t expire. Generally, that is more reliable way to process recurring charges against the user’s payment data, however it doesn’t support Authorization transaction type. In case Recurring Payment Profiles are enabled, the Reference Transaction token will still be used to submit Authorization transactions.

  • Chargent Token field = PayPal Reference Transaction

  • Chargent Customer Token field = PayPal Recurring Profile ID

Payflow Use Recurring Profiles

For versions prior to 5.40, PayPal Payflow Pro requires you to have the Recurring Billing service enabled on their side in order to have tokenization enabled in Chargent.

New in Chargent 5.40 is the "PayFlow Use Recurring Profiles" setting on the Gateway record. If this field is checked, both Reference Transactions and Recurring Profiles will be created and used by Chargent for different situations.

Chargent creates two kinds of tokens with PayPal, to ensure that future transactions can work without any issues around expiration. This new field in the Gateway settings, “Payflow Use Recurring Profiles”, when enabled will do the following:

  • Chargent establishes a Recurring Profile with PayPal and stores it in the Customer Token field, using it for any future transactions. Recurring charges will still be handled by Chargent. The Recurring Profile is simply used to create a perpetual token, not to make any recurring charges.

  • Authorizations and Charge Authorized calls will use the Reference Transaction, stored in the Token field, since these transaction types are not supported by PayPal's Recurring Profiles. Charge transactions will use the Recurring Profile, unless this setting is disabled, in which case it will use the Reference Transaction. Note that Reference Transactions expire in 12 months, so the use of Recurring Profiles should be enabled for annual billing.

  • ​If a Reference Token exists then a new Recurring Profile will be created from Reference Token, no CC data will be required (unless Reference Token is expired)

If the “Payflow Use Recurring Profiles” field is unchecked, the Recurring Token will never be used, even if the field has been populated.


To set up reference transactions / Tokenization in Salesforce:

In PayPal Manager Reference Transactions are disabled by default.

  • Go to Account Administration > Transaction Settings to enable them

settings

In Salesforce

  • Check the Use Tokenization checkbox in the Chargent Gateway record you have set up for Payflow Pro

  • Check the PayFlow Use Recurring Profiles checkbox in the Chargent Gateway record if you wish to use tokens longer than 12 months (You may need to add this field to your Page Layout if you are on v5.40 and don’t see it)

  • Set the Credit Card Handling field (unless you are using Payment Console)

    • Never Clear: Chargent will not remove any card data automatically.

    • Clear After Successful Charge: Chargent will clear the credit card number, expiration dates and card security code only after a successful charge is run.

    • Clear After All Transactions: The credit card number, expiration date and card security code will be erased after any transaction (Charge, Void, Refund)

    • Clear When Token Present (Recommended): Only when a token is present in the token field, will the credit card number, expiration date and card security code be cleared.

When your first successful charge goes through, the Credit Card Number field value will be deleted, and a token will be stored for future transactions (or if you are using Chargent's Payment Console feature, the card number was never stored during the generation of the token)

After a successful transaction, the Reference Transaction will be stored in the Token field. PayPal's Profile ID will be stored in the Customer Token field

Notes on Payflow Reference Transactions from Salesforce

  • The token returned in the original transaction is valid for use in reference transactions for 12 months.

    • Charge and authorization transactions can use a reference transaction as a source of transaction data. Payflow looks up the reference transaction and copies its transaction data into the new sale (charge) or authorization.

    • Fraud Protection Service filters do not screen reference transactions.

    • The Billing Name and Address, and Card Expiration Date are copied from the reference transaction into the new charge or authorization transaction (if they exist in the original transaction). If you provide a value for any of these parameters when submitting the new transaction, then the new value is used.

    • Reference transactions can be used for recurring billing, or to capture additional funds as part of a transaction (for example, capturing an upgrade charge that comes after an initial transaction).


Salesforce to PayPal Field Mapping

Here are a few relevant fields and their mappings between the Chargent software in Salesforce and the PayPal Payflow Pro system.

Salesforce Direction PayPal
Gateway ID < Transaction ID
Authorization < Authorization Code
Invoice Number > Supplier Reference #
Description > Comment 1
Salesforce record ID (of Chargent Order, Opportunity, or Case) > Customer Code

Congratulations! You have successfully integrated Salesforce and PayPal Payflow Pro, using the Chargent Payment Processing for Salesforce software. You can now process one-time or recurring credit card payments through PayPal Payflow Pro directly from Salesforce.

If you have any questions or need assistance, please contact us