diff --git a/Integrasi SWIFT (Python) b/Integrasi SWIFT (Python) new file mode 100644 index 000000000..a8978b151 --- /dev/null +++ b/Integrasi SWIFT (Python) @@ -0,0 +1,41 @@ +import requests + +def send_swift_message(sender_bank, sender_account, receiver_bank, receiver_account, amount, currency): + swift_message = f""" + + + + {sender_bank}-{receiver_bank}-001 + 2024-11-23T10:00:00 + 1 + + CLRG + + + + + {sender_account}-TX001 + {receiver_account}-TX001 + + + {amount} + + + + {receiver_bank} + + + + {receiver_account} + + + + + """ + # Send the SWIFT message to the receiver bank's endpoint + response = requests.post( + url="https://api.swiftbank.com/send", + headers={"Content-Type": "application/xml"}, + data=swift_message, + ) + return response.status_code, response.text