Community코딩 & 개발github.com

shopify/shopify-payments-apps

Payments Apps API를 통해 결제 제공업체는 Shopify 체크아웃에 결제 솔루션을 통합할 수 있습니다.

shopify-payments-apps란 무엇인가요?

이 스킬은 Shopify Payments Apps API를 사용하여 결제 제공업체가 Shopify 체크아웃과 결제 솔루션을 통합하는 방법을 설명합니다. 주로 Shopify 앱 개발자와 결제 게이트웨이 제공업체를 대상으로 하며, API 엔드포인트, 인증, 요청/응답 형식, 웹훅 처리 등 기술적 세부 사항을 다룹니다. 이 스킬은 개발자가 사용자 정의 결제 경험을 구축하고, 거래 흐름을 관리하며, Shopify 생태계 내에서 안전하고 원활한 결제 처리를 보장하는 데 도움을 줍니다. Shopify CLI, REST API, GraphQL API 등 다양한 도구와 플랫폼을 지원합니다.

지원 대상~Claude Code~Codex CLI~Cursor
npx skills add https://github.com/shopify/shopify-ai-toolkit/tree/main/skills/shopify-payments-apps

Installed? Explore more 코딩 & 개발 skills: steipete/bluebubbles, steipete/eightctl, steipete/blucli · View all 6 →

즐겨 사용하는 AI에게 물어보기

이 에이전트 스킬이 미리 로드된 새 채팅을 엽니다.

문서

shopify-payments-apps은(는) 무엇을 하나요?

Payments Apps API를 통해 결제 제공업체는 Shopify 체크아웃에 결제 솔루션을 통합할 수 있습니다.

개요

이 스킬은 Shopify Payments Apps API를 사용하여 맞춤형 결제 게이트웨이를 구축하는 방법을 안내합니다. 지원되는 플랫폼으로는 Shopify CLI, REST API, GraphQL API가 있습니다.

주요 기능

  • 결제 처리: 거래 승인, 캡처, 취소, 환불을 처리합니다.
  • 웹훅 통합: 결제 상태 변경을 실시간으로 수신합니다.
  • 인증 및 보안: API 키, OAuth 토큰, 서명 검증을 지원합니다.

시작하기

  1. Shopify 파트너 대시보드에서 앱을 등록합니다.
  2. Payments Apps API 범위를 사용하도록 앱을 구성합니다.
  3. shopify app dev를 사용하여 로컬 개발 환경을 설정합니다.
  4. 결제 처리 엔드포인트를 구현합니다.

API 엔드포인트

엔드포인트설명
POST /admin/api/2024-07/payments_apps/payments.json새 결제 세션 생성
GET /admin/api/2024-07/payments_apps/payments/{id}.json결제 세션 세부 정보 조회
POST /admin/api/2024-07/payments_apps/payments/{id}/capture.json결제 캡처
POST /admin/api/2024-07/payments_apps/payments/{id}/void.json결제 취소

예제 요청

curl -X POST "https://your-shop.myshopify.com/admin/api/2024-07/payments_apps/payments.json" \
  -H "Content-Type: application/json" \
  -d '{
    "payment": {
      "amount": 10.00,
      "currency": "USD",
      "source": "credit_card",
      "test": true
    }
  }'

웹훅 처리

결제 상태 변경을 수신하려면 웹훅 엔드포인트를 구현하세요.

from flask import Flask, request
import hmac, hashlib

app = Flask(__name__)
SHOPIFY_SECRET = "your_shared_secret"

@app.route('/webhook', methods=['POST'])
def webhook():
    data = request.data
    signature = request.headers.get('X-Shopify-Hmac-Sha256')
    expected = hmac.new(SHOPIFY_SECRET.encode(), data, hashlib.sha256).hexdigest()
    if hmac.compare_digest(signature, expected):
        # 결제 정보 처리
        return 'OK', 200
    return 'Unauthorized', 401

보안 모범 사례

  • 항상 HTTPS를 사용하세요.
  • API 키를 안전하게 저장하고 환경 변수를 사용하세요.
  • 웹훅 서명을 검증하여 요청의 진위를 확인하세요.
  • 민감한 데이터를 로그에 기록하지 마세요.

문제 해결

  • 인증 오류: API 키와 OAuth 토큰이 올바른지 확인하세요.
  • 페이로드 유효성 검사 오류: 요청 본문이 올바른 JSON 형식인지 확인하세요.
  • Webhook 오류: 엔드포인트가 공개적으로 접근 가능하고 CORS가 올바르게 구성되었는지 확인하세요.

자세한 내용은 공식 Shopify Payments Apps API 문서를 참조하세요.

Individual skills in this repo

This repo contains 20 individual skills — each has its own dedicated page.

shopify/shopify-admin

Write or explain **Admin GraphQL** queries and mutations for apps and integrations that extend the Shopify admin. Use when the user wants to **understand, design, or generate** the operation itself—even before deciding how to run it. Do **not** choose `admin` first for **app or extension config validation** —use **`use-shopify-cli`**. Do **not** choose `admin` first to **execute** Admin GraphQL **now via Shopify CLI** or for CLI setup/troubleshooting on store workflows—use **`use-shopify-cli`** (store auth/execute, handle/SKU/location lookups, inventory changes).

shopify/shopify-admin-execution

Run a validated Admin GraphQL operation against a specific store using Shopify CLI. Use this when the user wants an executable store workflow, not just the query or mutation text. If the answer should include `shopify store auth` and `shopify store execute`, choose this API. Choose this for 'my store', 'this store', a store domain, product reads on a merchant store, low-inventory lookups, product updates, and warehouse/location inventory changes. Examples: 'Show me the first 10 products on my store', 'Find products with low inventory on my store', 'Set inventory at the Toronto warehouse so SKU ABC-123 is 12'.

shopify/shopify-app-store-review

Run a pre-submission compliance check against your Shopify app's codebase. Reviews App Store requirements and surfaces likely issues before you submit for official review.

shopify/shopify-custom-data

MUST be used first when prompts mention Metafields or Metaobjects. Use Metafields and Metaobjects to model and store custom data for your app. Metafields extend built-in Shopify data types like products or customers, Metaobjects are custom data types that can be used to store bespoke data structures. Metafield and Metaobject definitions provide a schema and configuration for values to follow.

shopify/shopify-customer

The Customer Account API allows customers to access their own data including orders, payment methods, and addresses.

shopify/shopify-dev

Search Shopify developer documentation across all APIs. Use only when no API-specific skill applies.

shopify/shopify-functions

Shopify Functions allow developers to customize the backend logic that powers parts of Shopify. Available APIs: Discount, Cart and Checkout Validation, Cart Transform, Pickup Point Delivery Option Generator, Delivery Customization, Fulfillment Constraints, Local Pickup Delivery Option Generator, Order Routing Location Rule, Payment Customization

shopify/shopify-hydrogen

Hydrogen storefront implementation cookbooks. Some of the available recipes are: B2B Commerce, Bundles, Combined Listings, Custom Cart Method, Dynamic Content with Metaobjects, Express Server, Google Tag Manager Integration, Infinite Scroll, Legacy Customer Account Flow, Markets, Partytown + Google Tag Manager, Subscriptions, Third-party API Queries and Caching. MANDATORY: Use this API for ANY Hydrogen storefront question - do NOT use Storefront GraphQL when 'Hydrogen' is mentioned.

shopify/shopify-liquid

Liquid is an open-source templating language created by Shopify. It is the backbone of Shopify themes and is used to load dynamic content on storefronts. Keywords: liquid, theme, shopify-theme, liquid-component, liquid-block, liquid-section, liquid-snippet, liquid-schemas, shopify-theme-schemas

shopify/shopify-onboarding-dev

Get started building on Shopify. Use when a developer asks to build an app, build a theme, create a dev store, set up a partner account, scaffold a project, or get started developing for Shopify. NOT for merchants managing stores.

shopify/shopify-onboarding-merchant

Set up and connect a Shopify store from your AI assistant. Use when the user wants to: set up my Shopify store, connect my store, install Shopify plugin, get started with Shopify, manage my store, add products to my store, merchant onboarding, start selling online, Shopify setup help, create my first store, how do I set up an online store, import products, migrate from Square, migrate from WooCommerce, migrate from Etsy, migrate from Amazon, migrate from eBay, migrate from Wix, import from Google Merchant Center, migrate from Clover, migrate from Lightspeed, move products to Shopify, import catalog, replatform to Shopify. This is for store owners — not developers.

shopify/shopify-partner

The Partner API lets you programmatically access data about your Partner Dashboard, including your apps, themes, and affiliate referrals.

shopify/shopify-polaris-admin-extensions

Add custom actions and blocks from your app at contextually relevant spots throughout the Shopify Admin. Admin UI Extensions also supports scaffolding new adminextensions using Shopify CLI commands.

shopify/shopify-polaris-app-home

Build your app's primary user interface embedded in the Shopify admin. If the prompt just mentions `Polaris` and you can't tell based off of the context what API they meant, assume they meant this API.

shopify/shopify-polaris-checkout-extensions

Build custom functionality that merchants can install at defined points in the checkout flow, including product information, shipping, payment, order summary, and Shop Pay. Checkout UI Extensions also supports scaffolding new checkout extensions using Shopify CLI commands.

shopify/shopify-polaris-customer-account-extensions

Build custom functionality that merchants can install at defined points on the Order index, Order status, and Profile pages in customer accounts. Customer Account UI Extensions also supports scaffolding new customer account extensions using Shopify CLI commands.

shopify/shopify-pos-ui

Build retail point-of-sale applications using Shopify's POS UI components. These components provide a consistent and familiar interface for POS applications. POS UI Extensions also supports scaffolding new POS extensions using Shopify CLI commands. Keywords: POS, Retail, smart grid

shopify/shopify-storefront-graphql

Use for custom storefronts requiring direct GraphQL queries/mutations for data fetching and cart operations. Choose this when you need full control over data fetching and rendering your own UI. NOT for Web Components - if the prompt mentions HTML tags like <shopify-store>, <shopify-cart>, use storefront-web-components instead.

shopify/shopify-use-shopify-cli

Choose when the user needs **Shopify CLI** to run or fix something now: validate app or extension config on disk (`shopify.app.toml`, `shopify.app.<name>.toml`, `shopify.extension.toml`); run or troubleshoot store workflows (`shopify store auth`, `shopify store execute`); inventory or product changes by handle, SKU, or location name; or CLI setup, auth, upgrade issues. Emphasize **commands and operational steps**, not only authoring GraphQL. Skip for API-only understanding or codegen with no CLI execution. Examples: validate configuration before deploy; run an existing query via CLI; list products; missing `shopify store execute`.

shopify/ucp

Use when the user wants to use the UCP CLI to find, compare, buy, or track products from online merchants, or to set up and troubleshoot the local UCP profile required for merchant-scoped operations. Covers global catalog search ("find me X under $Y"), named-merchant transactions ("buy this from Z.com"), order tracking, `ucp profile init`, `ucp doctor`, carts, checkout, orders, and UCP setup/help. Falls back to merchant-hosted handoff when direct in-protocol checkout isn't available.

관련 스킬