anchor.diff:  
   ==== Step 5 - Implementing GoCardlessPaymentPluginApi#addPaymentMethod
   
  -The `addPaymentMethod` method is typically used to add a payment method in Kill Bill corresponding to a customer/account. This tutorial uses it to *complete* the *redirect flow*. 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#L223[_GoCardlessPaymentPluginApi#addPaymentMethod_]):
  +The `addPaymentMethod` method is typically used to add a https://docs.killbill.io/latest/Kill-Bill-Glossary.html#payment_method[_payment method_] in Kill Bill corresponding to a https://docs.killbill.io/latest/Kill-Bill-Glossary.html#account[_customer/account_]. Most plugins use this method to create the payment method in the gateway and store payment method specific data in the plugin tables). This tutorial uses it to *complete* the *redirect flow*. 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#L223[_GoCardlessPaymentPluginApi#addPaymentMethod_]):
   
   [source,java,linenums]
   ----
  
positive.code: 
  === How can I update error information in Kill Bill
  
  Sometimes, the payment might not be processed by the payment gateway due to some error. In order to update the error information in Kill Bill, the <<PaymentTransactionInfoPlugin,"PaymentTransactionInfoPlugin">> object returned by the plugin method should be populated with the error information. In other words, the `PaymentTransactionInfoPlugin#getGatewayError` and the `PaymentTransactionInfoPlugin#getGatewayErrorCode` need to be implemented correctly. Kill Bill then automatically updates this information in the Kill Bill database. For example, in case an exception occurs while processing the payment, the https://github.com/killbill/killbill-gocardless-example-plugin/blob/85e6a2034d377925537ed58295547c92945f8896/src/main/java/org/killbill/billing/plugin/gocardless/GoCardlessPaymentPluginApi.java#L127[_GocardlessPaymentPluginApi#purchasePayment_] method returns the error information.
  
  == Further Reading
  
  
negative.code: 
  * 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 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):
  
  |===
  |*Method Name* | *Method Description*
  |getKbPaymentId
  |Returns Payment Id in Kill Bill
  |getKbTransactionPaymentId
  