anchor.diff:  
   A few pointers for implementing these methods:
   
  -* Almost all the methods accept parameters like `kbAccountId`, `kbPaymentId`, `kbTransactionId`, etc. which are self-explanatory. These may or may not be used by your plugin code. But you may need some of these values to populate the `PaymentTransactionInfoPlugin` object which is returned by most of the methods (Refer to the <<PaymentTransactionInfoPlugin, "PaymentTransactionInfoPlugin">> section).
  -
  -* All the methods accept `Iterable<PluginProperty> properties` as a parameter. These can be used to pass arbitrary data to the plugin method as explained in the <<plugin_property_notes, "Plugin Property Notes">> section. 
  +* Almost all the methods accept parameters like `kbAccountId`, `kbPaymentId`, `kbTransactionId`, etc., which are self-explanatory. These may or may not be used by your plugin code. But you may need some of these values to populate the `PaymentTransactionInfoPlugin` object that is returned by most of the methods (refer to the <<PaymentTransactionInfoPlugin, "PaymentTransactionInfoPlugin">> section).
  +
  +* All the methods accept `Iterable<PluginProperty> properties` as a parameter. These can be used to pass arbitrary data to the plugin method as explained in the <<plugin_property_notes, Plugin Property Notes>> section.  
   
   * All the methods listed in the `PaymentPluginApi` also accept as parameter either a `TenantContext` or a `CallContext`.  Read only operations (operations which retrieve some data from Kill Bill) like the `getPaymentInfo` accept a `TenantContext`. Read/write operations like `authorizePayment` accept a `CallContext`. Both these values can be used for auditing purposes. 
   
   * It is quite possible that your plugin might not support some of the operations listed above. In such a case, the plugin can do one of the following:
   
   ** Return an *empty list* when the return type is a `List`.
  -** Return a transaction with status *CANCELED* if the return type is a `PaymentTransactionInfoPlugin` .
  +** Return a transaction with status *CANCELED* if the return type is a `PaymentTransactionInfoPlugin`.
   ** Return empty objects otherwise.
   
   [[PaymentTransactionInfoPlugin]]
   == PaymentTransactionInfoPlugin 
   
  -Most of the methods in the https://github.com/killbill/killbill-plugin-api/blob/master/payment/src/main/java/org/killbill/billing/payment/plugin/api/PaymentPluginApi.java[_PaymentPluginApi_] interface return a https://github.com/killbill/killbill-api/blob/4ae1c343a593de937415e21feecb9f5405037fa3/src/main/java/org/killbill/billing/payment/plugin/api/PaymentTransactionInfoPlugin.java[_PaymentTransactionInfoPlugin_] object. Again, the https://github.com/killbill/killbill-plugin-framework-java[_Kill Bill Plugin framework_] includes a class called https://github.com/killbill/killbill-plugin-framework-java/blob/46d94fbeb1cf089aa04e62cfecf751ca47032023/src/main/java/org/killbill/billing/plugin/api/payment/PluginPaymentTransactionInfoPlugin.java[ _PluginPaymentTransactionInfoPlugin_] which implements the `PaymentTransactionInfoPlugin` interface. Thus, if you use the framework, you can simply create a class that extends `PluginPaymentTransactionInfoPlugin` and have the plugin methods return an object of this class.
  -
  -The `PaymentTransactionInfoPlugin` interface has the following methods (Your plugin code needs to populate this information in the `PaymentTransactionInfoPlugin` object):
  +Most of the methods in the https://github.com/killbill/killbill-plugin-api/blob/master/payment/src/main/java/org/killbill/billing/payment/plugin/api/PaymentPluginApi.java[`PaymentPluginApi`] interface return a https://github.com/killbill/killbill-api/blob/4ae1c343a593de937415e21feecb9f5405037fa3/src/main/java/org/killbill/billing/payment/plugin/api/PaymentTransactionInfoPlugin.java[`PaymentTransactionInfoPlugin`] object. Again, the https://github.com/killbill/killbill-plugin-framework-java[Kill Bill Plugin framework] includes a class called https://github.com/killbill/killbill-plugin-framework-java/blob/46d94fbeb1cf089aa04e62cfecf751ca47032023/src/main/java/org/killbill/billing/plugin/api/payment/PluginPaymentTransactionInfoPlugin.java[ `PluginPaymentTransactionInfoPlugin`], which implements the `PaymentTransactionInfoPlugin` interface. Thus, if you use the framework, you can simply create a class that extends `PluginPaymentTransactionInfoPlugin` and have the plugin methods return an object of this class.
  +
  +The `PaymentTransactionInfoPlugin` interface has the following methods. Thus, your plugin code needs to populate this information in the `PaymentTransactionInfoPlugin` object:
   
   |===
   |*Method Name* | *Method Description*
  
positive.code: 
  * Finally, the *mandateId* is stored in the Kill Bill database. Normally, each plugin has its own plugin specific tables. However, since we are not creating a full-fledged GoCardless plugin, we are storing the *mandateId* in the *custom_fields* table.  The  *custom_fields* table can be used to store arbitrary key/value pairs in the Kill Bill database.
  
  * In case an error occurs in any of the steps, the code throws a https://github.com/killbill/killbill-plugin-api/blob/d9eca5af0e37541069b1c608f95e100dbe13b301/payment/src/main/java/org/killbill/billing/payment/plugin/api/PaymentPluginApiException.java[_PaymentPluginApiException_].
  
  [[purchase_payment]]
  ==== Step 6 - Implementing GoCardlessPaymentPluginApi#purchasePayment
  
  The `purchasePayment` method is used to charge a customer against a payment method. It is invoked when:
  
  * An automatic payment is triggered by Kill Bill against an https://docs.killbill.io/latest/Kill-Bill-Glossary.html#invoice[_invoice_].
  * A https://killbill.github.io/slate/#account-trigger-a-payment-authorization-purchase-or-credit[_direct payment api_] is invoked.
  
  In the case of Gocardless, it is used to trigger payments against a *mandateId*. Thus, it is implemented as follows (See https://github.com/killbill/killbill-gocardless-example-plugin/blob/9522498ecde5849c940574c598ceb5ce088d32a7/src/main/java/org/killbill/billing/plugin/gocardless/GoCardlessPaymentPluginApi.java#L94[_GoCardlessPaymentPluginApi#purchasePayment_]):
  
  [source,java,linenums]
  ----
  
negative.code: [[gocardless_activator]]
  ==== Step 9 - Creating GoCardlessActivator
  
  All plugins require an activator class that starts the plugin. Let us take a look at the https://github.com/killbill/killbill-gocardless-example-plugin/blob/9522498ecde5849c940574c598ceb5ce088d32a7/src/main/java/org/killbill/billing/plugin/gocardless/GoCardlessActivator.java[`GoCardlessActivator`] class:
  
  [source,java,linenums]
  ----
  