const styles = {
sdkCard: {
base: {
backgroundColor: '#f9f9f9',
borderRadius: 10,
padding: 16,
boxShadow: '0px 4px 12px rgba(0, 0, 0, 0.1)',
},
},
cardForm: {
base: {
backgroundColor: '#ffffff',
borderRadius: 10,
padding: 16,
borderWidth: 1,
borderColor: '#e3e3e3',
marginVertical: 8,
},
inputStyles: {
base: {
borderWidth: 1,
borderColor: '#cccccc',
borderRadius: 6,
padding: 12,
fontSize: 16,
marginBottom: 10,
color: '#333',
},
},
labelStyles: {
base: {
fontSize: 14,
color: '#666',
marginBottom: 6,
},
},
},
savedCards: {
base: {
backgroundColor: '#f9f9f9',
borderRadius: 8,
padding: 10,
marginVertical: 6,
borderWidth: 1,
borderColor: '#e3e3e3',
},
},
paymentRadio: {
base: {
flexDirection: 'row',
alignItems: 'center',
padding: 10,
backgroundColor: '#f9f9f9',
borderRadius: 8,
borderWidth: 1,
borderColor: '#e3e3e3',
},
},
paymentButton: {
base: {
backgroundColor: '#007AFF',
paddingVertical: 15,
paddingHorizontal: 20,
borderRadius: 8,
alignItems: 'center',
fontSize: 18,
color: '#fff',
fontWeight: '600',
},
},
paymentMethods: {
base: {
paddingVertical: 10,
backgroundColor: '#f9f9f9',
},
radioBase: {
width: 20,
height: 20,
borderRadius: 10,
borderWidth: 2,
borderColor: '#007AFF',
marginHorizontal: 10,
},
},
successMessage: {
base: {
color: '#28a745',
fontWeight: '600',
fontSize: 16,
textAlign: 'center',
marginTop: 20,
},
},
errorMessage: {
base: {
color: '#dc3545',
fontSize: 14,
marginTop: 4,
},
},
};
const { create } = useTonder<SDKType.INLINE>();
const { error } = await create({
secureToken: 'your-secure-token',
paymentData: { ...paymentData },
customization: {
saveCards: {
showSaveCardOption: true,
showSaved: true,
},
paymentButton: {
show: true,
showAmount: false,
},
labels: {
name: 'Cardholder Name',
cvv: 'CVV',
cardNumber: 'Card Number',
expiryDate: 'Expiration Date',
},
placeholders: {
cvv: '123',
name: 'John Doe',
cardNumber: '4242 4242 4242 4242',
expiryMonth: 'MM',
expiryYear: 'YY',
},
styles: styles,
},
callbacks: {
onFinishPayment: callbackFinish,
},
});