anzworldline
v1.0.0
Published
ANZ Worldline SDK for Node.js.
Maintainers
Readme
anzworldline
ANZ Worldline SDK for Node.js.
Install
$ npm i anzworldline --saveExample
import AnzWorldline from 'anzworldline'
const anzworldlineClient = new AnzWorldline({
merchantId: 'xxx',
apiKey: 'xxx',
apiSecret: 'xxx',
environment: 'sandbox'
})
;(async () => {
const createHostedcheckoutRes = await anzworldlineClient.execute({
method: 'POST',
url: `/v2/${anzWorldlineClient.merchantId}/hostedcheckouts`,
body: {
hostedCheckoutSpecificInput: {
locale: 'en_AU'
},
order: {
amountOfMoney: {
amount: 100,
currencyCode: 'AUD'
},
customer: {
merchantCustomerId: 'mc_637521911919765074',
locale: 'en_AU',
personalInformation: {
name: {
title: 'Mr.',
firstName: 'Wile',
surname: 'Coyote'
},
gender: 'male',
dateOfBirth: '19490917'
},
companyInformation: {
name: 'Uluru Enterprises'
},
billingAddress: {
street: 'Elizabeth St',
houseNumber: '3',
additionalInfo: 'floor 9',
zip: '2000',
city: 'Sydney',
state: 'New South Wales',
countryCode: 'AU'
},
contactDetails: {
emailAddress: '[email protected]',
phoneNumber: '+611234567890',
faxNumber: '+611234567891'
},
fiscalNumber: '12345678983'
},
shipping: {
address: {
additionalInfo: 'floor 9',
city: 'Sydney',
countryCode: 'AU',
houseNumber: '3',
state: 'New South Wales',
street: 'Elizabeth St',
zip: '2000',
name: {
title: 'Mrs.',
firstName: 'road',
surname: 'runner'
}
},
addressIndicator: 'same-as-billing',
emailAddress: '[email protected]',
firstUsageDate: '20230101',
isFirstUsage: true,
method: {
type: 'carrier-low-cost',
speed: 24,
details: 'ship-fast',
name: 'fast-delivery'
},
type: 'overnight',
shippingCost: 0,
shippingCostTax: 0
}
}
}
})
/*
{
RETURNMAC: 'bb446997-237d-41b5-bd35-0f742c6051e7',
hostedCheckoutId: '4458649002',
merchantReference: '66f61abdbdc348c6b9c7bd7a7a15a6aa',
redirectUrl: 'https://payment.preprod.anzworldline-solutions.com.au/hostedcheckout/PaymentMethods/Selection/0d5307eff7664859b3f6e8e283a06b8e',
partialRedirectUrl: 'preprod.anzworldline-solutions.com.au/hostedcheckout/PaymentMethods/Selection/0d5307eff7664859b3f6e8e283a06b8e'
}
*/
console.dir(createHostedcheckoutRes, { depth: 10 })
const hostedcheckout = await anzWorldlineClient.execute({
method: 'GET',
url: `/v2/${anzWorldlineClient.merchantId}/hostedcheckouts/${createHostedcheckoutRes.hostedCheckoutId}`
})
/*
{
createdPaymentOutput: {
payment: {
hostedCheckoutSpecificOutput: { hostedCheckoutId: '4458649002' },
paymentOutput: {
amountOfMoney: { amount: 100, currencyCode: 'AUD' },
references: { merchantReference: '66f61abdbdc348c6b9c7bd7a7a15a6aa' },
acquiredAmount: { amount: 100, currencyCode: 'AUD' },
customer: { device: { ipAddressCountryCode: '99' } },
cardPaymentMethodSpecificOutput: {
paymentProductId: 1,
authorisationCode: '685351',
card: {
cardNumber: '************4242',
expiryDate: '0226',
bin: '424242',
countryCode: '99'
},
fraudResults: {
fraudServiceResult: 'no-advice',
avsResult: 'X',
cvvResult: 'M'
},
schemeReferenceData: '861961576115',
paymentAccountReference: 'HJAM4FCO82VQNCX59ABSNRSVTNR2V',
threeDSecureResults: {
version: '2.2.0',
flow: 'challenge',
cavv: 'kANnMdSX47pGwDsg15UKaJeB6eJl',
eci: '5',
schemeEci: '05',
authenticationStatus: 'Y',
acsTransactionId: 'A4DCDBC9-98CB-450D-9535-3D6BED79C2A5',
dsTransactionId: 'D7B76870-0765-4F36-A9F1-C5B23D35D3E2',
xid: 'NDQ1ODY0OTAwMg==',
liability: 'issuer'
},
token: '4ad74591-0584-4751-9110-fc7760fa8bd4',
acquirerInformation: { name: 'WLAU' },
cobrandSelectionIndicator: 'alternative',
acceptance: { authorizationDate: '2026-01-24T08:51:13Z' }
},
paymentMethod: 'card',
transactionDate: '2026-01-24T07:48:43.6284794Z'
},
status: 'PENDING_CAPTURE',
statusOutput: {
isCancellable: true,
statusCategory: 'PENDING_MERCHANT',
statusCode: 5,
isAuthorized: true,
isRefundable: false
},
id: '9000004458649002000'
},
paymentStatusCategory: 'SUCCESSFUL'
},
status: 'PAYMENT_CREATED'
}
*/
console.dir(hostedcheckout, { depth: 10 })
})().catch(console.error)