Answer:
The journal entries to record the whole purchase and payment process are:
May 1, purchase of merchandise on account
Dr Merchandise inventory 400
  Cr Accounts payable 400
May 3, defective merchandise returned
Dr Accounts payable 50
  Cr Purchase returns and allowances 50
Dr Purchase returns and allowances 50
  Cr Merchandise inventory 50
May 10? payment of merchandise account
Dr Accounts payable 350
  Cr Cash 343
  Cr Purchases discounts 7