Skip to content

Commit

Permalink
feat: clean up
Browse files Browse the repository at this point in the history
  • Loading branch information
ribeiroguilherme committed Dec 1, 2023
1 parent 8336aa0 commit 76625a9
Show file tree
Hide file tree
Showing 4 changed files with 3 additions and 51 deletions.
2 changes: 1 addition & 1 deletion packages/lib/src/components/CashAppPay/CashAppPay.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ export class CashAppPay extends UIElement<CashAppPayConfiguration> {
return this.props.storedPaymentMethodId ? 'Cash App Pay' : '';
}

public submit = async () => {
public submit = () => {
const { onClick, storedPaymentMethodId } = this.props;

if (storedPaymentMethodId) {
Expand Down
4 changes: 1 addition & 3 deletions packages/lib/src/components/Dropin/Dropin.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ class DropinElement extends UIElement<DropinConfiguration> {
/**
* Calls the onSubmit event with the state of the activePaymentMethod
*/
public async submit(): Promise<void> {
public override submit(): void {
if (!this.activePaymentMethod) {
throw new Error('No active payment method.');
}
Expand Down Expand Up @@ -122,8 +122,6 @@ class DropinElement extends UIElement<DropinConfiguration> {
};

public handleAction(action: PaymentAction, props = {}): this | null {
debugger;

if (!action || !action.type) {
if (hasOwnProperty(action, 'action') && hasOwnProperty(action, 'resultCode')) {
throw new Error(
Expand Down
2 changes: 1 addition & 1 deletion packages/lib/src/components/PayPal/Paypal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ class PaypalElement extends UIElement<PayPalConfiguration> {
};
}

public submit = async () => {
public submit = () => {
this.handleError(new AdyenCheckoutError('IMPLEMENTATION_ERROR', ERRORS.SUBMIT_NOT_SUPPORTED));
};

Expand Down
46 changes: 0 additions & 46 deletions packages/playground/src/pages/Dropin/manual.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ export async function initManual() {

locale: 'pt-BR',
translationFile: getTranslationFile(shopperLocale),
// translationFile: nl_NL,

environment: process.env.__CLIENT_ENV__,

Expand Down Expand Up @@ -64,19 +63,6 @@ export async function initManual() {
//
// return;
// }
//
// if (result.resultCode === 'Authorised' || result.resultCode === 'Received') {
// actions.resolve(result); // DO I NEED FULL RESULT?
// } else {
// actions.reject(result);
// }

// return {
// googlePayError: {
// message: 'Not sufficient funds',
// reason: 'OTHER_ERROR,'
// }
// }

//
// // Trigger Error for GooglePay
Expand All @@ -93,38 +79,6 @@ export async function initManual() {
onPaymentCompleted(result, element) {
console.log('onPaymentCompleted', result, element);
},
//
//
// // payments call
// if (result === AUTHORIZED)
// return action.resolve({ orderTrackng: { /// details }})}
// }
//
//
// action.reject(new ApplePayError('')));

// // handle actions
// if (result.action) {
// // demo only - store paymentData & order
// if (result.action.paymentData) localStorage.setItem('storedPaymentData', result.action.paymentData);
// component.handleAction(result.action, { challengeWindowSize: '01' });
// } else if (result.order && result.order?.remainingAmount?.value > 0) {
// // handle orders
// const order = {
// orderData: result.order.orderData,
// pspReference: result.order.pspReference
// };
//
// const orderPaymentMethods = await getPaymentMethods({ order, amount, shopperLocale });
// checkout.update({ paymentMethodsResponse: orderPaymentMethods, order, amount: result.order.remainingAmount });
// } else {
// handleFinalState(result.resultCode, component);
// }
// },
// srConfig: { showPanel: true },
// onChange: state => {
// console.log('onChange', state);
// },
onAdditionalDetails: async (state, component) => {
const result = await makeDetailsCall(state.data);

Expand Down

0 comments on commit 76625a9

Please sign in to comment.