Skip to content
This repository has been archived by the owner on Feb 23, 2024. It is now read-only.

Commit

Permalink
implement demo with dummy payment method registration
Browse files Browse the repository at this point in the history
  • Loading branch information
nerrad committed Dec 15, 2019
1 parent f0509e8 commit be42c0a
Show file tree
Hide file tree
Showing 8 changed files with 65 additions and 0 deletions.
1 change: 1 addition & 0 deletions assets/js/blocks/cart-checkout/checkout/block.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ import {
* Internal dependencies
*/
import './style.scss';
import '../../../payment-methods-demo';

/**
* Component displaying an attribute filter.
Expand Down
2 changes: 2 additions & 0 deletions assets/js/payment-methods-demo/express-payment/apple-pay.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

13 changes: 13 additions & 0 deletions assets/js/payment-methods-demo/express-payment/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
/**
* Internal dependencies
*/
import { applePayImage } from './apple-pay';
import { paypalImage } from './paypal';

export const ExpressApplePay = () => {
return <img src={ applePayImage } alt="" />;
};

export const ExpressPaypal = () => {
return <img src={ paypalImage } alt="" />;
};
2 changes: 2 additions & 0 deletions assets/js/payment-methods-demo/express-payment/paypal.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

18 changes: 18 additions & 0 deletions assets/js/payment-methods-demo/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
/**
* External dependencies
*/
import {
registerExpressPaymentMethod,
registerPaymentMethod,
} from '@woocommerce/blocks-registry';

/**
* Internal dependencies
*/
import { ExpressApplePay, ExpressPaypal } from './express-payment';
import { PaypalPaymentMethod, ccPaymentMethod } from './payment-methods';

registerExpressPaymentMethod( 'applepay', ExpressApplePay );
registerExpressPaymentMethod( 'paypal', ExpressPaypal );
registerPaymentMethod( 'paypal', PaypalPaymentMethod );
registerPaymentMethod( 'cc', ccPaymentMethod );
2 changes: 2 additions & 0 deletions assets/js/payment-methods-demo/payment-methods/cc.js

Large diffs are not rendered by default.

25 changes: 25 additions & 0 deletions assets/js/payment-methods-demo/payment-methods/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
/**
* Internal dependencies
*/
import { paypalSvg } from './paypal';
import { ccSvg } from './cc';

export const PaypalPaymentMethod = {
tab: () => <img src={ paypalSvg } alt="" />,
content: () => (
<div>
<p>This is where paypal payment method stuff would be.</p>
</div>
),
ariaLabel: 'paypal payment method',
};

export const ccPaymentMethod = {
tab: () => <img src={ ccSvg } alt="" />,
content: () => (
<div>
<p>This is where cc payment method stuff would be.</p>
</div>
),
ariaLabel: 'credit-card-payment-method',
};
2 changes: 2 additions & 0 deletions assets/js/payment-methods-demo/payment-methods/paypal.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit be42c0a

Please sign in to comment.