{ "info": { "author": "Matin Tamizi, Mahmoud Abdelkader", "author_email": "devsupport@poundpay.com", "bugtrack_url": null, "classifiers": [ "Intended Audience :: Developers", "License :: OSI Approved :: BSD License", "Programming Language :: Python", "Topic :: Software Development :: Libraries :: Python Modules" ], "description": "PoundPay\n--------\n\nPoundPay enables developers to build apps which facilitate\ntransactions between two of their users. PoundPay is designed\nspecifically for these types of transactions, as opposed to direct\npayments from customer to business. In short, PoundPay is the payments\nplatform for marketplaces.\n\nInstall\n```````\n\n::\n\n $ easy_install poundpay\n\nConfigure\n`````````\n\n::\n\n CONFIG = {\n 'sandbox': {\n 'developer_sid': 'DV0383d447360511e0bbac00264a09ff3c',\n 'auth_token': ('c31155b9f944d7aed204bdb2a253fef13b4fdcc6ae15402004'\n '49cc4526b2381a'),\n 'api_url': 'https://api-sandbox.poundpay.com'\n },\n 'production': {\n 'developer_sid': 'DV8dd93f0f3c6411e0863f00264a09ff3c',\n 'auth_token': ('d8c4ea1bafd3fcac8c1062a72c22bcdb09321deb1041df2571'\n '65cd6449def0de')\n }\n }\n\n import poundpay\n poundpay.configure(**CONFIG['production'])\n\nCreating a Payment\n``````````````````\n\n::\n\n payment = poundpay.Payment(\n amount=10000, # in usd cents, not dollars\n payer_fee_amount=0,\n payer_email_address='fred@example.com',\n recipient_fee_amount=500,\n recipient_email_address='david@example.com',\n description='Beats by Dr. Dre',\n ).save()\n\n\nPayment methods\n```````````````\n\n::\n\n list_of_payments = poundpay.Payment.all()\n payment = poundpay.Payment.find(payment_sid)\n payment.escrow() # AUTHORIZED -> ESCROWED. Credit card is charged\n payment.release() # ESCROWED -> RELEASED. Recipient receives money\n payment.cancel() # ESCROWED -> CANCELED. Payer receives refund\n \n\nServing the payment IFRAME\n``````````````````````````\n\n::\n\n \n\n
\n\n \n \n\nCreating a Charge Permission\n````````````````````````````\n\n::\n\n charge_permission = poundpay.ChargePermission(\n email_address='payer@example.com',\n ).save()\n\n\nDeactivating a Charge Permission\n````````````````````````````````\n\n::\n\n charge_permission = poundpay.ChargePermission.find(charge_permission_sid)\n charge_permission.deactivate()\n\n\nChargePermission methods\n````````````````````````\n\n::\n\n list_of_payments = poundpay.ChargePermission.all()\n charge_permission = poundpay.ChargePermission.find(charge_permission_sid)\n charge_permission.deactivate() # CREATED or ACTIVE -> INACTIVE. Charge permission is deactivated and can no longer be used to authorize payments for the associated payer.\n \n\nServing the charge permission IFRAME\n````````````````````````````````````\n\n::\n\n \n\n \n\n \n \n \nBatching\n````````\n\nIn some cases you may wish to batch authorize and escrow a collection of\npayments. By doing so there will be only *one* payer charge for that collection\nof payments. Note that if you do batch authorize a collection of payments that\nit must *also* be batch escrowed.\n\nBatching is designed for shopping carts where you want a collection of payments\nto appear to appear as a single charge.\n\nIn order to use batching you simply need to pass `sids` for *all* payments in\nthe collection you want to batch to the IFrame::\n\n \n\n \n\n \n\nAlternatively if you are directly authorizing the payments using a charge\npermission::\n\n Payments.batch_update(\n payment1.sid, payment2.sid, payment3.sid,\n status='AUTHORIZED')\n\nFinally you'll need to batch escrow the payments::\n\n Payments.batch_update(\n payment1.sid, payment2.sid, payment3.sid,\n status='ESCROWED')\n\nNotice that if you did the following instead an error would be triggered since\nbatched payments *must* be authorized and escrowed collectively::\n\n Payments.find(payment1.sid, status='ESCROWED').save() # fails\n\nHowever if you cancel some of the payments prior to batch escrow you should\nexclude them from the batch call::\n\n Payments.find(payment1.sid, status='CANCEL').save() # ok\n\n Payments.batch_update(\n payment2.sid, payment3.sid,\n status='ESCROWED')\n\nLinks\n`````\n\n* `Developer Documentation