Skip to content

Commit

Permalink
Add change payment methods
Browse files Browse the repository at this point in the history
  • Loading branch information
Dušan Bobičić committed Oct 1, 2024
1 parent 0c1db95 commit 7adc4b2
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -17,5 +17,5 @@ export interface ChangePaymentMethodRequest {
}
export interface ChangePaymentMethodResponse {
snippet: string;
expiration: Date;
expiration: string;
}
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import { useState } from "react";
import { TextField, Button, Grid, Box, Typography, Card } from "@mui/material";
import axios from "axios";
import {
OrderData,
RecurringToken,
Expand Down Expand Up @@ -47,11 +46,12 @@ const TokenManagementPage: React.FC = () => {
const handleChangePaymentMethod = async () => {
try {
const response = await CheckoutService.recurring.changePaymentMethods(
{ termsUrl: "" },
{ termsUrl: "https://svea.com" },
recurringToken,
merchantId
);
setPaymentMethodChangeResponse(response.data);
console.log(response.data)
} catch (error) {
console.error("Error changing payment method:", error);
}
Expand Down Expand Up @@ -173,7 +173,9 @@ const TokenManagementPage: React.FC = () => {
Payment Method Change Response
</Typography>
<Typography variant="body1">
Response: {paymentMethodChangeResponse}
Expiration:{" "}
{paymentMethodChangeResponse.expiration}
Snippet: {paymentMethodChangeResponse.snippet}
</Typography>
{/* Add more response fields as necessary */}
</Box>
Expand Down

0 comments on commit 7adc4b2

Please sign in to comment.