Package: python-pallapay
Pallapay crypto payment gateway SDKEasy to use SDK for pallapay crypto payment gateway, accept crypto in your website and get paid in cash.Installationpip install python-pallapayEasy to useFirst signup andget you merchant ID from pallapay websiteThen you can create a payment link:frompallapay.paymentimportPaymentfrompallapay.enumsimport*defcreate_payment():# Create payment linkpayment=Payment()result=payment.create_payment(merchant_id='YOUR_MERCHANT_ID',order_id='YOUR_ORDER_ID',amount=100,currency=CURRENCY_AED,payer_first_name='PAYER_FIRST_NAME',payer_last_name='PAYER_LAST_NAME',payer_email='payer@mail.com',custom_data='YOUR_CUSTOM_DATA')print(result['redirect_to_url'])create_paymentparams:NameDescriptionRequiredmerchant_idYour merchant ID (You can create one in pallapay panel)YESorder_idOrder ID for your paymentYESamountAmount in selected currencyYEScurrencyCurrency of the payment (You can find all available currencies down bellow)YESpayer_first_namePayer first nameYESpayer_last_namePayer last nameYESpayer_emailPayer emailYEScustom_dataYou can pass your custom data here. for example, your customers order ID. This item is not displayed to the buyer.NOAfter that you can redirect user toredirect_to_url.Handle IPNAfter user payment was done, we will call your IPN_NOTIFY_URL that you entered when you created your merchant.In that page you can use thisis_transaction_paidmethod to check if payment was valid and paid.frompallapay.paymentimportPaymentdefipn_handler():# Checking IPN_NOTIFY request that pallapay will send to your IPN_NOTIFY_URL# TODO : Get all form dataform_data={'hash':'B6428DAC2C62427CB3A59A4203B88AD8','total':'100','date':'RECEIVED_DATE','id_transfer':'RECEIVED_ID_TRANSFER','status':'CONFIRMED',}payment=Payment()is_paid=payment.is_transaction_paid(merchant_password='YOUR_MERCHANT_PASSWORD',hash_string=form_data['hash'],total=form_data['total'],date=form_data['date'],id_transfer=form_data['id_transfer'],status=form_data['status'])ifis_paid:print('CONFIRMED PAYMENT')else:print('NOT PAID')Received data on your IPN_NOTIFY:nameDescriptionamountThe received amount without commissionsfeeFee that was paid (Note: Paid by the buyer or merchant according to the merchant settings in pallapay dashboard)totalTotal transaction amount including commissioncurrencyTransaction currencypayerPayer namereceiverMerchant username in PallapaystatusTransaction statusdateTransaction dateid_transferUnique transaction number in Pallapaymerchant_nameMerchant namemerchant_idMerchant IDbalanceAvailable merchant balance in transaction currencyitem_nameItem namecustomCustom data that you sent for create paymenthashencrypted hash to check validity of IPN request (Note: You can check by yourself or you can check by is_transaction_paid method)Supported currenciesSupported CurrenciesAEDUSDEURGBPBTCETHTRONPALLAUSDT-TRC20USDT-ERC20USDC-ERC20DAI-ERC20And you can find supported currencies constants here:frompallapay.enumsimport*CURRENCY_AEDCURRENCY_USDCURRENCY_EURCURRENCY_GBPCURRENCY_BTCCURRENCY_ETHCURRENCY_TRXCURRENCY_PALLA_TRC20CURRENCY_USDT_TRC20CURRENCY_USDT_ERC20CURRENCY_USDC_ERC20CURRENCY_DAI_ERC20ContributionContributions are highly appreciated either in the form of pull requests for new features, bug fixes or just bug reports.Pallapay Website