Problem with adding metadata in PayPal Developer RestAPIs to Create a payment
BMs_Developer
Contributor
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Posted on
May-22-2024
12:28 PM
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],
}
2 REPLIES 2
michaelcatalog
New Community Member
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Sep-13-2024
03:23 PM
BMs_Developer
Contributor
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Sep-14-2024
01:51 AM
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.
Haven't Found your Answer?
It happens. Hit the "Login to Ask the community" button to create a question for the PayPal community.