Fetch Reference Number
For withdrawals, retrieve the reference number from MoneyGram’s API or UI (external_transaction_id or more_info_url) when the status is pending_user_transfer_complete. For deposits, no reference number is provided; the user drops off cash at the selected agent.
// Watcher's onMessage callback, see previous steps for more info on this
onMessage: (transaction) => {
if (transaction.status === "pending_user_transfer_complete") {
console.log(
`Transaction reference number ${transaction.external_transaction_id}`,
`also viewable at ${transaction.more_info_url}`,
);
}
};
from .api import poll_transction_until_status
response_body = poll_transaction_until_status(
transaction_id,
"pending_user_transfer_complete"
)
tx_dict = response_body["transaction"]
print(
f"Transaction reference number {tx_dict['external_transaction_id']} "
f"also viewable at {tx_dict['more_info_url']}"
)
Updated 15 days ago