Problem with adding metadata in PayPal Developer RestAPIs to Create a payment

BMs_Developer
Contributor
Contributor

We want to add metadata when creating a payment (https://developer.paypal.com/docs/api/payments/v1/) through Rest APIs. However, there is no object to add metadata like a JSON field. If we try to do it with a string, there is an option for custom metadata, but it only supports a limited number of characters (maximum characters: 127, it might be 256).

 

But we have mandatory data to add this:

metadatas = {
               'coupon': coupon_code,
                'user_id': UserID,
                'product_id': product.id,
                'package': package_name,
                'coupon_discount': discount,
                'currency_code': CurrencyCode,
                'exchange_rate': ExchangeRate,
                'currency_symbol': CurrencySymbol,
                'converted_price': final_price,
                'base_currency': base_currency_code,
                'base_currency_symbol': base_currency_symbol,
                'base_price': base_price,
                'requirements': Requirements[:400],
            }
Login to Me Too
2 REPLIES 2

michaelcatalog
New Community Member

Did you find a workaround for this? @BMs_Developer 

Login to Me Too

BMs_Developer
Contributor
Contributor

No, but, you have to convert 'note' to json to do it. PayPal has not good endowment like stripe. it only good for p2p transaction not for payment gateway.

Login to Me Too

Haven't Found your Answer?

It happens. Hit the "Login to Ask the community" button to create a question for the PayPal community.