anchor.diff:  
   * The servlet is mapped to the `/checkout` path. Thus, a client application needs to make a request to this path to invoke the servlet.
   
  -* The `createSession` accepts properties corresponding to `clock` and `goCardlessPaymentPluginApi`. These are injected via the <<gocardless_activator, "GoCardlessActivator">> class.  
  +* The `createSession` accepts properties corresponding to `clock` and `goCardlessPaymentPluginApi`. These are injected via the `GoCardlessActivator` class (This class is explained in the <<gocardless_activator, "GoCardlessActivator">> section below).  
   
   * It then creates `PluginProperty` objects corresponding to the values passed in as parameters.
   
  
positive.code: 
  * Finally, the `client.payments().create()` is invoked with the `idempotencyKey`, `amount` and `currency` values. This returns a `Payment` object which contains a `paymentId`. Additionally, the `kbPaymentId` and `kbTransactionId` are sent as *metadata* to GoCardless in this call. GoCardless *metadata* allows an application to send custom key value pairs to GoCardless. These can then be retrieved later on as required.  In our case, the `kbPaymentId` and `kbTransactionId` are required retrieving the payment information as explained in the <<getPaymentInfo, "getPaymentInfo">> section. 
  
  * The `purchasePayment` method returns a <<PaymentTransactionInfoPlugin, "PaymentTransactionInfoPlugin">>  object.  We have already created a <<GoCardlessPaymentTransactionInfoPlugin, "GoCardlessPaymentTransactionInfoPlugin">> class above.
  
  * If the payment is successful, the `GoCardlessPaymentTransactionInfoPlugin` object is created with the following values:
  
  
negative.code: * *Via the Janitor* - As explained earlier, the https://docs.killbill.io/latest/userguide_payment.html#_janitor[__Kill Bill Janitor__] attempts to to fix *PENDING* and *UNKNOWN* payment states by querying the <<getPaymentInfo, getPaymentInfo>> method. Thus, once the plugin receives a notification from the payment gateway about the payment being processed, the `getPaymentInfo` should return the correct payment status.
  
  [NOTE]  
  *Note*: The https://docs.killbill.io/latest/userguide_payment.html#_janitor_notification_queue[notification queue janitor] runs automatically as per a configured schedule. If you would like to run the Janitor immediately, you can trigger the https://docs.killbill.io/latest/userguide_payment.html#_on_the_fly_janitor[__on the fly janitor__] by invoking the https://github.com/killbill/killbill-api/blob/4ae1c343a593de937415e21feecb9f5405037fa3/src/main/java/org/killbill/billing/payment/api/PaymentApi.java#L439[_PaymentApi#getPayment_] method. 
  
  *Other Notes*
  
  Sometimes, in addition to processing the payment after a delay, the payment gateway may also charge a smaller amount then passed to it by a plugin method. The plugin should let Kill Bill know the actual processed amount so that Kill Bill can update the invoice/account balance accordingly.  In such cases, you cannot use the https://github.com/killbill/killbill-api/blob/4ae1c343a593de937415e21feecb9f5405037fa3/src/main/java/org/killbill/billing/payment/api/PaymentApi.java#L402[_PaymentApi#notifyPendingTransactionOfStateChanged_] method as it can be used to only update the payment status. So, in such cases you need to rely on the Janitor and let the `getPaymentInfo` return the processed amount via the  `PaymentTransactionInfoPlugin#getAmount` method.
  
  === How can I pass arbitrary values to the plugin or return arbitrary values from the plugin to Kill Bill/my frontend application?
  
  