0.4.0 • Published 4 years ago
@permettezmoideconstruire/alma-client v0.4.0
@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'
// This creates and configure
// dedicated Axios instance for Alma
const almaClient = getClient(
process.env.ALMA_API_KEY,
// Optional but typically useful to switch to sandbox API endpoint
process.env.ALMA_API_ENDPOINT
)
// API types helpers for payloads
const paymentOrderPayload: AlmaPaymentOrderPayload = {
payment: {
billing_address: {
country: 'France'
},
purchase_amount: 150000
}
}
// Each call is curryfied : method(almaClient)(data / options)
const result: AxiosResponse<Payment> = await createPayment(almaClient)(paymentOrderCreation)
// API types for returns
const payment: Payment = result.data
0.4.0
4 years ago
0.3.1
4 years ago
0.3.1-1
4 years ago
0.3.1-0
4 years ago
0.3.0
4 years ago
0.2.1
4 years ago
0.2.0
4 years ago
0.1.0
4 years ago
0.1.1
4 years ago
0.0.11
4 years ago
0.0.10
4 years ago
0.0.9
4 years ago
0.0.8
4 years ago
0.0.7
4 years ago
0.0.6
4 years ago
0.0.5
4 years ago
0.0.4
4 years ago
0.0.3
4 years ago
0.0.2
4 years ago
0.0.1
4 years ago