Skip to content
This repository has been archived by the owner on May 24, 2023. It is now read-only.

Commit

Permalink
#62 document the edge cases
Browse files Browse the repository at this point in the history
  • Loading branch information
lojzatran committed Sep 13, 2017
1 parent dcefe2f commit 4c174f9
Showing 1 changed file with 20 additions and 0 deletions.
20 changes: 20 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -168,3 +168,23 @@ Additionally, response can contain additional response body. All fields of the r
"payment": {"id":"XXX", "intent":"sale", ...} # only in case of getting the payment object
}
```

## Possible edge cases
1. First case:
1. user inputs an address Berlin, Germany
1. he clicks on Continue and is redirected to Paypal payment page with this address.
1. In a different tab, the same user changes his address to Paris, France.
1. The user confirms the payment in the first tab
1. Paypal has the address of Berlin, but the shop will deliver the goods to Paris.

**Possible solution:** the backend calls `patch/payments` endpoint every time user changes it.

1. Second case:
1. user has cart with item1=10€
1. user is redirected to Paypal payment page
1. in a different tab, user changes his cart to e.g. item2=20€
1. user completes the payment in the first tab
1. paypal approves the payment for 10€, but the real total amount has changed to 20€

**Possible solution:** the backend has to compare total amount of the payment and total amount of payment's cart before calling `patch/payments` endpoint.
In case of differences, the whole payment process must be restarted.

0 comments on commit 4c174f9

Please sign in to comment.