-
Notifications
You must be signed in to change notification settings - Fork 137
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1593 from Adyen/feature/sessions-onOrderCancel
Add onOrderCancel to sessions
- Loading branch information
Showing
5 changed files
with
68 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
import { httpPost } from '../http'; | ||
import Session from '../../CheckoutSession'; | ||
import {CheckoutSessionOrdersResponse, Order} from '../../../types'; | ||
import { API_VERSION } from './constants'; | ||
|
||
/** | ||
*/ | ||
function cancelOrder(order: Order, session: Session): Promise<CheckoutSessionOrdersResponse> { | ||
const path = `${API_VERSION}/sessions/${session.id}/orders/cancel?clientKey=${session.clientKey}`; | ||
|
||
const data = { | ||
sessionData: session.data, | ||
order: order | ||
}; | ||
|
||
return httpPost({ loadingContext: session.loadingContext, path, errorLevel: 'fatal' }, data); | ||
} | ||
|
||
export default cancelOrder; |