-
Notifications
You must be signed in to change notification settings - Fork 3
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 #42 from buckaroo-it/examples
BA-119 Add more transaction examples
- Loading branch information
Showing
68 changed files
with
2,300 additions
and
5 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,87 @@ | ||
import buckarooClient from '../buckarooClient'; | ||
import { getIPAddress, RecipientCategory, uniqid } from '../../src'; | ||
|
||
const afterpay = buckarooClient.method('afterpay'); | ||
|
||
//Pay | ||
afterpay | ||
.pay({ | ||
invoice: 'Riverty Pay', | ||
clientIP: getIPAddress(), | ||
amountDebit: 100, | ||
billing: { | ||
recipient: { | ||
category: RecipientCategory.PERSON, | ||
firstName: 'Test', | ||
lastName: 'Acceptatie', | ||
birthDate: '01-01-1990', | ||
}, | ||
address: { | ||
street: 'Hoofdstraat', | ||
houseNumber: '80', | ||
zipcode: '8441ER', | ||
city: 'Heerenveen', | ||
country: 'NL', | ||
}, | ||
email: '[email protected]', | ||
phone: { | ||
mobile: '0612345678', | ||
landline: '0201234567', | ||
}, | ||
}, | ||
articles: [ | ||
{ | ||
vatPercentage: 21, | ||
price: 10, | ||
description: 'Test', | ||
quantity: 4, | ||
identifier: 'test', | ||
}, | ||
], | ||
}) | ||
.request(); | ||
//Refund | ||
afterpay | ||
.refund({ | ||
originalTransactionKey: 'XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX', | ||
amountCredit: 10.1, | ||
invoice: 'Riverty refund', | ||
}) | ||
.request(); | ||
//Authorize | ||
afterpay | ||
.pay({ | ||
invoice: 'Riverty Pay', | ||
clientIP: getIPAddress(), | ||
amountDebit: 100, | ||
billing: { | ||
recipient: { | ||
category: RecipientCategory.PERSON, | ||
firstName: 'Test', | ||
lastName: 'Acceptatie', | ||
birthDate: '01-01-1990', | ||
}, | ||
address: { | ||
street: 'Hoofdstraat', | ||
houseNumber: '80', | ||
zipcode: '8441ER', | ||
city: 'Heerenveen', | ||
country: 'NL', | ||
}, | ||
email: '[email protected]', | ||
phone: { | ||
mobile: '0612345678', | ||
landline: '0201234567', | ||
}, | ||
}, | ||
articles: [ | ||
{ | ||
vatPercentage: 21, | ||
price: 10, | ||
description: 'Test', | ||
quantity: 4, | ||
identifier: 'test', | ||
}, | ||
], | ||
}) | ||
.request(); |
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,87 @@ | ||
import buckarooClient from '../buckarooClient'; | ||
import { RecipientCategory, getIPAddress } from '../../src'; | ||
|
||
const afterpay = buckarooClient.method('afterpay'); | ||
|
||
//Pay | ||
afterpay | ||
.pay({ | ||
invoice: 'Riverty Pay', | ||
clientIP: getIPAddress(), | ||
amountDebit: 100, | ||
billing: { | ||
recipient: { | ||
category: RecipientCategory.PERSON, | ||
firstName: 'Test', | ||
lastName: 'Acceptatie', | ||
birthDate: '01-01-1990', | ||
}, | ||
address: { | ||
street: 'Hoofdstraat', | ||
houseNumber: '80', | ||
zipcode: '8441ER', | ||
city: 'Heerenveen', | ||
country: 'NL', | ||
}, | ||
email: '[email protected]', | ||
phone: { | ||
mobile: '0612345678', | ||
landline: '0201234567', | ||
}, | ||
}, | ||
articles: [ | ||
{ | ||
vatPercentage: 21, | ||
price: 10, | ||
description: 'Test', | ||
quantity: 4, | ||
identifier: 'test', | ||
}, | ||
], | ||
}) | ||
.request(); | ||
//Refund | ||
afterpay | ||
.refund({ | ||
originalTransactionKey: 'XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX', | ||
amountCredit: 10.1, | ||
invoice: 'Riverty refund', | ||
}) | ||
.request(); | ||
//Authorize | ||
afterpay | ||
.authorize({ | ||
invoice: 'Riverty Pay', | ||
clientIP: getIPAddress(), | ||
amountDebit: 100, | ||
billing: { | ||
recipient: { | ||
category: RecipientCategory.PERSON, | ||
firstName: 'Test', | ||
lastName: 'Acceptatie', | ||
birthDate: '01-01-1990', | ||
}, | ||
address: { | ||
street: 'Hoofdstraat', | ||
houseNumber: '80', | ||
zipcode: '8441ER', | ||
city: 'Heerenveen', | ||
country: 'NL', | ||
}, | ||
email: '[email protected]', | ||
phone: { | ||
mobile: '0612345678', | ||
landline: '0201234567', | ||
}, | ||
}, | ||
articles: [ | ||
{ | ||
vatPercentage: 21, | ||
price: 10, | ||
description: 'Test', | ||
quantity: 4, | ||
identifier: 'test', | ||
}, | ||
], | ||
}) | ||
.request(); |
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,18 @@ | ||
import buckarooClient from '../buckarooClient'; | ||
const alipay = buckarooClient.method('alipay'); | ||
//Pay | ||
alipay | ||
.pay({ | ||
amountDebit: 10.1, | ||
description: 'Alipay Payment', | ||
useMobileView: false, | ||
}) | ||
.request(); | ||
//Refund | ||
alipay | ||
.refund({ | ||
originalTransactionKey: 'XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX', | ||
amountCredit: 10.1, | ||
invoice: 'Alipay Refund' | ||
}) | ||
.request(); |
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,20 @@ | ||
import buckarooClient from '../buckarooClient'; | ||
|
||
const alipay = buckarooClient.method('alipay'); | ||
|
||
//Pay | ||
alipay | ||
.pay({ | ||
amountDebit: 10.1, | ||
description: 'Alipay Payment', | ||
useMobileView: false, | ||
}) | ||
.request(); | ||
//Refund | ||
alipay | ||
.refund({ | ||
originalTransactionKey: 'XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX', | ||
amountCredit: 10.1, | ||
invoice: 'Alipay Refund', | ||
}) | ||
.request(); |
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 buckarooClient from '../buckarooClient'; | ||
const applepay = buckarooClient.method('applepay'); | ||
//Pay | ||
applepay | ||
.pay({ | ||
amountDebit: 10.1, | ||
description: 'ApplePay Payment' | ||
paymentData: 'XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX', | ||
customerCardName: 'XXXXXXX', | ||
}) | ||
.request(); | ||
//Refund | ||
applepay | ||
.refund({ | ||
originalTransactionKey: 'XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX', | ||
amountCredit: 10.1, | ||
invoice: 'ApplePay Refund' | ||
}) | ||
.request(); |
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,21 @@ | ||
import buckarooClient from '../buckarooClient'; | ||
|
||
const applepay = buckarooClient.method('applepay'); | ||
|
||
//Pay | ||
applepay | ||
.pay({ | ||
amountDebit: 10.1, | ||
description: 'ApplePay Payment', | ||
paymentData: 'XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX', | ||
customerCardName: 'XXXXXXX', | ||
}) | ||
.request(); | ||
//Refund | ||
applepay | ||
.refund({ | ||
originalTransactionKey: 'XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX', | ||
amountCredit: 10.1, | ||
invoice: 'ApplePay Refund', | ||
}) | ||
.request(); |
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,53 @@ | ||
import buckarooClient from '../buckarooClient'; | ||
const bancontact = buckarooClient.method('bancontactmrcash'); | ||
//Pay | ||
bancontact | ||
.pay({ | ||
amountDebit: 10.1, | ||
description: 'Bancontact Payment', | ||
}) | ||
.request(); | ||
//Refund | ||
bancontact | ||
.refund({ | ||
originalTransactionKey: 'XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX', | ||
amountCredit: 10.1, | ||
invoice: 'Bancontact refund', | ||
}) | ||
.request(); | ||
//Authenticate | ||
bancontact | ||
.authenticate({ | ||
invoice: 'BancontactAuthenticate', | ||
amountDebit: 10.1, | ||
description: 'Bancontact Authenticate', | ||
}) | ||
.request(); | ||
//PayOneClick | ||
bancontact | ||
.payOneClick({ | ||
invoice: 'Bancontact PayOneClick', | ||
originalTransactionKey: 'XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX', | ||
amountDebit: 100, | ||
}) | ||
.request(); | ||
//CompletePayment | ||
bancontact | ||
.completePayment({ | ||
originalTransactionKey: 'XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX', | ||
encryptedCardData: 'XXXXXXXXXXXXXXXXXXXXXXXX', | ||
}) | ||
//PayEncrypted | ||
bancontact | ||
.payEncrypted({ | ||
amountDebit: 100, | ||
encryptedCardData: 'XXXXXXXXXXXXXXXXXXXXXXXX', | ||
invoice: 'Bancontact PayEncrypred', | ||
}) | ||
//PayRecurring | ||
bancontact | ||
.payRecurring({ | ||
amountDebit: 100, | ||
encryptedCardData: 'XXXXXXXXXXXXXXXXXXXXXXXX', | ||
invoice: 'Bancontact PayRecurring', | ||
}) |
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,55 @@ | ||
import buckarooClient from '../buckarooClient'; | ||
|
||
const bancontact = buckarooClient.method('bancontactmrcash'); | ||
|
||
//Pay | ||
bancontact | ||
.pay({ | ||
amountDebit: 10.1, | ||
description: 'Bancontact Payment', | ||
}) | ||
.request(); | ||
//Refund | ||
bancontact | ||
.refund({ | ||
originalTransactionKey: 'XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX', | ||
amountCredit: 10.1, | ||
invoice: 'Bancontact Refund', | ||
}) | ||
.request(); | ||
//Authenticate | ||
bancontact | ||
.authenticate({ | ||
invoice: 'BancontactAuthenticate', | ||
amountDebit: 10.1, | ||
description: 'Bancontact Authenticate', | ||
}) | ||
.request(); | ||
//PayOneClick | ||
bancontact | ||
.payOneClick({ | ||
invoice: 'Bancontact PayOneClick', | ||
originalTransactionKey: 'XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX', | ||
amountDebit: 100, | ||
}) | ||
.request(); | ||
//CompletePayment | ||
bancontact | ||
.completePayment({ | ||
originalTransactionKey: 'XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX', | ||
encryptedCardData: 'XXXXXXXXXXXXXXXXXXXXXXXX', | ||
}) | ||
//PayEncrypted | ||
bancontact | ||
.payEncrypted({ | ||
amountDebit: 100, | ||
encryptedCardData: 'XXXXXXXXXXXXXXXXXXXXXXXX', | ||
invoice: 'Bancontact PayEncrypred', | ||
}) | ||
//PayRecurring | ||
bancontact | ||
.payRecurring({ | ||
amountDebit: 100, | ||
encryptedCardData: 'XXXXXXXXXXXXXXXXXXXXXXXX', | ||
invoice: 'Bancontact PayRecurring', | ||
}) |
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,28 @@ | ||
import buckarooClient from '../buckarooClient'; | ||
import { Gender } from '../../src'; | ||
|
||
const transfer = buckarooClient.method('transfer'); | ||
|
||
//Pay | ||
transfer | ||
.pay({ | ||
amountDebit: 10.1, | ||
description: 'Transfer Payment', | ||
customer: { | ||
firstName: 'Test', | ||
lastName: 'Acceptatie', | ||
gender: Gender.MALE, | ||
}, | ||
email: '[email protected]', | ||
sendMail: true, | ||
dateDue: '2024-10-10', | ||
}) | ||
.request(); | ||
//Refund | ||
transfer | ||
.refund({ | ||
originalTransactionKey: 'XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX', | ||
amountCredit: 10.1, | ||
invoice: 'Transfer Refund', | ||
}) | ||
.request(); |
Oops, something went wrong.