0.1.11 • Published 1 year ago

@cthulhu-dev/cthulhupay-react v0.1.11

Weekly downloads
-
License
ISC
Repository
github
Last release
1 year ago

Install

npm install @cthulhu-dev/cthulhupay-react

Use

import CthulhuPay from '@cthulhu-dev/cthulhupay-react';
import {CthulhuPayRequest, CthulhuPayResponse} from '@cthulhu-dev/cthulhupay-react';

export function Checkout({request}: {request: CthulhuPayRequest}) {

  return <CthulhuPay
      apiUrl="https://path-to-api/method"
      requestInterceptor={requestInterceptor}
      height={780}
      request={request}
      onDone={(response: CthulhuPayResponse) => console.log(response)}
      onError={(error: Error) => console.error(error)}
      onLoad={() => console.log('iframe is loaded')} />;
}

async function requestInterceptor(request: Request) {
  // add what you need to request header
  // example:
  // request.headers.set('Accept-Language', 'he-IL');
  return request;
}
0.1.11

1 year ago

0.0.13

1 year ago

0.1.0

1 year ago

0.1.1

1 year ago

0.0.11

2 years ago

0.0.10

2 years ago

0.0.9

2 years ago

0.0.8

2 years ago

0.0.7

2 years ago

0.0.4

2 years ago

0.0.3

2 years ago

0.0.2

2 years ago

0.0.1

2 years ago