@permettezmoideconstruire/alma-client
See Documentation
Install
yarn add @permettezmoideconstruire/alma-client
Usage
import type { AxiosResponse } from 'axios'
import {
getClient,
createPayment,
AlmaPaymentOrderPayload,
AlmaPayment
} from '@permettezmoideconstruire/alma-client'
const almaClient = getClient(
process.env.ALMA_API_KEY,
process.env.ALMA_API_ENDPOINT
)
const paymentOrderPayload: AlmaPaymentOrderPayload = {
payment: {
billing_address: {
country: 'France'
},
purchase_amount: 150000
}
}
const result: AxiosResponse<Payment> = await createPayment(almaClient)(paymentOrderCreation)
const payment: Payment = result.data