Groundwire / Online-Payments

online payments managed package
7 stars 3 forks source link

Configuration Instructions

Overview

Groundwire Online Payments is a core package for integrating Salesforce.com with your payment gateway for the purpose of collecting one-time and recurring payments directly through the Salesforce.com user interface or a customizable Salesforce Sites page. This package is the credit card processing engine that connects your Salesforce.com instance with a payment gateway like PayPal or Authorize.Net and hands off your transaction results to a customizable database processing class that exists outside of this managed package. The idea here is that each organization is unique, in terms of how you want your payments processed and recorded in the database, and this package makes no presumptions but allows you to write your own logic and connect it to this credit card engine.

This installation covers:

Skills Required

Accounts and Platform Licenses Required

Installation Instructions

  1. Login to the Groundwire Online Payments managed package instance
  2. Navigate to Setup > App Setup > Create > Packages and click on the Versions tab. Click on the latest Managed Released package and copy the install link to your clipboard.
  3. Logout of all Salesforce instances and paste the install link into your browser. Install for all users.
  4. If your install does not complete right away, you may need to check that the package has been deployed. Go to Setup > App Setup > View Installed Packages and click on Groundwire Online Payments. At the top of the package page will be a Deploy button. If it is grayed out, you're good to go, otherwise you'll need to hit Deploy.

Custom Objects

Groundwire Online Payments includes three new custom objects:

Application Permissions

For each custom profile, you will need to set object and field-level permissions for the objects and custom fields contained within this package. We recommend allowing access only to system administrators and user profiles for people who have top-level access to payment information within the organization. System Administrators have all object permissions enabled by default but to enable additional profiles to manage online payments:

Configuring Payment Processors

You will need credentials to add at least one payment processor (payment gateway) on either Authorize.Net or PayPal before you can use Groundwire Online Payments to collect money. This can be a sandbox or developer account if you are just testing the integration. To add a payment processor:

  1. Select Online Payments from the application drop-down menu on the top right of the screen.
  2. Click on the Payment Processors tab and then the New button.
  3. Enter in your credentials to either PayPal or Authorize.Net. NOTE: The fields API Login Id and Transaction Key are only for Authorize.Net and the fields API Username, API Password, and API Signature are only for PayPal. You may not enter in credentials from more than one processor into the same record, you must create a new Payment Processor record for each of your Payment Processor connections.
  4. If you only have one Payment Processor, or if the processor connection you are entering is your primary payment processor that you want used for all payment pages, be sure to check of the Default Connection checkbox. With some custom coding, you can hardcode a processor connection into your payment pages to indicate that that particular page should not use the default connection but this can only be setup by a consultant/developer.
  5. For Sandbox and Developer accounts, you must indicate that the processor connection is a Sandbox by checking off that box on the Payment Processor record.
  6. NOTE: Once a Payment Processor record is saved, the credentials are encrypted and can only be viewed by users with the profile permission to View Encrypted Data. We recommend having no users with this permission if possible, since these credentials could allow someone to credit money directly from your bank account and present a significant financial security risk. Choose users of this profile wisely.

Configuring Online Payments with Salesforce Sites

  1. First setup your Salesforce.com Site according the the Sites documentation - https://na12.salesforce.com/help/doc/en/salesforce_platform_portal_implementation_guide.pdf
  2. Once your site is setup, you'll need to enable the following Visualforce Pages - gwop.PaymentListenerAuthnet, gwop.PaymentListenerPaypal, gwop.PaymentSiteTemplate, gwop.payment. To enable these Visualforce page, go to each site record in Salesforce by clicking on Setup > App Setup > Develop > Sites and click on the Site Label. On the Site page, in the section called Site Visualforce Pages, click on Edit and locate the pages mentioned above and move them over to the Enabled Visualforce Pages.
  3. Still on the Site record, click the Edit button and change the Active Site Home Page to gwop.payment and the Site Template to gwop.PaymentSiteTemplate and click Save
  4. Optionally, you can edit the assignments for all of the Site error pages to customized Visualforce pages of your choosing. NOTE: there are no custom error pages included in the package, you would need to create these yourself.
  5. Make sure your site is configured with Login = Not Allowed and that the site is Active (a checkbox).
  6. Still from the Site record, click on Public Access Settings. In the section called Field Level Security, under Payment Pages, click the View button and then Edit. Make sure all fields are marked as Visible. Do the same for Payment Notification. DO NOT do this for Payment Processors. Click the Edit button in the Public Access Settings, and scroll down to Standard Object Permissions. For Accounts, Contacts and Opportunities, allow Read and Create. In Custom Object Permissions enable Read, Create, Edit, Delete on Payment Notifications and Payment Pages. Still in the Public Access Settings, click the edit button on Enabled Apex Class Access and enable all classes marked with the prefix gwop.
  7. To test to see if your site works, go to the Site record, copy the URL of the Secure Web Address, paste it into a browser and add payment to the URL. For example - https://gwop-developer-edition.na12.force.com/payment - this should bring up the basic payment page.

Creating Custom Payment Pages (No Custom Fields)

The Payment Pages feature allows administrators to create multiple versions of payment pages that are all based on one basic payment page template. Administrators can create as many versions of the page as they please and each can be customized to have custom text on the header of the payment page, the prologue text before the form, the epilogue text after the form, the thank you header, thank you body text, submit button text, and the linked campaign or item that's being purchased on each page. To create a custom payment page:

  1. Select Online Payments from the application drop-down menu on the top right of the screen.
  2. Click on the Payment Pages tab and then the New button.
  3. Enter in your custom content, amount options, related campaign, item name etc. and click Save.
  4. Brief explanation, the Groundwire Online Payments package alone will do nothing to create opportunities, but if you are configuring this for a Groundwire Base client and have the Groundwire Base Online Payments Extension installed, you can use the Campaign field to relate Opportunities from a particular payment page to a Campaign and Item Name to indicate a Record Type of Opportunities from that Payment Page.
  5. In order to use your custom page you will need to append the page's Salesforce Id to the querystring of the payment page. From the record of the payment page, copy the 15 digit URL that represents the Salesforce id of that record. The final URL will look something like https://MY-SALESFORCE-SITE-URL.COM/payment?pageid=YOUR-PAYMENT-PAGE-ID . To get your site URL, navigate to your Site record and copy the Secure Web Address

Creating Custom Payment Pages (With Custom Fields)

The custom Payment Pages within the Groundwire Online Payments package does not support adding custom fields because you cannot edit Visualforce pages within a managed package. However, the page has been designed with extensibility in mind and an unmanaged version of the same page can be slightly modified to support adding custom fields without needing to extend the payment page's controller.

  1. To add custom fields, the first thing you will need to do is copy the supplied payment Visualforce page. Go To Setup > App Setup > Develop > Pages and click on the page called payment. Copy the page in its entirety to your clipboard.

  2. The next step is to create your own new Visualforce page. Go To Setup > App Setup > Develop > Pages and click on the New button. Choose an appropriate name for your new page and paste the contents of your clipboard into Visualforce Markup area and click Save.

  3. We support adding any type of new custom field except multi-select and lookup. Checkboxes, text fields, long text, date fields, and picklists are all supported.

  4. All new custom fields require two custom attributes on the input, textarea, or select component. The page is styled using Twitter Bootstrap, example markup can be found here: http://twitter.github.com/bootstrap/base-css.html

  5. Checkbox example:

    <div class="control-group">
        <label class="control-label" for="input01">Text input</label>
        <div class="controls">
            <label class="checkbox">
                <input type="checkbox" data-sfobject="Contact" data-sffield="Anonymous__c" class="input-xlarge" id="input01">
                I wish to make this donation anonymously
            </label>
        </div>
    </div>
  6. SelectList (picklist) example:

    <div class="control-group">
        <label class="control-label" for="select01">Select list</label>
        <div class="controls">
            <select data-sfobject="Opportunity" data-sffield="MyPicklist__c" id="select01">
                <option>something</option>
                <option>2</option>
                <option>3</option>
                <option>4</option>
                <option>5</option>
            </select>
        </div>
    </div>
  7. Notice the attributes in the above example-- data-sfobject specifies which object the field is on and data-sffield specifies the API Name of the field. The only objects available for writing to in the Groundwire Base Extension of Online Payments are the Contact, Account, Opportunity, and Payment objects.

  8. You can even use Payment Pages content sections with this custom page with custom fields. In order to use your custom page you will need to append the page's Salesforce Id to the querystring of the payment page. From the record of the payment page, copy the 15 digit URL that represents the Salesforce id of that record. The final URL will look something like https://MY-SALESFORCE-SITE-URL.COM/YOURUNMANAGEDPAGENAME?pageid=YOUR-PAYMENT-PAGE-ID . To get your site URL, navigate to your Site record and copy the Secure Web Address. Be sure to use the Page Name and not the Page Label in the URL of the Visualforce page

  9. Lastly, don't forget to add your new Visualforce page to your Salesforce Site. From your Site record, in the Enabled Visualforce Pages section, click the edit button and move your new page to the Enabled list.

Multi-Currency Support and Configuration

The custom payment pages within the Groundwire Online Payments package supports accepting a single alternative currency, but full multi-currency support is not enabled as of version 2.6 release. Currently, alternate currencies are only supported by Paypal, not Authorize.Net. The use case here would be that if you have a client whose Salesforce is entirely in Great British Pounds and Multi-Currency has not been enabled, you can configure passing all payment information to Paypal in GBP. To do so, the following setup is required:

  1. Setup Paypal Payments Pro and designate GBP as the default home currency in Paypal.
  2. Our Online Payments package is only compatible with single currency organizations, multi-currency in Salesforce is not yet supported but is on the roadmap.
  3. Set the Currency Locale on the Company Information sub-menu to the appropriate country/currency.
  4. Set the Currency Code picklist to the single accepted currency by going to Setup > Create > Objects > Payment Page and click on the Currency Code field name. Delete the unnecessary values leaving only the signle currency that you are willing to accept. Only one is allowed at this time. Go into that picklist value and make it the Default.
  5. Navigate to any existing Payment Pages that may already be setup, add the Currency Code picklist to the page layout and set it to GBP. WARNING: not setting this field will pass payment data in USD, which is the API default currency.
  6. Test a payment, look in Paypal, which should show the breakdown of payment information by currency.

Alternatively, the currency code can be passed in on the URL of the Payment Page as a parameter. By appending ?currency=GBP to the querystring of your payment page URL, you can set the value of the currency on that payment page.

In order to support full multi-currency Salesforce organizations, the following enhancements are needed:

  1. Adding support for currency conversions in the PaymentsToSalesforceGW processing class.
  2. Adding more robust error handling and notifications to Salesforce administrators in the event that 1) the currency code received from Paypal is not enabled in Salesforce 2) Multi-currency is not enabled in Salesforce
  3. Documenting what promises to be a more complex configuration.