Skip to content

Commit

Permalink
Fix issue with SuccessfulPayment object
Browse files Browse the repository at this point in the history
shipping_option_id and order_info are optional.
  • Loading branch information
baderouaich committed Dec 27, 2023
1 parent 3fccd2d commit 5c5abb0
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions include/tgbotxx/objects/SuccessfulPayment.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -24,12 +24,12 @@ namespace tgbotxx {
/// @brief Bot specified invoice payload
std::string invoicePayload;

/// @brief Optional. Order information provided by the user
Ptr<OrderInfo> orderInfo;

/// @brief Optional. Identifier of the shipping option chosen by the user
std::string shippingOptionId;

/// @brief Optional. Order information provided by the user
Ptr<OrderInfo> orderInfo;

/// @brief Telegram payment identifier
std::string telegramPaymentChargeId;

Expand All @@ -44,8 +44,8 @@ namespace tgbotxx {
OBJECT_SERIALIZE_FIELD(json, "currency", currency);
OBJECT_SERIALIZE_FIELD(json, "total_amount", totalAmount);
OBJECT_SERIALIZE_FIELD(json, "invoice_payload", invoicePayload);
OBJECT_SERIALIZE_FIELD_PTR(json, "order_info", orderInfo, nl::json::object());
OBJECT_SERIALIZE_FIELD(json, "shipping_option_id", shippingOptionId);
OBJECT_SERIALIZE_FIELD_PTR(json, "order_info", orderInfo, nl::json::object());
OBJECT_SERIALIZE_FIELD(json, "telegram_payment_charge_id", telegramPaymentChargeId);
OBJECT_SERIALIZE_FIELD(json, "provider_payment_charge_id", providerPaymentChargeId);
return json;
Expand All @@ -56,8 +56,8 @@ namespace tgbotxx {
OBJECT_DESERIALIZE_FIELD(json, "currency", currency, "", false);
OBJECT_DESERIALIZE_FIELD(json, "total_amount", totalAmount, 0, false);
OBJECT_DESERIALIZE_FIELD(json, "invoice_payload", invoicePayload, "", false);
OBJECT_DESERIALIZE_FIELD_PTR(json, "order_info", orderInfo, false);
OBJECT_DESERIALIZE_FIELD(json, "shipping_option_id", shippingOptionId, "", false);
OBJECT_DESERIALIZE_FIELD(json, "shipping_option_id", shippingOptionId, "", true);
OBJECT_DESERIALIZE_FIELD_PTR(json, "order_info", orderInfo, true);
OBJECT_DESERIALIZE_FIELD(json, "telegram_payment_charge_id", telegramPaymentChargeId, "", false);
OBJECT_DESERIALIZE_FIELD(json, "provider_payment_charge_id", providerPaymentChargeId, "", false);
}
Expand Down

0 comments on commit 5c5abb0

Please sign in to comment.