Refund
Last updated
Was this helpful?
Was this helpful?
from hyperswitch_prism import PaymentClient
payment_client = PaymentClient(
connector='stripe',
api_key='YOUR_API_KEY',
environment='SANDBOX'
)request = {
"merchant_refund_id": "refund_001",
"connector_transaction_id": "pi_3Oxxx...",
"reason": "Customer returned item"
}
response = await payment_client.refund(request)request = {
"merchant_refund_id": "refund_partial_001",
"connector_transaction_id": "pi_3Oxxx...",
"amount": {
"minor_amount": 500, # $5.00 of $10.00
"currency": "USD"
},
"reason": "Discount applied"
}
response = await payment_client.refund(request){
"merchant_refund_id": "refund_001",
"connector_refund_id": "re_3Oxxx...",
"status": "PENDING",
"amount": {
"minor_amount": 1000,
"currency": "USD"
},
"status_code": 200
}