Payment Request

If you want to send an email to your customers asking for payment from your own object, you can do so by following the steps below:

1. First follow these instructions to create a “Pay Now” widget in your custom object. Even if you don’t want the widget in Salesforce, you will still need to do these steps (just don’t expose the “Pay Now” button in your page layout).

2. You then need to setup Payment Center to allow online payments.

3. You can then create your email template. It is advisable to create HTML or Visualforce email template so you can embed a link. The link to embed would be something like this:

<your domain name>/fw1__Payment?param1=value1&param2=value2&param3=value3.....

Your domain name can be found in Payment Center Settings:

Screen-Shot-2013-09-12-at-9.04.50-PM

For the parameter/value pairs (i.e.: param1=value1, etc.), use the same pairs you used in step 1 (when creating the “Pay Now” button).

4. Create a custom currency field in your object to hold the requested amount. This will be a placeholder for the amount that you want your customer to pay.

5. Create a button in your object. Choose URL as the Content Source. The URL will take the following form:

/apex/fw1__PaymentRequest? 
requestdAmount={!TEXT(<Amount you want your customers to pay>)}& 
contactId={!<ID of contact whom you want to send email to>}& 
templateName=<Name of your email template>& 
objectName=<Name of your object>& 
requestedAmtFieldName=<Name of your requested amount field>& 
recordId={!<ID of your record>}

Here’s an example:

/apex/fw1__PaymentRequest? 
requestdAmount={!TEXT(Sales_Order__c.Balance_Due__c)}& 
contactId={!Sales_Order__c.ContactId__c}& 
templateName=Send Payment Request& 
objectName=Sales_Order__c& 
requestedAmtFieldName=Requested_Amount__c& 
recordId={!Sales_Order__c.Id}

6. You can then expose your payment request button in your page layout.

7. Lastly, check your object’s sharing setting to make sure that the online payment user (Site user) has read/write access to it. Go to Setup | Security Controls | Sharing Settings. If your object needs to be Private, you can create a sharing rule to allow the Site user read/write access to your object.