anchor.diff:  
   Initial setup steps include installing the necessary software, setting up the project in an IDE and generating a GoCardless token as explained below. 
   
  -. Ensure that you have the necessary software for plugin development as listed https://docs.killbill.io/latest/plugin_development.html#_prerequisites[here].
  -
  -. Create a new Maven project in your IDE
  -
  -. Copy the https://github.com/killbill/killbill-gocardless-example-plugin/blob/85e6a2034d377925537ed58295547c92945f8896/pom.xml[GoCardless example pom.xml].
  +. Ensure that you have the necessary software for plugin development as listed in the https://docs.killbill.io/latest/plugin_development.html#_prerequisites[here]. 
  +. Clone the https://github.com/killbill/killbill-gocardless-example-plugin[_killbill-gocardless-example-plugin_] repository and set it up in an IDE as explained https://docs.killbill.io/latest/plugin_development.html#_setting_up_the_code_in_an_ide[here].
   
   . Generate a GoCardless access token (https://manage-sandbox.gocardless.com/developers) and create an environment variable *GC_ACCESS_TOKEN* with this token.
   
   ==== Step 2 - Creating GoCardlessPluginApi
   
  -The first step is to create a class that implements the `PaymentPluginApi` interface. 
  -
  -We will first need to create a class similar to `HelloWorldPaymentPluginApi` that implements the `PaymentPluginApi` interface. We can create this class as follows (See https://github.com/killbill/killbill-gocardless-example-plugin/blob/9522498ecde5849c940574c598ceb5ce088d32a7/src/main/java/org/killbill/billing/plugin/gocardless/GoCardlessPaymentPluginApi.java[_GoCardlessPaymentPluginApi.java_]):
  +The first step is to create a class that implements the `PaymentPluginApi` interface. 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/GoCardlessPaymentPluginApi.java[_GoCardlessPaymentPluginApi.java_] class.
   
   [source,java,linenums]
   ----
  
positive.code: [[purchasePayment]]
  ==== Step 6 - Implementing GoCardlessPaymentPluginApi#purchasePayment
  
  The `purchasePayment` is used to charge a customer against a payment method. So, once a user sets up a payment method as done above, the `purchasePayment` method can be used to trigger payments against a *mandateId*. So, this method can be 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: 
  ==== Step 3 - Creating GoCardlessPaymentTransactionInfoPlugin
  
  As explained earlier, most of the `PaymentPluginApi` methods return a <<PaymentTransactionInfoPlugin, _PaymentTransactionInfoPlugin_>> object. 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/GoCardlessPaymentTransactionInfoPlugin.java[_GoCardlessPaymentTransactionInfoPlugin.java_] class. 
  
  [source,java,linenums]
  ----
  