Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rename refid to idempotencyid #21

Merged
merged 3 commits into from
Mar 30, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion components/CreateCardForm.vue
Original file line number Diff line number Diff line change
Expand Up @@ -211,7 +211,7 @@ export default class CreateCardFormClass extends Vue {
const { expiry, ...billingDetails } = data

const payload: CreateCardPayload = {
refId: uuidv4(),
idempotencyKey: uuidv4(),
expMonth: parseInt(expiry.month),
expYear: parseInt(expiry.year),
verificationMethod: 'cvv',
Expand Down
2 changes: 1 addition & 1 deletion lib/cardsApi.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ export interface UpdateCardPayload {
}

export interface CreateCardPayload {
refId: string
idempotencyKey: string
keyId: string
encryptedData: string
billingDetails: {
Expand Down
4 changes: 2 additions & 2 deletions lib/marketplaceApi.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ export interface MarketplaceInfo {
}

export interface CreateMarketplacePaymentPayload {
refId: string
idempotencyKey: string
amount: {
amount: string
currency: string
Expand All @@ -34,7 +34,7 @@ export interface CreateMarketplacePaymentPayload {
}

export interface RefundPaymentPayload {
refId: string
idempotencyKey: string
amount: {
amount: string
currency: string
Expand Down
4 changes: 2 additions & 2 deletions lib/paymentsApi.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ interface MetaData {
}

export interface CreatePaymentPayload {
refId: string
idempotencyKey: string
amount: {
amount: string
currency: string
Expand All @@ -27,7 +27,7 @@ export interface CreatePaymentPayload {
}

export interface RefundPaymentPayload {
refId: string
idempotencyKey: string
amount: {
amount: string
currency: string
Expand Down
2 changes: 1 addition & 1 deletion pages/debug/cards/create.vue
Original file line number Diff line number Diff line change
Expand Up @@ -182,7 +182,7 @@ export default class CreateCardClass extends Vue {
const { expiry, verificationMethod, ...billingDetails } = data

const payload: CreateCardPayload = {
refId: uuidv4(),
idempotencyKey: uuidv4(),
expMonth: parseInt(expiry.month),
expYear: parseInt(expiry.year),
verificationMethod,
Expand Down
2 changes: 1 addition & 1 deletion pages/debug/marketplace/payments/cancel.vue
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ export default class CancelPaymentClass extends Vue {
this.loading = true

const payload = {
refId: uuidv4()
idempotencyKey: uuidv4()
}

try {
Expand Down
2 changes: 1 addition & 1 deletion pages/debug/marketplace/payments/create.vue
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@ export default class CreatePaymentClass extends Vue {
}

const payload: CreateMarketplacePaymentPayload = {
refId: uuidv4(),
idempotencyKey: uuidv4(),
amount: amountDetail,
verificationMethod: this.formData.verificationMethod,
source: sourceDetails,
Expand Down
9 changes: 6 additions & 3 deletions pages/debug/marketplace/payments/refund.vue
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,10 @@
<v-form>
<v-text-field v-model="formData.paymentId" label="Payment Id" />

<v-text-field v-model="formData.refId" label="Reference Id" />
<v-text-field
v-model="formData.idempotencyKey"
label="Idempotency Key"
/>

<v-text-field v-model="formData.amount" label="Amount" />

Expand Down Expand Up @@ -60,7 +63,7 @@ export default class RefundPaymentClass extends Vue {
// data
formData = {
paymentId: '',
refId: '',
idempotencyKey: '',
amount: '0.00'
}
required = [(v: string) => !!v || 'Field is required']
Expand All @@ -83,7 +86,7 @@ export default class RefundPaymentClass extends Vue {
}

const payload: RefundPaymentPayload = {
refId: this.formData.refId,
idempotencyKey: this.formData.idempotencyKey,
amount: amountDetail
}

Expand Down
2 changes: 1 addition & 1 deletion pages/debug/payments/cancel.vue
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ export default class CancelPaymentClass extends Vue {
this.loading = true

const payload = {
refId: uuidv4()
idempotencyKey: uuidv4()
}

try {
Expand Down
2 changes: 1 addition & 1 deletion pages/debug/payments/create.vue
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ export default class CreatePaymentClass extends Vue {
}

const payload: CreatePaymentPayload = {
refId: uuidv4(),
idempotencyKey: uuidv4(),
amount: amountDetail,
verificationMethod: this.formData.verificationMethod,
source: sourceDetails,
Expand Down
9 changes: 6 additions & 3 deletions pages/debug/payments/refund.vue
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,10 @@
<v-form>
<v-text-field v-model="formData.paymentId" label="Payment Id" />

<v-text-field v-model="formData.refId" label="Reference Id" />
<v-text-field
v-model="formData.idempotencyKey"
label="Idempotency Key"
/>

<v-text-field v-model="formData.amount" label="Amount" />

Expand Down Expand Up @@ -60,7 +63,7 @@ export default class RefundPaymentClass extends Vue {
// data
formData = {
paymentId: '',
refId: '',
idempotencyKey: '',
amount: '0.00'
}
required = [(v: string) => !!v || 'Field is required']
Expand All @@ -83,7 +86,7 @@ export default class RefundPaymentClass extends Vue {
}

const payload: RefundPaymentPayload = {
refId: this.formData.refId,
idempotencyKey: this.formData.idempotencyKey,
amount: amountDetail
}

Expand Down
2 changes: 1 addition & 1 deletion pages/flow/charge/existing-card/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -308,7 +308,7 @@ export default class CardFlowClass extends Vue {
}

const payload: CreatePaymentPayload = {
refId: uuidv4(),
idempotencyKey: uuidv4(),
amount: amountDetail,
verificationMethod: 'cvv',
source: sourceDetails,
Expand Down
4 changes: 2 additions & 2 deletions pages/flow/charge/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -360,7 +360,7 @@ export default class ChargeFlowClass extends Vue {
this.loading = true

const payload: CreateCardPayload = {
refId: uuidv4(),
idempotencyKey: uuidv4(),
expMonth: parseInt(this.formData.cardData.expiry.month),
expYear: parseInt(this.formData.cardData.expiry.year),
verificationMethod: 'none',
Expand Down Expand Up @@ -416,7 +416,7 @@ export default class ChargeFlowClass extends Vue {
}

const payload: CreatePaymentPayload = {
refId: uuidv4(),
idempotencyKey: uuidv4(),
amount: amountDetail,
verificationMethod: 'cvv',
source: sourceDetails,
Expand Down