Просмотр исходного кода

fix(payments-plugin): Fix error on Braintree refund failure

Michael Bromley 3 лет назад
Родитель
Сommit
0b79eb5f0b

+ 1 - 1
packages/payments-plugin/src/braintree/braintree.handler.ts

@@ -69,7 +69,7 @@ export const braintreePaymentMethodHandler = new PaymentMethodHandler({
         if (!response.success) {
             return {
                 state: 'Failed' as const,
-                transactionId: response.transaction.id,
+                transactionId: response.transaction?.id,
                 metadata: response,
             };
         }

+ 1 - 1
packages/payments-plugin/src/braintree/braintree.plugin.ts

@@ -62,7 +62,7 @@ import { BraintreePluginOptions } from './types';
  * 2. Use this client token to instantiate the Braintree Dropin UI.
  * 3. Listen for the `"paymentMethodRequestable"` event which emitted by the Dropin.
  * 4. Use the Dropin's `requestPaymentMethod()` method to get the required payment metadata.
- * 5. Pass that metadata to the `addPaymentToOrder` mutation.
+ * 5. Pass that metadata to the `addPaymentToOrder` mutation. The metadata should be an object of type `{ nonce: string; }`
  *
  * Here is an example of how your storefront code will look. Note that this example is attempting to
  * be framework-agnostic, so you'll need to adapt it to fit to your framework of choice.