Skip to content

Commit

Permalink
moved square payment processing to utils
Browse files Browse the repository at this point in the history
  • Loading branch information
erikrakuscek committed Mar 14, 2024
1 parent 3c330d8 commit 7d274ec
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import { CreditCard, PaymentForm } from 'react-square-web-payments-sdk'
import { useCommerce, type TransactionStatus } from '../../..'
import PaymentMethods from './payment-methods'
import { ApplyTypography, Button } from '@hanzo/ui/primitives'
import processPayment from './process-payment'
import { processSquareCardPayment } from '../../../util'

const PayWithCard: React.FC<{
setCurrentStep: (currentStep: number) => void
Expand Down Expand Up @@ -33,7 +33,7 @@ const PayWithCard: React.FC<{
*/
cardTokenizeResponseReceived={async (token: { token: any }, verifiedBuyer: any) => {
setTransactionStatus('paid')
const res = await processPayment(token.token, c.cartTotal)
const res = await processSquareCardPayment(token.token, c.cartTotal)
if (res) {
await storePaymentInfo(res)
setTransactionStatus('confirmed')
Expand Down
3 changes: 2 additions & 1 deletion packages/commerce/util/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,4 +28,5 @@ export function formatPrice(price: number): string {
}


export { default as useSyncSkuParamWithCurrentItem } from './use-sync-sku-param-w-current-item'
export { default as useSyncSkuParamWithCurrentItem } from './use-sync-sku-param-w-current-item'
export { default as processSquareCardPayment } from './square-payment'
File renamed without changes.

0 comments on commit 7d274ec

Please sign in to comment.