Skip to content

Commit

Permalink
fix: output refund transaction object info (since PayPal is undocumen…
Browse files Browse the repository at this point in the history
…ted)
  • Loading branch information
titanism committed Jul 13, 2022
1 parent 080fa31 commit 1950e23
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions jobs/paypal/sync-paypal-subscription-payments.js
Original file line number Diff line number Diff line change
Expand Up @@ -164,8 +164,13 @@ async function syncPaypalSubscriptionPayments({ errorThreshold }) {

// if the transaction was refunded or partially
// refunded then we need to check and update it
if (transaction.status === 'REFUNDED') amountRefunded = amount;
else if (transaction.status === 'PARTIALLY_REFUNDED') {
if (transaction.status === 'REFUNDED') {
// TODO: remove this once we know the API response to parse for below partial refund (since it's undocumented)
logger.info('fully refunded', {
transaction: JSON.stringify(transaction, null, 2)
});
amountRefunded = amount;
} else if (transaction.status === 'PARTIALLY_REFUNDED') {
// TODO: finish this once we know the API response to parse (since it's undocumented)
logger.info('partially refunded', {
transaction: JSON.stringify(transaction, null, 2)
Expand Down

0 comments on commit 1950e23

Please sign in to comment.