Gmail과 Make로 PayPal 결제 내역 자동화 시도기 – 실패에서 배우는 자동화의 현실

소개

안녕하세요 😊 저는 해외 고객을 대상으로 디지털 콘텐츠를 판매하고 있으며, 주로 PayPal을 통해 결제를 받고 있습니다.

처음엔 Gmail로 들어오는 PayPal 결제 완료 메일을 하나하나 열어보며,

  • 고객 이름

  • 결제 금액

  • 결제 날짜

  • 고객 국가

이런 정보를 수작업으로 정리했어요. 그런데 거래가 많아질수록 시간이 너무 오래 걸리고 실수도 잦아졌습니다.

게다가 저는 세금 신고 시 영세율 혜택을 받기 위해 외화 결제 내역을 명확히 정리해둘 필요가 있었죠. 그래서 이 반복 작업을 Make를 활용해 자동화해보기로 했습니다.

진행 방법

사용한 도구

  • Make (옛 Integromat)

  • Gmail 모듈

  • Airtable

시도한 자동화 구조

  1. Gmail 모듈로 "거래 세부 내역" 텍스트를 감지

  2. 메일 본문에서 다음 정보 추출:

    • 고객 이름

    • 결제 금액

    • 결제 날짜 등등

  3. Airtable에 자동 입력되도록 설정

처음에는 구조도 간단해 보였고, “이제부터 내역정리가 편해지겠구나!” 하는 기대감이 컸습니다.

하지만 현실은 예상과 많이 달랐습니다. 😅

문제 발생

  • PayPal 메일은 템플릿으로 제작되어있어서 포함하는 내용이 많았어요.

  • 텍스트 중간중간에 복잡한 태그, 불필요한 문구, 표 형식 구조가 들어가 있어서...

  • 단순한 정규표현식이나 텍스트 추출로는 원하는 값을 뽑아내는 게 거의 불가능했습니다.

메일 내용이 다음처럼 들어있어요:


    {
        "text": "CHOI HYUNJI 님, $87.00 USD으,; 의 결제대금을 받았습니다. choi hyunji 님, 안녕하세요? PayPal [https://www.paypalobjects.com/digitalassets/c/system-triggered-email/n/layout/images/ppe/pp-logo_x2.png] 인보이스에 대해 $87.00 USD의 결제대금을 받았습니다. PayPal 이용에 감사드립니다. 결제 세부정보가 인보이스에 표시됩니다. 거래 세부정보를 확인하여 PayPal 판매자 보호 적용 대상인지 확인하세요. 판매자 보호 [https://www.paypal.com/kr/webapps/mpp/paypal-seller-protection?v=1&utm_source=unp&utm_medium=email&utm_campaign=RT000610&utm_unptid=f9d95a18-3b0d-11f0-ad94-950335978b83&ppid=RT000610&cnac=KR&rsta=ko_KR%28ko-KR%29&cust=FYTCUMLGTX87C&unptid=f9d95a18-3b0d-11f0-ad94-950335978b83&calc=f262876487781&unp_tpcid=invoice-merchant-payment-notification&page=main%3Aemail%3ART000610&pgrp=main%3Aemail&e=cl&mchn=em&s=ci&mail=sys&appVersion=1.332.0&tenant_name=PAYPAL&xt=145585%2C154413%2C104038&link_ref=mpp_paypal-seller-protection] 더 알아보기 님이 제공한 주소가 확인되지 않았습니다. 거래 ID 1PJ31748BC137540B 인보이스 번호 0093 PayPal 판매자 보호 - 부분 보호 대상 인보이스 보기 [https://www.paypal.com/invoice/details/INV2-77ZM-EP3J-CF98-UWXM?v=1&utm_source=unp&utm_medium=email&utm_campaign=RT000610&utm_unptid=f9d95a18-3b0d-11f0-ad94-950335978b83&ppid=RT000610&cnac=KR&rsta=ko_KR%28ko-KR%29&cust=FYTCUMLGTX87C&unptid=f9d95a18-3b0d-11f0-ad94-950335978b83&calc=f262876487781&unp_tpcid=invoice-merchant-payment-notification&page=main%3Aemail%3ART000610&pgrp=main%3Aemail&e=cl&mchn=em&s=ci&mail=sys&appVersion=1.332.0&tenant_name=PAYPAL&xt=145585%2C154413%2C104038&link_ref=details_inv2-77zm-ep3j-cf98-uwxm] -------------------------------------------------------------------------------- 고객 大桐汽車股份有限公司 [email protected] 桃园市, 桃園區 莊二街186號6樓 TW 330 -------------------------------------------------------------------------------- 1 x Sakura $87.00 USD $87.00 USD -------------------------------------------------------------------------------- 총계 $87.00 USD 할인 $0.00 USD 배송 $0.00 USD 인보이스 총액 $87.00 USD 결제된 금액 $87.00 USD 결제할 금액 $0.00 USD 환전 전 통화 NT$2,732 TWD 환전 후 통화 $87.00 USD PayPal에서 수취한 수수료/세금 $4.13 USD 환율 TWD = 0.031844 USD 이 환율에는 PayPal 환전 수수료가 포함됩니다. PayPal [https://www.paypalobjects.com/digitalassets/c/system-triggered-email/n/layout/images/ppe/pp-logo_x2.png] -------------------------------------------------------------------------------- 도움말 및 문의하기 [https://www.paypal.com/kr/smarthelp/home?v=1&utm_source=unp&utm_medium=email&utm_campaign=RT000610&utm_unptid=f9d95a18-3b0d-11f0-ad94-950335978b83&ppid=RT000610&cnac=KR&rsta=ko_KR%28ko-KR%29&cust=FYTCUMLGTX87C&unptid=f9d95a18-3b0d-11f0-ad94-950335978b83&calc=f262876487781&unp_tpcid=invoice-merchant-payment-notification&page=main%3Aemail%3ART000610&pgrp=main%3Aemail&e=cl&mchn=em&s=ci&mail=sys&appVersion=1.332.0&tenant_name=PAYPAL&xt=145585%2C154413%2C104038&link_ref=smarthelp_home] | 보안 [https://www.paypal.com/kr/webapps/mpp/paypal-safety-and-security?v=1&utm_source=unp&utm_medium=email&utm_campaign=RT000610&utm_unptid=f9d95a18-3b0d-11f0-ad94-950335978b83&ppid=RT000610&cnac=KR&rsta=ko_KR%28ko-KR%29&cust=FYTCUMLGTX87C&unptid=f9d95a18-3b0d-11f0-ad94-950335978b83&calc=f262876487781&unp_tpcid=invoice-merchant-payment-notification&page=main%3Aemail%3ART000610&pgrp=main%3Aemail&e=cl&mchn=em&s=ci&mail=sys&appVersion=1.332.0&tenant_name=PAYPAL&xt=145585%2C154413%2C104038&link_ref=mpp_paypal-safety-and-security] | 앱 [https://www.paypal.com/kr/webapps/mpp/mobile-apps?v=1&utm_source=unp&utm_medium=email&utm_campaign=RT000610&utm_unptid=f9d95a18-3b0d-11f0-ad94-950335978b83&ppid=RT000610&cnac=KR&rsta=ko_KR%28ko-KR%29&cust=FYTCUMLGTX87C&unptid=f9d95a18-3b0d-11f0-ad94-950335978b83&calc=f262876487781&unp_tpcid=invoice-merchant-payment-notification&page=main%3Aemail%3ART000610&pgrp=main%3Aemail&e=cl&mchn=em&s=ci&mail=sys&appVersion=1.332.0&tenant_name=PAYPAL&xt=145585%2C154413%2C104038&link_ref=mpp_mobile-apps] Twitter [https://www.paypalobjects.com/digitalassets/c/system-triggered-email/n/layout/images/quantum_leap/footer-social-icons_x.png]https://twitter.com/PayPal?v=1%2C0.1&utm_source=unp&utm_medium=email&utm_campaign=RT000610&utm_unptid=f9d95a18-3b0d-11f0-ad94-950335978b83&ppid=RT000610&cnac=KR&rsta=ko_KR%28ko-KR%29&cust=FYTCUMLGTX87C&unptid=f9d95a18-3b0d-11f0-ad94-950335978b83&calc=f262876487781&unp_tpcid=invoice-merchant-payment-notification&page=main%3Aemail%3ART000610&pgrp=main%3Aemail&e=cl&mchn=em&s=ci&mail=sys&appVersion=1.332.0&tenant_name=PAYPAL&xt=145585%2C154413%2C104038&link_ref=twitter.com_paypal Instagram [https://paypalobjects.com/digitalassets/c/system-triggered-email/n/layout/images/quantum_leap/footer-social-icons_instagram.png]https://www.instagram.com/paypal/?v=1%2C0.1&utm_source=unp&utm_medium=email&utm_campaign=RT000610&utm_unptid=f9d95a18-3b0d-11f0-ad94-950335978b83&ppid=RT000610&cnac=KR&rsta=ko_KR%28ko-KR%29&cust=FYTCUMLGTX87C&unptid=f9d95a18-3b0d-11f0-ad94-950335978b83&calc=f262876487781&unp_tpcid=invoice-merchant-payment-notification&page=main%3Aemail%3ART000610&pgrp=main%3Aemail&e=cl&mchn=em&s=ci&mail=sys&appVersion=1.332.0&tenant_name=PAYPAL&xt=145585%2C154413%2C104038&link_ref=www.instagram.com_paypal Facebook [https://paypalobjects.com/digitalassets/c/system-triggered-email/n/layout/images/quantum_leap/footer-social-icons_facebook.png]https://www.facebook.com/PayPalUSA?v=1%2C0.1&utm_source=unp&utm_medium=email&utm_campaign=RT000610&utm_unptid=f9d95a18-3b0d-11f0-ad94-950335978b83&ppid=RT000610&cnac=KR&rsta=ko_KR%28ko-KR%29&cust=FYTCUMLGTX87C&unptid=f9d95a18-3b0d-11f0-ad94-950335978b83&calc=f262876487781&unp_tpcid=invoice-merchant-payment-notification&page=main%3Aemail%3ART000610&pgrp=main%3Aemail&e=cl&mchn=em&s=ci&mail=sys&appVersion=1.332.0&tenant_name=PAYPAL&xt=145585%2C154413%2C104038&link_ref=www.facebook.com_paypalusa LinkedIn [https://paypalobjects.com/digitalassets/c/system-triggered-email/n/layout/images/quantum_leap/footer-social-icons_linkedin.png]http://www.linkedin.com/company/1482?trk=tyah&v=1&utm_source=unp&utm_medium=email&utm_campaign=RT000610&utm_unptid=f9d95a18-3b0d-11f0-ad94-950335978b83&ppid=RT000610&cnac=KR&rsta=ko_KR%28ko-KR%29&cust=FYTCUMLGTX87C&unptid=f9d95a18-3b0d-11f0-ad94-950335978b83&calc=f262876487781&unp_tpcid=invoice-merchant-payment-notification&page=main%3Aemail%3ART000610&pgrp=main%3Aemail&e=cl&mchn=em&s=ci&mail=sys&appVersion=1.332.0&tenant_name=PAYPAL&xt=145585%2C154413%2C104038&link_ref=company_1482 PayPal은 사기 이메일을 예방하기 위해 노력하고 있습니다. PayPal에서 보낸 이메일에는 항상 고객님의 성명 전체가 포함됩니다. 피싱 식별 방법 알아보기 [https://www.paypal.com/us/webapps/mpp/security/suspicious-activity?v=1&utm_source=unp&utm_medium=email&utm_campaign=RT000610&utm_unptid=f9d95a18-3b0d-11f0-ad94-950335978b83&ppid=RT000610&cnac=KR&rsta=ko_KR%28ko-KR%29&cust=FYTCUMLGTX87C&unptid=f9d95a18-3b0d-11f0-ad94-950335978b83&calc=f262876487781&unp_tpcid=invoice-merchant-payment-notification&page=main%3Aemail%3ART000610&pgrp=main%3Aemail&e=cl&mchn=em&s=ci&mail=sys&appVersion=1.332.0&tenant_name=PAYPAL&xt=145585%2C154413%2C104038&link_ref=security_suspicious-activity] 본 이메일은 발신 전용입니다. 문의 사항이 있으시면 도움말 및 문의하기 [https://www.paypal.com/selfhelp/home?v=1&utm_source=unp&utm_medium=email&utm_campaign=RT000610&utm_unptid=f9d95a18-3b0d-11f0-ad94-950335978b83&ppid=RT000610&cnac=KR&rsta=ko_KR%28ko-KR%29&cust=FYTCUMLGTX87C&unptid=f9d95a18-3b0d-11f0-ad94-950335978b83&calc=f262876487781&unp_tpcid=invoice-merchant-payment-notification&page=main%3Aemail%3ART000610&pgrp=main%3Aemail&e=cl&mchn=em&s=ci&mail=sys&appVersion=1.332.0&tenant_name=PAYPAL&xt=145585%2C154413%2C104038&link_ref=selfhelp_home]를 클릭하세요. 해당 이메일을 받은 이유가 궁금하신가요? 더 알아보기 [https://www.paypal.com/kr/smarthelp/article/why-am-i-receiving-emails-from-paypal-when-i-dont-have-an-account-faq4172?v=1&utm_source=unp&utm_medium=email&utm_campaign=RT000610&utm_unptid=f9d95a18-3b0d-11f0-ad94-950335978b83&ppid=RT000610&cnac=KR&rsta=ko_KR%28ko-KR%29&cust=FYTCUMLGTX87C&unptid=f9d95a18-3b0d-11f0-ad94-950335978b83&calc=f262876487781&unp_tpcid=invoice-merchant-payment-notification&page=main%3Aemail%3ART000610&pgrp=main%3Aemail&e=cl&mchn=em&s=ci&mail=sys&appVersion=1.332.0&tenant_name=PAYPAL&xt=145585%2C154413%2C104038&link_ref=article_why-am-i-receiving-emails-from-paypal-when-i-dont-have-an-account-faq4172] Copyright © 1999-2025 PayPal. All rights reserved. PayPal Pte. Ltd.는 2019 지급서비스법에 따라 싱가포르 금융당국의 승인을 받아 주요 결제 기관으로 인가를 받았습니다. PayPal RT000610:ko_KR(ko-KR):1.1.0:f262876487781 [https://t.paypal.com/ts?v=1&utm_source=unp&utm_medium=email&utm_campaign=RT000610&utm_unptid=f9d95a18-3b0d-11f0-ad94-950335978b83&ppid=RT000610&cnac=KR&rsta=ko_KR%28ko-KR%29&cust=FYTCUMLGTX87C&unptid=f9d95a18-3b0d-11f0-ad94-950335978b83&calc=f262876487781&unp_tpcid=invoice-merchant-payment-notification&page=main%3Aemail%3ART000610&pgrp=main%3Aemail&e=op&mchn=em&s=ci&mail=sys&appVersion=1.332.0&tenant_name=PAYPAL&xt=145585%2C154413%2C104038&link_ref=t.paypal.com_ts]"
    }

이걸 정확히 구매금액, 구매자 이름, 구매자의 국가 등의 필요한 내용만 뽑아내려면 꽤 복잡한 전처리와 파싱이 필요했습니다.

해결을 위한 시도들

모바일 앱의 다른 단계를 보여주는 다이어그램
  • HTML에서 텍스트만 추출하는 모듈 추가

  • 메일 내용 중 일정 구간만 잘라내는 로직 적용

  • 다양한 PayPal 메일을 분석해 공통 패턴 찾기 시도

하지만 아직도 완전히 만족스러운 자동화는 못 만들었습니다.

결과와 배운 점

  • 노코드 툴을 쓰더라도, 데이터의 구조를 읽는 능력은 필수!

  • 파싱, 전처리, 정규식 기초는 꼭 익혀두는 게 좋겠다고 느꼈습니다.

앞으로의 계획

  • HTML 메일 파싱 라이브러리로 정교한 실험 진행 예정

  • PayPal의 공식 API에 요청해둔 내역에 답변을 받아 paypal 로 노코드 실험 예정

4
2개의 답글

👉 이 게시글도 읽어보세요