https://github.com/bolajiayodeji/pay-with-tweet
Commerce Layer Pay With Tweet external payment gateway.
https://github.com/bolajiayodeji/pay-with-tweet
commercelayer twitter-api twitter-sdk
Last synced: 22 days ago
JSON representation
Commerce Layer Pay With Tweet external payment gateway.
- Host: GitHub
- URL: https://github.com/bolajiayodeji/pay-with-tweet
- Owner: BolajiAyodeji
- Created: 2022-07-01T08:59:33.000Z (almost 3 years ago)
- Default Branch: main
- Last Pushed: 2024-11-22T04:14:22.000Z (6 months ago)
- Last Synced: 2025-03-30T20:43:05.734Z (about 2 months ago)
- Topics: commercelayer, twitter-api, twitter-sdk
- Language: TypeScript
- Homepage:
- Size: 91.8 KB
- Stars: 1
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# pay-with-tweet
A demo Pay With Tweet external payment gateway. To get started and learn more about this demo, kindly read the comprehensive tutorial on [Commerce Layer's blog](https://commercelayer.io/blog/building-an-external-payment-gateway-with-twitter-api).
---
Update the `.env.template` file or add your credentials in a `.env` file:
```bash
CL_SHARED_SECRET=""
CL_TWITTER_ID=""
TW_BEARER_TOKEN=""
```Start the local server in development mode:
```bash
npm run dev
```Start a ngrok HTTP tunnel listening for HTTP/HTTPS traffic on port 9000:
```bash
ngrok http 9000
```Create a new payment gateway using the [CLI](https://github.com/commercelayer/commercelayer-cli):
```bash
cl res:create external_gateways -a \
name="Pay With Tweet"
```Create a payment method:
```bash
cl res:create payment_methods -a \
payment_source_type="ExternalPayment" \
currency_code="USD" \
price_amount_cents=0 -r \
market="FlqxGhKrFg" \
payment_gateway="BkXMMsBDGa"
```Create an external payment:
```bash
cl res:create external_payments -a \
payment_source_token="testTokeN1234"
```Create and place an order:
```bash
cl resources:update orders/GHrQkxDVPS -a _place=true
```