Skip to main content

payple-hj3415

전자결제시스템. 현재는 네이버페이만 가능하게 설정함 payple_hj3415 앱 - 실제 결제 api로 배포앱 orders - 테스트용 주문앱

.env 환경변수 구성

PAYPLE_ENV=demo         # demo | live
PAYPLE_CST_ID=test
PAYPLE_CUST_KEY=abcd1234567890
PAYPLE_CLIENT_KEY=test_DF55F29DA654A8CBC0F0A9DD4B556486
PAYPLE_REFERER=http://127.0.0.1:8000    # 로컬 개발 중이면 http://127.0.0.1:8000 로 두고, 정식 테스트계정/운영에선 등록 도메인으로 변경

프로젝트 urls.py 구성

# myproject/urls.py
from django.urls import path, include
urlpatterns = [
    path("payple/", include(("payple_hj3415.urls", "payple_hj3415"), namespace="payple_hj3415")),
]

프로젝트 setting.py 구성

INSTALLED_APPS = [
    ...,
    'payple_hj3415',
]

import os
# --- 페이플 설정(테스트 기본값; 운영은 환경변수로 교체) ---
PAYPLE = {
    "ENV": os.getenv("PAYPLE_ENV", "demo"),
    "CST_ID": os.getenv("PAYPLE_CST_ID", "test"),
    "CUST_KEY": os.getenv("PAYPLE_CUST_KEY", "abcd1234567890"),
    "CLIENT_KEY": os.getenv("PAYPLE_CLIENT_KEY", "test_DF55F29DA654A8CBC0F0A9DD4B556486"),
    "REFERER": os.getenv("PAYPLE_REFERER", "http://127.0.0.1:8000"),
}

다른 앱에서 사용하는 방법(예시)

주문모델구성

# orders/models.py
from django.db import models

class Order(models.Model):
    title = models.CharField(max_length=200)               # 예: "테스트 상품"
    amount = models.PositiveIntegerField()                 # KRW(원) 기준 정수 금액
    status = models.CharField(max_length=20, default="PENDING")  # PENDING/PAID/FAILED 등
    created_at = models.DateTimeField(auto_now_add=True)

뷰에서order 넘기기

# orders/views.py
from django.shortcuts import render, get_object_or_404
from .models import Order

def order_detail(request, order_id):
    order = get_object_or_404(Order, pk=order_id)
    # (보안) 본인 주문인지 확인하는 로직 권장
    return render(request, "orders/order_detail.html", {"order": order})

템플릿에서 사용

{# orders/templates/orders/order_detail.html #}
{% load payple_tags %}
{% url 'orders:done' order.id as done_url %}
{% url 'orders:fail' order.id as fail_url %}

<a class="btn btn-primary"
   href="{% payple_start_url order.id order.amount order.title done_url fail_url %}">
  결제하기
</a>

urls.py 구성

# orders/urls.py
from django.urls import path
from . import views
app_name = "orders"

urlpatterns = [
    path("<int:order_id>/", views.order_detail, name="detail"),
    path("<int:order_id>/done/", views.order_done, name="done"),
    path("<int:order_id>/fail/", views.order_fail, name="fail"),
]

Metadata

Release files for payple-hj3415 0.1.2

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for payple-hj3415 0.1.2
File Size Uploaded Provenance Actions
payple_hj3415-0.1.2.tar.gz 8.6 kB Without provenance Details for payple_hj3415-0.1.2.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for payple-hj3415 0.1.2
File Interpreter ABI Platform Actions
payple_hj3415-0.1.2-py2.py3-none-any.whl Python 2, Python 3 none any Details for payple_hj3415-0.1.2-py2.py3-none-any.whl

Total release size: 19.2 kB

Release files / payple_hj3415-0.1.2.tar.gz

Download URL payple_hj3415-0.1.2.tar.gz
Size 8.6 kB
Tags Source
SHA-256 checksum
How to use checksums
26a78b16a15d648eb974da640c43f4389fea33b444c44e5492f564f426278219
BLAKE2b-256 checksum
How to use checksums
e761af126d2231881c90f97ff7e1cf7a669a2b1b99f3c52cf65213a5fdbf7984
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via python-requests/2.33.1

Release files / payple_hj3415-0.1.2-py2.py3-none-any.whl

Download URL payple_hj3415-0.1.2-py2.py3-none-any.whl
Size 10.6 kB
Tags Python 2 Python 3
SHA-256 checksum
How to use checksums
7861bd84dc1a04bfe23f9bf73fe4e1d9d817b4a5c37ffb97c545d15e0a549803
BLAKE2b-256 checksum
How to use checksums
6a341535c29b968fb2a229d0a3def263bf87c6245f0c4ae74b2c3c2cec45a819
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via python-requests/2.33.1

Security for payple-hj3415 0.1.2

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page