Skip to content

Commit

Permalink
feat(payment): PAYPAL-3520 Max capture amount failure (#2485)
Browse files Browse the repository at this point in the history
* feat(payment): PAYPAL-3520 instrument_declined error handling

* feat(payment): PAYPAL-3520 added paypal button widget

* feat(payment): PAYPAL-3520 updates after review
  • Loading branch information
bc-nick authored Jun 4, 2024
1 parent a6e895a commit 968015a
Show file tree
Hide file tree
Showing 10 changed files with 573 additions and 36 deletions.
4 changes: 3 additions & 1 deletion packages/braintree-integration/.eslintrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,9 @@
"@typescript-eslint/consistent-type-assertions": "off",
"jest/no-conditional-expect": "off",
"@typescript-eslint/no-unsafe-call": "off",
"@typescript-eslint/no-empty-function": "off"
"@typescript-eslint/no-empty-function": "off",
"@typescript-eslint/no-throw-literal": "off",
"@typescript-eslint/no-floating-promises": "off"
}
}
]
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
export const LOADING_INDICATOR_STYLES = {
'background-color': 'rgba(0, 0, 0, 0.4)',
'z-index': '1000',
};
Original file line number Diff line number Diff line change
@@ -1,9 +1,16 @@
import {
BraintreeError,
BraintreeFormOptions,
BraintreeThreeDSecureOptions,
} from '@bigcommerce/checkout-sdk/braintree-utils';
import { StandardError } from '@bigcommerce/checkout-sdk/payment-integration-api';

export interface BraintreePaypalPaymentInitializeOptions {
/**
* The CSS selector of a container where the payment widget should be inserted into.
*/
containerId?: string;

threeDSecure?: BraintreeThreeDSecureOptions;

/**
Expand All @@ -18,6 +25,30 @@ export interface BraintreePaypalPaymentInitializeOptions {
* The location to insert the Pay Later Messages.
*/
bannerContainerId?: string;

/**
* A callback right before render Smart Payment Button that gets called when
* Smart Payment Button is eligible. This callback can be used to hide the standard submit button.
*/
onRenderButton?(): void;

/**
* A callback for submitting payment form that gets called
* when buyer approved PayPal account.
*/
submitForm?(): void;

/**
* A callback that gets called if unable to submit payment.
*
* @param error - The error object describing the failure.
*/
onPaymentError?(error: BraintreeError | StandardError): void;

/**
* A callback for displaying error popup. This callback requires error object as parameter.
*/
onError?(error: unknown): void;
}

export interface WithBraintreePaypalPaymentInitializeOptions {
Expand Down
Loading

0 comments on commit 968015a

Please sign in to comment.