Catalog PyPI
PACKAGE EXPLORERView in registry

affirm-pay

PyPI

Python Client for Affirm

affirmclientintegrationsdk
Versions collected1
Direct dependencies0From release 0.7
Last observed20 Oct, 21:05 UTC

README

Version 0.7 documentation

Affirm Python SDK

Affirm Python SDK is a client library to interact with Affirm. For API reference: https://docs.affirm.com/Integrate_Affirm/Direct_API/Affirm_API_Reference

Affirm helps customers to pay over time for things they want to buy. The customers are in control of how long you get to make monthly payments. They do the approval process in minutes. This client will help you integrate with Affirm.

Usage

Client Creation

from affirm import Client
client = Client(auth=(<PUBLIC_API_KEY>, <PRIVATE_API_KEY>))

Performing Authorize

from affirm import Client
client = Client(auth=(<PUBLIC_API_KEY>, <PRIVATE_API_KEY>))
resp = client.charge.create(data={"checkout_token":<CHECKOUT_TOKEN_FROM_AFFIRM>, "order_id": <YOUR_GENERATED_ORDER_ID>)

Performing Capture

from affirm import Client
client = Client(auth=(<PUBLIC_API_KEY>, <PRIVATE_API_KEY>))
resp = client.charge.capture(charge_id = <CHARGE_ID>, order_id=<YOUR_GENERATED_ORDER_ID>)

Performing Refund

from affirm import Client
client = Client(auth=(<PUBLIC_API_KEY>, <PRIVATE_API_KEY>))
resp = client.charge.capture(charge_id = <CHARGE_ID>, order_id= <YOUR_GENERATED_ORDER_ID>)

Perform Update

from affirm import Client
client = Client(auth=(<PUBLIC_API_KEY>, <PRIVATE_API_KEY>))
resp = client.charge.update(charge_id = <CHARGE_ID>, order_id": <YOUR_GENERATED_ORDER_ID>)

Perform Void

from affirm import Client
client = Client(auth=(<PUBLIC_API_KEY>, <PRIVATE_API_KEY>))
resp = client.charge.void(charge_id=<CHARGE_ID>, order_id=<YOUR_GENERATED_ORDER_ID>)

Using the client for Production(or live)

The only change you need to make pass a prod keyward while to client creation step.

from affirm import Client
client = Client(auth=(<PUBLIC_API_KEY>, <PRIVATE_API_KEY>), prod=True)

If you have any questions please shoot a mail to anshul[dot]jmi[at]gmail[dot]com.

Downloads & popularity

Awaiting observations

No metric observations yet

Download counts and popularity will appear here as the collector receives them.

Versions 1

Collected releases
VersionPublishedDirect dependenciesOpen version
0.77 May 20190

Package advisories

0
No matching advisories collected

This describes our collected data; it is not a security assessment.

Repository

PENDING
raun/affirm-python-sdk

Shared repository data · GitHub

License detected in repository
Not collected

Metadata history

Meaningful changes
Current collected state Current

Observed since 20 Oct, 21:05 UTC

No superseded metadata states collected. Unchanged observations do not create new revisions.

Record identity

package:fdc2dadd223c36435a8a2e175c0bfd0d854dc68de280f1ada97713cb79f79b0b