anchor.diff:  	Iterable<PluginProperty> properties, CallContext context) throws PaymentPluginApiException {
   	logger.info("buildFormDescriptor, kbAccountId=" + kbAccountId);
   	// retrieve properties
  -	String successRedirectUrl = PluginProperties.findPluginPropertyValue("success_redirect_url", properties); // "https://developer.gocardless.com/example-redirect-uri/"; - this is the URL to which GoCardless will redirect after users set up the  mandate
  +	String successRedirectUrl = PluginProperties.findPluginPropertyValue("success_redirect_url", properties); // "https://developer.gocardless.com/example-redirect-uri/"; - this is the URL to which GoCardless will redirect after users set up the mandate
   	String redirectFlowDescription = PluginProperties.findPluginPropertyValue("redirect_flow_description",properties); 
   	String sessionToken = PluginProperties.findPluginPropertyValue("session_token", properties); PrefilledCustomer customer = buildCustomer(customFields);// build a PrefilledCuctomer object from custom fields if present
   	RedirectFlow redirectFlow = client.redirectFlows().create().withDescription(redirectFlowDescription)
  
positive.code: * Kill Bill triggers an automatic payment 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: }
  ----
  
  * If you recall, `addPaymentMethod` stores the *mandate ID* in the Kill Bill database. This is first retrieved and assigned to `mandate`.
  
  * Next, the `idempotencyKey` is retrieved from the `properties` passed in. The `idempotencyKey` is a GoCardless specific value. As per the GoCardless documentation, their API will ensure this payment is only ever created once per `idempotencyKey`. So a client application could specify `kbPaymentId` as the `idempotencyKey` to ensure at most a single payment is created per `kbPaymentId`.
  
  *  The `currency` object passed in is of type `org.killbill.billing.catalog.api.Currency`. This is then converted to a *GoCardless Currency object* (of type `com.gocardless.services.PaymentService.PaymentCreateRequest.Currency`). Most payment plugins have code similar to this to convert Kill Bill objects to compatible objects in the plugin's client library.
  
  * 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, `kbPaymentId` and `kbTransactionId` are required to retrieve the payment information as explained in the <<getPaymentInfo, `getPaymentInfo`>> section. 
  
  * The `purchasePayment` method returns a `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:
  
  ** *kbPaymentId* - Set to `kbPaymentId`. It corresponds to the Kill Bill payment ID. 
  
  ** *kbTransactionId* - Set to `kbTransactionId`. It corresponds to the Kill Bill transaction ID. 
  
  ** *TransactionType* - Set to `TransactionType.PURCHASE` since this is a purchase transaction.
  
  