service/library/payclients/alipaycli/client_test.go

132 lines
29 KiB
Go

package alipaycli
import (
"context"
"fmt"
"os"
"service/app/mix/conf"
"service/bizcommon/util"
"service/library/configcenter"
"service/library/idgenerator"
"testing"
)
func TestMain(m *testing.M) {
cfg := new(conf.ConfigSt)
err := configcenter.LoadConfig("/Users/erwin/wishpalv2/service/etc/mix/mix-local.yaml", cfg)
if err != nil {
fmt.Printf("%v\n", err)
}
err = InitMulti(cfg.Alipay, cfg.AlipayMYTS, cfg.AlipayLX01)
if err != nil {
fmt.Println(err)
os.Exit(1)
}
m.Run()
}
func TestAlipayClient_WapPay(t *testing.T) {
cli := GetDefaultAlipayClient()
paramStr, err := cli.WapPay(context.Background(), &WapPayParam{
OutTradeNo: idgenerator.GenOrderId(),
Subject: "哈哈",
TotalAmount: 1,
TimeOutSeconds: 0,
})
if err != nil {
fmt.Println(err)
return
}
fmt.Println(paramStr)
}
func TestAlipayClient_QueryOrder(t *testing.T) {
cli := GetDefaultAlipayClient()
resp, err := cli.QueryOrder(context.Background(), &QueryOrderParam{
OutTradeNo: "1750539072771731456",
})
if err != nil {
fmt.Println(err.Error())
return
}
fmt.Println(util.ToJson(resp))
}
func TestAlipayClient_RefundOne(t *testing.T) {
cli := GetAlipayClientByAppId(AppIdXinYiDaoLe)
resp, err := cli.RefundOne(context.Background(), &RefundOneParam{
OutTradeNo: "1744218982338015232",
RefundAmount: 100,
RefundReason: "测试退款",
})
if err != nil {
fmt.Println(err.Error())
return
}
fmt.Println(util.ToJson(resp))
}
func TestAlipayClient_UniTransfer(t *testing.T) {
cli := GetAlipayClientByAppId(AppIdXinYiDaoLe)
resp, err := cli.UniTransfer(context.Background(), &UniTransferParam{
OutBizNo: idgenerator.GenWithdrawOrderId(),
Amount: 10,
Title: "提现测试",
AlipayLoginId: "lwl0608@foxmail.com",
AlipayName: "李旺林",
})
if err != nil {
fmt.Println(err.Error())
return
}
fmt.Println(util.ToJson(resp))
}
func TestFillOid3(t *testing.T) {
orderIds := []string{"1742761440047017984", "1742852074682462208", "1742852552656957440", "1742924360517169152", "1743182205040996352", "1743520076063059968", "1743662852348063744", "1743663326795149312", "1743823244533706752", "1744218982338015232", "1744244263178219520", "1744350157970878464", "1744408716473544704", "1745042566375550976", "1745042654623707136", "1745721623425593344", "1746183337426300928", "1746421628100685824", "1746463772899291136", "1746470938301444096", "1746631560976674816", "1747243520520892416", "1747542908493377536", "1748967357042143232", "1748967481084489728", "1748967612680777728", "1749654946015358976", "1749753647039787008", "1749782915010539520", "1749792607422132224", "1749932249081458688", "1750539072771731456", "1751075580108877824", "1751165792092696576", "1751196454745026560", "1751432173375729664", "1751516934270103552", "1751575514667036672", "1751594471155314688", "1751793391655464960", "1751886129461735424", "1751946441451909120", "1751996064262533120", "1751997132975386624", "1752008184328892416", "1752014211006869504", "1752014764885684224", "1752027180163936256", "1752027550126714880", "1752027637821222912", "1752028008304095232", "1752077544233906176", "1752086426696036352", "1752120049658769408", "1752133978615197696", "1752299490192142336", "1752302624792653824", "1752406986378457088", "1752470842563899392", "1752486928067866624", "1752511566495887360", "1752574086808088576", "1752609115932209152", "1752617236729704448", "1752628266373492736", "1752676795091529728", "1752723355963764736", "1752744562419314688", "1752753531737092096", "1752754533919895552", "1752766191992057856", "1752882682368372736", "1752908112026677248", "1752920982437244928", "1753041808545296384", "1753052328052666368", "1753057343802716160", "1753075028104065024", "1753087953262882816", "1753088666751741952", "1753135004277288960", "1753165780310044672", "1753270954600968192", "1753274856683614208", "1753290280578068480", "1753291651377278976", "1753385044547743744", "1753456188839702528", "1753586844827660288", "1753594211489296384", "1753650088430809088", "1753651789619539968", "1753659385466335232", "1753696275661860864", "1753697226460246016", "1753698635968688128", "1753703849928962048", "1753769112124796928", "1753814530149855232", "1753846361020706816", "1753852803849138176", "1753987695459184640", "1754040300780662784", "1754083910163116032", "1754110276036210688", "1754138747760291840", "1754192230463057920", "1754252018832125952", "1754303879605923840", "1754351453889114112", "1754354646593318912", "1754372648122462208", "1754402526775488512", "1754417315002200064", "1754487065157840896", "1754525198553460736", "1754537829599293440", "1754558003379449856", "1754564554794217472", "1754571015964340224", "1754572009162944512", "1754576063519797248", "1754600989450579968", "1754623192195936256", "1754662992051449856", "1754672188390125568", "1754680462095167488", "1754682474849382400", "1754684059369353216", "1754689197429501952", "1754700702778667008", "1754722956178632704", "1754723877960822784", "1754728264863068160", "1754741175765446656", "1754745097544544256", "1754750391725076480", "1754759204503040000", "1754759471080419328", "1754769380295585792", "1754771557684621312", "1754774424587874304", "1754779489931374592", "1754799230922272768", "1754811322836463616", "1754812425984552960", "1754814285579563008", "1754816070062977024", "1754820528016732160", "1754836132710854656", "1754839165121343488", "1754850031359242240", "1754856552730210304", "1754873591788220416", "1754874866298793984", "1754886273958424576", "1754886321580552192", "1754886832132206592", "1754887107970609152", "1754897611296354304", "1754899978276319232", "1754902916105252864", "1754907977925537792", "1754910828605222912", "1754929720945815552", "1754930627502682112", "1754944453191151616", "1754946054568030208", "1754952278780948480", "1754961195950944256", "1754966414868885504", "1755017040944443392", "1755019012334432256", "1755027629800435712", "1755048721378193408", "1755058603925975040", "1755058902094852096", "1755059175412477952", "1755059574131404800", "1755060346906750976", "1755067196486201344", "1755068979140898816", "1755069551881498624", "1755071043753488384", "1755072094468583424", "1755076338642857984", "1755087931602644992", "1755092639113293824", "1755094784919220224", "1755094891307741184", "1755097091585093632", "1755099903672987648", "1755106552823427072", "1755107583175176192", "1755113064207757312", "1755113950636158976", "1755125445801553920", "1755134383980818432", "1755145355164397568", "1755145525004349440", "1755146442319605760", "1755150013350031360", "1755151578228076544", "1755155610220900352", "1755171234816995328", "1755185098342281216", "1755191112865165312", "1755191424988491776", "1755202822644707328", "1755206966910660608", "1755208909515141120", "1755211903572914176", "1755223026347028480", "1755224701963087872", "1755230953048911872", "1755242188498808832", "1755244881132924928", "1755245438522372096", "1755251553909878784", "1755257016869203968", "1755261892865044480", "1755263752313253888", "1755264195693129728", "1755265168612274176", "1755265430945017856", "1755269025195110400", "1755269040974082048", "1755272006527365120", "1755275053546614784", "1755277559681003520", "1755278739735851008", "1755279789872132096", "1755286137372422144", "1755292668407066624", "1755293964669300736", "1755295283052294144", "1755298099271577600", "1755298193303678976", "1755298996634529792", "1755304974620831744", "1755305234512490496", "1755311017904058368", "1755311756017676288", "1755313457852329984", "1755316846711549952", "1755330634089246720", "1755332395256524800", "1755379780083003392", "1755381386346246144", "1755381695202209792", "1755383067964354560", "1755385687672107008", "1755386038278172672", "1755386071614500864", "1755389028577849344", "1755389480312778752", "1755390085185941504", "1755406354270400512", "1755406607845437440", "1755409750587092992", "1755415364319064064", "1755422145065791488", "1755427877848887296", "1755427984338071552", "1755434382027403264", "1755435847009710080", "1755438126530048000", "1755447627853344768", "1755449635003969536", "1755449881637433344", "1755454343261204480", "1755458688023277568", "1755468943650205696", "1755470079937490944", "1755471480390430720", "1755475335618506752", "1755483372588642304", "1755487726829842432", "1755489225463050240", "1755498392231882752", "1755502974701940736", "1755505185028845568", "1755507876232704000", "1755510054758395904", "1755511824817598464", "1755518932732620800", "1755519426569973760", "1755523874419650560", "1755529518124118016", "1755532167137472512", "1755534834534461440", "1755535945207132160", "1755541435458793472", "1755542658446536704", "1755542909903450112", "1755544697754890240", "1755550017621340160", "1755551201589473280", "1755554232540344320", "1755555928469417984", "1755560508490002432", "1755568613772767232", "1755569432005980160", "1755583733903142912", "1755594414933159936", "1755594787798396928", "1755594931386200064", "1755596681514070016", "1755601334419075072", "1755601678662381568", "1755605331511095296", "1755605598688260096", "1755606898259800064", "1755610384288460800", "1755617726711214080", "1755618963405942784", "1755620919713214464", "1755622618205007872", "1755623307736002560", "1755626401144254464", "1755626643424030720", "1755627462705819648", "1755630767788011520", "1755637826159915008", "1755640558941908992", "1755641396506669056", "1755641578627543040", "1755643596435894272", "1755643867341795328", "1755647146473828352", "1755653986687397888", "1755654127636983808", "1755655429926432768", "1755658320154210304", "1755659611219701760", "1755666209736503296", "1755668778638651392", "1755677031732883456", "1755690247418556416", "1755721516974092288", "1755726088006283264", "1755728393594220544", "1755729486369796096", "1755740855576047616", "1755741379633360896", "1755746730365693952", "1755757573144850432", "1755758337531588608", "1755760955427401728", "1755770458877210624", "1755773224806789120", "1755777035910787072", "1755786039110152192", "1755789023772684288", "1755813908007890944", "1755816641041543168", "1755817328206950400", "1755817601704931328", "1755819648634335232", "1755824985819066368", "1755829372092166144", "1755836156689264640", "1755841741514092544", "1755844139221528576", "1755851359812333568", "1755867290189967360", "1755871095367413760", "1755877221286817792", "1755932513051619328", "1755935080674504704", "1755938955167019008", "1755939994452635648", "1755940499417477120", "1755949096390111232", "1755952223294074880", "1755956139637354496", "1755965437071339520", "1755968174941024256", "1755969010001784832", "1755975106858856448", "1755976813651177472", "1755977930174902272", "1755994688550088704", "1755996795999105024", "1755998561566208000", "1756012152432373760", "1756016558439673856", "1756016662189977600", "1756019533967011840", "1756024709956251648", "1756025202841497600", "1756027451772776448", "1756031226969337856", "1756041646908125184", "1756042371088265216", "1756056930847043584", "1756067672992264192", "1756071198023757824", "1756089409909829632", "1756092775595520000", "1756096388787089408", "1756098261703208960", "1756104534347755520", "1756104544024014848", "1756110392838336512", "1756110651836608512", "1756118197888626688", "1756130890980798464", "1756132786483245056", "1756136610124017664", "1756136842937249792", "1756137903668342784", "1756141501160632320", "1756146193416597504", "1756154935088525312", "1756157117770772480", "1756170486645010432", "1756174862327492608", "1756175273537056768", "1756176195445075968", "1756176761361543168", "1756184702802210816", "1756186343261614080", "1756190495442219008", "1756197568829730816", "1756208635492446208", "1756209445488046080", "1756213618896023552", "1756214395794370560", "1756216092830740480", "1756217274198405120", "1756219007746191360", "1756221952999043072", "1756228024107282432", "1756245476912410624", "1756250363771498496", "1756251287197855744", "1756256407998443520", "1756258248710696960", "1756262760481566720", "1756265739515342848", "1756266269784420352", "1756266700946288640", "1756269244904910848", "1756282182118158336", "1756288493815869440", "1756288494138830848", "1756288627702247424", "1756289225864523776", "1756291911250882560", "1756293260600422400", "1756302786946936832", "1756304522994528256", "1756305903306420224", "1756311771041247232", "1756312397984837632", "1756314604545257472", "1756317488766791680", "1756320212648472576", "1756321843150598144", "1756322918544977920", "1756324781885501440", "1756325811620687872", "1756327354306670592", "1756327973113311232", "1756333653832511488", "1756349467985981440", "1756351282370588672", "1756353602055581696", "1756357236952674304", "1756359607304859648", "1756360815767728128", "1756360930444193792", "1756362078890766336", "1756363251999846400", "1756368440806879232", "1756370877890441216", "1756371132354670592", "1756371177514741760", "1756376712859365376", "1756377806587047936", "1756388159521828864", "1756388837195526144", "1756390059466043392", "1756395659335839744", "1756396718921887744", "1756402572287029248", "1756404888511721472", "1756411830231642112", "1756412136453582848", "1756423940588187648", "1756428615228076032", "1756452318791872512", "1756460806825848832", "1756466617820131328", "1756468567160664064", "1756485632705703936", "1756486782641254400", "1756487422247448576", "1756489850636218368", "1756490846343016448", "1756492687864770560", "1756495827678801920", "1756499234661609472", "1756504260368936960", "1756507050214436864", "1756507644765417472", "1756507829235101696", "1756508688782209024", "1756511463758901248", "1756525295331979264", "1756527788170424320", "1756532145431523328", "1756537442476765184", "1756544629265674240", "1756549962256101376", "1756553711586390016", "1756555650055286784", "1756567852371947520", "1756570085721387008", "1756592619078561792", "1756595107055808512", "1756598413899608064", "1756602591648690176", "1756612468152479744", "1756614322814988288", "1756616651488374784", "1756626042379841536", "1756631107610095616", "1756631266284810240", "1756634178025172992", "1756640657985777664", "1756643756074872832", "1756646662547189760", "1756660735993196544", "1756664318264356864", "1756666254346694656", "1756670209659252736", "1756672812166164480", "1756676472891781120", "1756678059722813440", "1756678475378339840", "1756678829310488576", "1756679480702676992", "1756680285946130432", "1756682565298696192", "1756682645846110208", "1756682793204592640", "1756683031948570624", "1756684206743760896", "1756684331373309952", "1756685390992912384", "1756688713015898112", "1756692522098241536", "1756695507230535680", "1756698551083085824", "1756699684371443712", "1756700275290157056", "1756701945399095296", "1756705568271118336", "1756705936610701312", "1756707699715747840", "1756707794779648000", "1756718971035332608", "1756722374243266560", "1756724145866944512", "1756726129894371328", "1756726719391215616", "1756727282849820672", "1756728597738958848", "1756729925231980544", "1756731789327478784", "1756737079338872832", "1756745574960345088", "1756753743321247744", "1756764714995560448", "1756766658854137856", "1756767218126827520", "1756770883592007680", "1756777785503789056", "1756803999069122560", "1757073443083268096", "1757073840892030976", "1757073862811463680", "1757074501343916032", "1757074504443506688", "1757075592643096576", "1757075866652782592", "1757076258383998976", "1757080847975985152", "1757083756088274944", "1757084450115563520", "1757084633696055296", "1757088478392233984", "1757091016365584384", "1757091609557610496", "1757092889327841280", "1757094118028226560", "1757095752007430144", "1757096223724023808", "1757099117047197696", "1757101102064480256", "1757105826486562816", "1757106549592961024", "1757119833687732224", "1757120516973408256", "1757129149090115584", "1757134117167706112", "1757138172346642432", "1757138518083121152", "1757149590777245696", "1757160898922819584", "1757161788345954304", "1757170050730569728", "1757171222258397184", "1757172872893181952", "1757173749003595776", "1757179033986019328", "1757187794549092352", "1757193551956946944", "1757198705556992000", "1757201908616933376", "1757207284078882816", "1757207486454050816", "1757211236220547072", "1757211797561028608", "1757213663170670592", "1757215099971448832", "1757216887445401600", "1757219451020783616", "1757219886674751488", "1757220094833864704", "1757221706088329216", "1757221827387600896", "1757227232671051776", "1757229353554423808", "1757230736324177920", "1757233605941145600", "1757235149172387840", "1757243414442684416", "1757244140950663168", "1757247569680936960", "1757251109610598400", "1757252415293239296", "1757255193025589248", "1757257392157896704", "1757260521930764288", "1757263551094861824", "1757265460501426176", "1757269207424184320", "1757275429577699328", "1757277018052898816", "1757283179632275456", "1757286413113503744", "1757288010732285952", "1757288642176364544", "1757293423640981504", "1757294460095442944", "1757295516296687616", "1757296052047720448", "1757302983806169088", "1757303009177513984", "1757304532859105280", "1757308639883833344", "1757310068308586496", "1757311214825779200", "1757314966400020480", "1757315268570263552", "1757318209200992256", "1757323018360598528", "1757323400713351168", "1757324261720076288", "1757327274794823680", "1757333891766562816", "1757334245547716608", "1757335217934184448", "1757341215499497472", "1757342007971295232", "1757342457219002368", "1757343461230522368", "1757346033408421888", "1757351613778898944", "1757358263688507392", "1757359694785032192", "1757360113158467584", "1757373219242782720", "1757375977131880448", "1757382838472159232", "1757385783586598912", "1757386554986213376", "1757391361297887232", "1757392762472247296", "1757394282777423872", "1757396357884162048", "1757399232035172352", "1757412921618477056", "1757414060183269376", "1757418313866031104", "1757419715858280448", "1757428877954658304", "1757429805877309440", "1757430233738260480", "1757430687461289984", "1757439349462413312", "1757440259395694592", "1757442520985382912", "1757442622554648576", "1757448963964809216", "1757449555718189056", "1757450637609545728", "1757453037573517312", "1757454149017939968", "1757454411296157696", "1757454889711054848", "1757455445456334848", "1757455648611643392", "1757460218167439360", "1757461500596858880", "1757473891967578112", "1757474218582224896", "1757474875431202816", "1757477776635473920", "1757489727075790848", "1757490054915174400", "1757519002436907008", "1757526456994377728", "1757536709303611392", "1757536762671935488", "1757543515077750784", "1757559259593191424", "1757574227134787584", "1757581950501007360", "1757585150146785280", "1757585923836489728", "1757588174407741440", "1757589682381664256", "1757592078549790720", "1757596364688076800", "1757596641960931328", "1757597904542904320", "1757602665182801920", "1757603506455326720", "1757605103969251328", "1757605738798133248", "1757613641869307904", "1757614215532654592", "1757626977826648064", "1757631907031429120", "1757634333738283008", "1757639209134338048", "1757643186739621888", "1757644176893161472", "1757650465954213888", "1757652034300948480", "1757652958775881728", "1757654739098546176", "1757655570036305920", "1757659955780923392", "1757662917760659456", "1757673665614327808", "1757678947782373376", "1757679910136066048", "1757681369175044096", "1757690043842965504", "1757691691147472896", "1757693603892703232", "1757697666604609536", "1757697932196327424", "1757698133879435264", "1757701160464035840", "1757703980948926464", "1757708225601351680", "1757716701215993856", "1757720904957177856", "1757721139179696128", "1757722706003898368", "1757733690026242048", "1757736154234368000", "1757737424475140096", "1757744138830229504", "1757750703482220544", "1757752755574812672", "1757752906783666176", "1757763304295510016", "1757763381923688448", "1757767607575916544", "1757767966717390848", "1757768740428066816", "1757778505011048448", "1757781375043252224", "1757781852090806272", "1757785822955843584", "1757789615168696320", "1757793356835991552", "1757794712078528512", "1757802656346157056", "1757804745973575680", "1757808273983025152", "1757809024117518336", "1757809743117692928", "1757811797366157312", "1757820347421306880", "1757823454125502464", "1757830433002762240", "1757833698037739520", "1757847271749201920", "1757850010621325312", "1757852369992822784", "1757852545478307840", "1757854547562213376", "1757855778594631680", "1757861124432211968", "1757862569055367168", "1757863587403018240", "1757881147422945280", "1757886115152408576", "1757889048124338176", "1757910880621703168", "1757918387490533376", "1757919014459289600", "1757920180320612352", "1757930428242604032", "1757932440019546112", "1757934445018492928", "1757935399163932672", "1757939486232162304", "1757940449600876544", "1757941963333578752", "1757943044977471488", "1757945770281021440", "1757946592503017472", "1757947564813987840", "1757950739709177856", "1757951935350059008", "1757952395423264768", "1757952439480233984", "1757957537006628864", "1757971770943483904", "1757978650428321792", "1757981053860982784", "1757986449854050304", "1757988735959445504", "1757990421667000320", "1757991514371272704", "1757995695953948672", "1757997363470807040", "1758003301711884288", "1758005852486250496", "1758005955192172544", "1758008869067436032", "1758009756607328256", "1758013028520964096", "1758021194897960960", "1758023578353152000", "1758027939842109440", "1758032954954625024", "1758033950850166784", "1758037389621604352", "1758051571758804992", "1758052490672091136", "1758058820006850560", "1758060333588557824", "1758060980601892864", "1758061339797893120", "1758062850426810368", "1758065663378731008", "1758076629290070016", "1758077479244804096", "1758081061696319488", "1758092140199555072", "1758093580771012608", "1758095418291400704", "1758104408509394944", "1758109688525762560", "1758110016964931584", "1758110046639632384", "1758119867057188864", "1758120425277108224", "1758121057748791296", "1758123205911916544", "1758125211670032384", "1758125553329647616", "1758127975351463936", "1758136979117060096", "1758145015982338048", "1758149650558234624", "1758150446905569280", "1758152745455464448", "1758154296995622912", "1758156030568574976", "1758156427408453632", "1758158184083632128", "1758160659461189632", "1758161606832828416", "1758164022135369728", "1758164280202506240", "1758165776969248768", "1758168775829499904", "1758177052994842624", "1758179764834676736", "1758184158670106624", "1758184639433814016", "1758185459525103616", "1758186614338629632", "1758193425858965504", "1758194551752765440", "1758195357101076480", "1758195597011070976", "1758203539097661440", "1758205222871642112", "1758209997994471424", "1758213348828131328", "1758214313400610816", "1758237122168369152", "1758247470875291648", "1758270720443428864", "1758273870910992384", "1758275825402130432", "1758292138577113088", "1758297957326663680", "1758314254898835456", "1758316629197860864", "1758317255818489856", "1758318381158641664", "1758319155783675904", "1758321272602767360", "1758325736327884800", "1758327801720614912", "1758342811620487168", "1758347539360264192", "1758350477122088960", "1758351360295710720", "1758356695207129088", "1758358109715181568", "1758359100036493312", "1758360248323682304", "1758367759391010816", "1758371091400634368", "1758371922032209920", "1758372846842687488", "1758382244990300160", "1758387597731704832", "1758396668618747904", "1758404960896167936", "1758407407135895552", "1758408164492980224", "1758408959921762304", "1758408994264723456", "1758409116650319872", "1758414260490219520", "1758419724733001728", "1758422106011348992", "1758425903504830464", "1758426019414421504", "1758426270619676672", "1758432644590219264", "1758440921709424640", "1758456190720815104", "1758456946123354112", "1758459070139871232", "1758460297091231744", "1758462642080460800", "1758472890002452480", "1758482502730657792", "1758482825411047424", "1758483146589876224", "1758484527325392896", "1758489926631960576", "1758492473304297472", "1758493608056467456", "1758495643598336000", "1758496513228550144", "1758496860261068800", "1758497388768538624", "1758498168695173120", "1758507530415255552", "1758511433311596544", "1758512091074932736", "1758513704569155584", "1758513747392999424", "1758516791224578048", "1758525341728518144", "1758526147009720320", "1758528004381749248", "1758530056805691392", "1758530283793035264", "1758532157124390912", "1758532306001211392", "1758533686489264128", "1758541233761824768", "1758543712796815360", "1758543730945568768", "1758545648224841728", "1758549455222616064", "1758550489219215360", "1758551085984788480", "1758569589890887680", "1758570856004464640", "1758580586961711104", "1758599890339901440", "1758605418344493056", "1758607451717906432", "1758627152367988736", "1758638569309614080", "1758650661337051136", "1758651879392292864", "1758652915142111232", "1758653968960991232", "1758667012122357760", "1758681152924692480", "1758681430503731200", "1758683694077325312", "1758684355430985728", "1758684566312202240", "1758693472870608896", "1758697563810181120", "1758703401622843392", "1758706976423948288", "1758709315507597312", "1758718826779783168", "1758718882178150400", "1758719905290530816", "1758719985099747328", "1758726109144297472", "1758727995763208192", "1758729677905604608", "1758742332070440960", "1758744411593781248", "1758748699464314880", "1758749983395295232", "1758752341399449600", "1758754479714349056", "1758755434014978048", "1758757158905720832", "1758758156776779776", "1758770276650201088", "1758776226610163712", "1758776601350254592", "1758777475661312000", "1758783047018229760", "1758784381343772672", "1758812708796379136", "1758814667620233216", "1758815722177310720", "1758816269668200448", "1758826972957388800", "1758827240965025792", "1758829660373790720", "1758829761620094976", "1758830695276359680", "1758831398153629696", "1758836183254708224", "1758838208558280704", "1758844021083484160", "1758849376345665536", "1758850506744147968", "1758851520171880448", "1758853043547287552", "1758853549745254400", "1758856173857026048", "1758862117332594688", "1758864924668342272", "1758865884627087360", "1758866129482166272", "1758866417152700416", "1758867210614353920", "1758867879018639360", "1758869279006011392", "1758873077590011904", "1758873147894935552", "1758874115898355712", "1758874377698422784", "1758874900514222080", "1758875439842996224", "1758875801966620672", "1758878573512372224", "1758881097132814336", "1758881180393943040", "1758882771385724928", "1758882908665294848", "1758886624407597056", "1758887326043353088", "1758887352794624000", "1758889560219070464", "1758893227148062720", "1758895990741413888", "1758898969892630528", "1758901206958223360", "1758903368807362560", "1758906314496421888", "1758913639680585728", "1758914155219267584", "1758916422685175808", "1758917994601263104", "1758929594699755520", "1758930624166506496", "1758941821439848448", "1758943512792936448", "1758943641465794560", "1758950900879077376", "1758959412506013696", "1759342288812650496", "1759352635443392512", "1759363707747446784", "1759382673966510080", "1759384205080408064", "1759384629594304512", "1759386618189328384", "1759387198437732352", "1759398760955260928", "1759398812012523520", "1759402413753643008", "1759404158101762048", "1759410900541911040", "1759411305384521728", "1759412168207380480", "1759420905844387840", "1759424467274051584", "1759426477587181568", "1759426735012589568", "1759433199575904256", "1759437653729619968", "1759442760802250752", "1759443107117543424", "1759446907005972480", "1759448025966587904", "1759449216960180224", "1759449523224064000", "1759451259288432640", "1759466582414733312", "1759467567572856832", "1759467942212284416", "1759471998234275840", "1759474474903678976", "1759478284606779392", "1759481072459984896", "1759482957698969600", "1759485609497341952", "1759489198642966528", "1759489295082598400", "1759494515770535936", "1759499642103410688", "1759501458677444608", "1759515503535075328", "1759519497301012480", "1759520469205135360", "1759526606902145024", "1759529963783991296", "1759535753068556288", "1759543347447345152", "1759548789800054784", "1759548828098244608"}
cliXYDL := GetAlipayClientByAppId(AppIdXinYiDaoLe)
cliMYTS := GetAlipayClientByAppId(AppIdMiYuanTianShi)
ctx := context.Background()
res := map[string]string{}
fmt.Println(len(orderIds))
for i, orderId := range orderIds {
res[orderId] = ""
p := &QueryOrderParam{
OutTradeNo: orderId,
}
// 先查心意到了
resp1, _ := cliXYDL.QueryOrder(ctx, p)
if resp1 != nil && resp1.Response.Code == "10000" {
res[orderId] = AppIdXinYiDaoLe
t.Log(i+1, "心意到了")
continue
}
// 再查觅缘天使
resp2, _ := cliMYTS.QueryOrder(ctx, p)
if resp2 != nil && resp2.Response.Code == "10000" {
res[orderId] = AppIdMiYuanTianShi
t.Log(i+1, "觅缘天使")
continue
}
t.Log(i+1, "没有")
//break
}
f, _ := os.Create("id_pair.csv")
f.Write([]byte("order_id,oid3\n"))
defer f.Close()
for k, v := range res {
content := []byte(fmt.Sprintf("%s,%s\n", k, v))
f.Write(content)
}
}