Fonteva allows you to configure custom components to support custom payment types within your app. This allows you further flexibility when collecting payment from your customers while giving you an intuitive and visual method for adding these payment types to your application. 

Before You Begin

Two classes must be implemented before building a custom payment type component. These interfaces provide you with the attributes needed to develop your payment type. Use the code snippets below to implement your initial interface. Currently, the values in the snippets include the attributes for PayPal. You can remove those attributes and add the appropriate information for the payment type you're building.

  • CustomePaymentTypeInterface - This provides a base set of attributes to implement custom payment types.

CustomPaymentTypeInterface

<aura:component description="PayPalPaymentType" access="global" implements="c:CustomPaymentTypeInterface">
    <ltng:require styles="{!$Resource.OrderApi__paypal+'/paypal.css'}"/>
    <aura:handler name="init" value="{!this}" action="{!c.doInit}"/>
    <aura:handler event="c:ProcessingChangesEvent" action="{!c.handleProcessingChangesEvent}"/>
    <aura:handler event="Framework:InputFieldValueChangedEvent" action="{!c.handleFieldUpdateEvent}"/>
    <aura:attribute name="payObj" type="Map" default="{}"/>
    <div class="slds-col slds-size--1-of-1 slds-text-align--center slds-m-top--medium">
        <div class="slds-col">
            <form accept-charset="UTF-8" action="https://core.spreedly.com/v1/payment_methods" method="POST">
                <input name="redirect_url" type="hidden" value="{!v.customPaymentTypeObj.callbackUrl}"/>
                <input name="environment_key" type="hidden" value="{!v.customPaymentTypeObj.environmentKey}"/>
                <div class="{!v.customPaymentTypeObj.displaySavePaymentMethod ? 'slds-col slds-grid' :'hidden'}">
                    <div class="slds-col slds-size--1-of-1 slds-align-middle">
                        <Framework:InputFields aura:id="savePaymentMethodCustom" fieldType="boolean" label="{!$Label.c.Save_Payment_Method_Checkbox_Label}" value="{!v.payObj}" fireChangeEvent="true" group="{!v.customPaymentTypeObj.customPaymentId}" labelStyleClasses="fonteva-paypal-label"/>
                    </div>
                </div>
                <span class="hidden">
                   <Framework:Button type="brand" name="payment_method_type" value="{!v.customPaymentTypeObj.gatewayType}" aura:id="payOffsitePaymentBtn" onClickAction="{!c.submitPaypalPayment}"/>
                </span>
            </form>
            <div id="paypal-button-container" aura:id="paypal-button" class="slds-align_absolute-center">
                <button id="{!v.customPaymentTypeObj.customPaymentId+'-paypal-button'}" value="{!v.customPaymentTypeObj.gatewayType}" name="payment_method_type" class="paypal-button paypal-style-pay paypal-branding-true paypal-dual-false paypal-shape-rect additional-payment-btn offsite_pay payment_method" tabindex="0" type="submit" style="min-width: 100px; min-height: 24px;" data-payment-id="{!v.customPaymentTypeObj.customPaymentId}" onclick="{!c.handleSubmit}">
                    <div class="paypal-button-content paypal-color-gold paypal-logo-color-blue">
                        <span class="text" style="visibility: visible;">Pay with </span><img class="logo logo-paypal logo-paypal-gold" src="data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTAwIiBoZWlnaHQ9IjMyIiB2aWV3Qm94PSIwIDAgMTAwIDMyIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHByZXNlcnZlQXNwZWN0UmF0aW89InhNaW5ZTWluIG1lZXQiPgogICAgPHBhdGggZmlsbD0iI2ZmZmZmZiIgZD0iTSA2Ny44OTQgNi44NjIgTCA2MC4wOTQgNi44NjIgQyA1OS41OTQgNi44NjIgNTkuMDk0IDcuMjYyIDU4Ljk5NCA3Ljc2MiBMIDU1Ljg5NCAyNy42NjIgQyA1NS43OTQgMjguMDYyIDU2LjA5NCAyOC4zNjIgNTYuNDk0IDI4LjM2MiBMIDYwLjQ5NCAyOC4zNjIgQyA2MC44OTQgMjguMzYyIDYxLjE5NCAyOC4wNjIgNjEuMTk0IDI3Ljc2MiBMIDYyLjA5NCAyMi4wNjIgQyA2Mi4xOTQgMjEuNTYyIDYyLjU5NCAyMS4xNjIgNjMuMTk0IDIxLjE2MiBMIDY1LjY5NCAyMS4xNjIgQyA3MC43OTQgMjEuMTYyIDczLjc5NCAxOC42NjIgNzQuNTk0IDEzLjc2MiBDIDc0Ljg5NCAxMS42NjIgNzQuNTk0IDkuOTYyIDczLjU5NCA4Ljc2MiBDIDcyLjM5NCA3LjU2MiA3MC40OTQgNi44NjIgNjcuODk0IDYuODYyIFogTSA2OC43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I2LjQxNyBMIDk1LjcgMjYuNDE3IEMgOTYuMiAyNi40MTcgOTYuNyAyNi4wMTcgOTYuOCAyNS41MTcgTCAxMDAgNS42MTcgQyAxMDAuMSA1LjIxNyA5OS44IDQuOTE3IDk5LjQgNC45MTcgTCA5NS44IDQuOTE3IEMgOTUuNCA0LjkxNyA5NS4yIDUuMTE3IDk1LjEgNS40MTcgWiI+PC9wYXRoPgo8L3N2Zz4K" alt="paypal" style="visibility: visible;"/>
                    </div>
                    <div class="paypal-button-tag-content paypal-tagline-color-blue" style="visibility: visible;">
                    </div>
                </button>
            </div>
        </div>
    </div>
</aura:component>
JS
  • PaymentMethodsInterface - This method enables you to add your custom payment type to available payment methods. Access must be set to global.

PaymentMethodsInterface

<aura:component description="PaymentMethodsPaypal" access="global" implements="c:PaymentMethodsInterface">
    <div class="slds-grid slds-grid_vertical slds-p-bottom--medium">
        <div class="slds-grid slds-p-horizontal--large slds-p-bottom_medium">
            <div class="slds-grid slds-grid_vertical slds-col">
                <div class="slds-text-heading_medium">
                    <strong>{!$Label.c.PayPal_Methods}</strong>
                </div>
                <div>
                    {!$Label.c.PayPal_Methods_Description}
                </div>
            </div>
        </div>
        <div class="fonteva-table--container">
            <table class="slds-table slds-table_bordered slds-no-row-hover">
                <thead class="slds-theme_shade">
                <tr class="slds-text-title_caps">
                    <th class="slds-hide_medium"></th>
                    <th style="padding-left: 1.5rem;width: 150px;">
                    </th>
                    <th>
                        {!$Label.c.PayPal_Name}
                    </th>
                    <th style="width: calc(64px + 3rem);" class="slds-show_medium">

                    </th>
                </tr>
                </thead>

                <tbody>
                <aura:iteration items="{!v.paymentMethods}" var="paymentMethod">
                    <tr>
                        <td class="slds-hide_medium">
                            <lightning:buttonIcon iconName="utility:threedots"  alternativeText="More Options" iconClass="slds-button__icon"/>
                            <div class="slds-dropdown slds-dropdown--right">
                                <ul class="dropdown__list" role="menu">
                                    <li class="slds-dropdown__item">
                                        <a href="javascript:void(0);" onclick="{!c.delPayMethod}" data-id="{!paymentMethod.paymentMethodId}" role="menuitem">
                                            {!$Label.c.Manage_Payment_Methods_Delete}
                                        </a>
                                    </li>
                                </ul>
                            </div>
                        </td>
                        <td style="padding-left: 1.5rem;">
                            <img height="19" width="75" src="https://www.paypalobjects.com/webstatic/en_US/i/buttons/PP_logo_h_100x26.png"/>
                        </td>
                        <td>
                            <strong>
                                {!paymentMethod.type}
                            </strong>
                        </td>
                        <td class="slds-show_medium">
                            <lightning:buttonIcon iconName="utility:edit" alternativeText="{!$Label.c.Manage_Payment_Methods_Edit}" class="slds-theme--shade slds-hidden" onclick="{!c.editPayMethod}" value="{!paymentMethod.paymentMethodId}" />
                            <lightning:buttonIcon iconName="utility:delete" alternativeText="{!$Label.c.Manage_Payment_Methods_Delete}" class="slds-theme--shade" onclick="{!c.delPayMethod}"  value="{!paymentMethod.paymentMethodId}"/>
                        </td>
                    </tr>
                </aura:iteration>
                </tbody>
            </table>
        </div>
    </div>
</aura:component>
JS

See here for more information.

Building Your Component


  1. [Click] to access the Setup screen.
  2. [Select] Custom Code from the sidebar on the left side of your window.


  3. A list of items expands. [Select] Custom Metadata Types from that list.
  4.  A list displays. Find Custom Payment Type Template and [click] Manage Records.

  5. The base list of Fonteva provided Components displays. [Click] .
  6. Enter the following information:
    • Label - the name of your custom payment displayed in the UI.
    • Custom Payment Type Template Name - The Salesforce designation. This will populate automatically once the Label value is entered.
    • Apex Class - This allows you to provide a custom Apex method for your payment type. This providing this method provides a base set of objects for each Custom Payment Type you create. For example, adding CustomPaymentTypeTemplate will provide:
      • getPaymentOptions - this will return all the valid payment methods for your specific Custom Payment Type.
      • customizeName and customizeValue - this method overrides the default set of attributes with the correct fields for your custom payment type.
    • Lightning Component for Checkout - This allows you to provide a component to your checkout view.
    • Lightning Component for Payment Method - This adds your custom payment types to the Saved Payment Method component.
  7. If you release protected metadata records in a managed package, [click] the Protected Component select box to restrict access.
  8. If you would like your Sales Order to post your sales orders before receiving payment, [click] the Auto Post Sales Order select box. 
    • For example, some payment types allow the customer to process payment when they receive the item. If this box is checked, the sales order will post immediately to your ledger. If this box is left unchecked, the sales order will post once payment is received.
  9. [Click] the Is Enabled select box to enable your Custom Payment Type.
  10. [Click] the Available for Recurring Payments if you want the purchase to be available for installments (e.g., A monthly membership fee).
  11. To complete the configuration, [click] either  orto finalize registration.