File: payment_intent.py

package info (click to toggle)
chargebee2-python 2.22.0-1
  • links: PTS, VCS
  • area: main
  • in suites: bookworm
  • size: 740 kB
  • sloc: python: 2,492; makefile: 4; sh: 3
file content (26 lines) | stat: -rw-r--r-- 1,096 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
import json
from chargebee.model import Model
from chargebee import request
from chargebee import APIError

class PaymentIntent(Model):
    class PaymentAttempt(Model):
      fields = ["id", "status", "payment_method_type", "id_at_gateway", "error_code", "error_text", "created_at", "modified_at"]
      pass

    fields = ["id", "status", "currency_code", "amount", "gateway_account_id", "expires_at", \
    "reference_id", "payment_method_type", "success_url", "failure_url", "created_at", "modified_at", \
    "resource_version", "updated_at", "customer_id", "gateway", "active_payment_attempt"]


    @staticmethod
    def create(params, env=None, headers=None):
        return request.send('post', request.uri_path("payment_intents"), params, env, headers)

    @staticmethod
    def update(id, params=None, env=None, headers=None):
        return request.send('post', request.uri_path("payment_intents",id), params, env, headers)

    @staticmethod
    def retrieve(id, env=None, headers=None):
        return request.send('get', request.uri_path("payment_intents",id), None, env, headers)