123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992199319941995199619971998199920002001200220032004200520062007200820092010201120122013201420152016201720182019202020212022202320242025202620272028202920302031203220332034203520362037203820392040204120422043204420452046204720482049205020512052205320542055205620572058205920602061206220632064206520662067206820692070207120722073207420752076207720782079208020812082208320842085208620872088208920902091209220932094209520962097209820992100210121022103210421052106210721082109211021112112211321142115211621172118211921202121212221232124212521262127212821292130213121322133213421352136213721382139214021412142214321442145214621472148214921502151215221532154215521562157215821592160216121622163216421652166216721682169217021712172217321742175217621772178217921802181218221832184218521862187218821892190219121922193219421952196219721982199220022012202220322042205220622072208220922102211221222132214221522162217221822192220222122222223222422252226222722282229223022312232223322342235223622372238223922402241224222432244224522462247224822492250225122522253225422552256225722582259226022612262226322642265226622672268226922702271227222732274227522762277227822792280228122822283228422852286228722882289229022912292229322942295229622972298229923002301230223032304230523062307230823092310231123122313231423152316231723182319232023212322232323242325232623272328232923302331233223332334233523362337233823392340234123422343234423452346234723482349235023512352235323542355235623572358235923602361236223632364236523662367236823692370237123722373237423752376237723782379238023812382238323842385238623872388238923902391239223932394239523962397239823992400240124022403240424052406240724082409241024112412241324142415241624172418241924202421242224232424242524262427242824292430243124322433243424352436243724382439244024412442244324442445244624472448244924502451245224532454245524562457245824592460246124622463246424652466246724682469247024712472247324742475247624772478247924802481248224832484248524862487248824892490249124922493249424952496249724982499250025012502250325042505250625072508250925102511251225132514251525162517251825192520252125222523252425252526252725282529253025312532253325342535253625372538253925402541254225432544254525462547254825492550255125522553255425552556255725582559256025612562256325642565256625672568256925702571257225732574257525762577257825792580258125822583258425852586258725882589259025912592259325942595259625972598259926002601260226032604260526062607260826092610261126122613261426152616261726182619262026212622262326242625262626272628262926302631263226332634263526362637263826392640264126422643264426452646264726482649265026512652265326542655265626572658265926602661266226632664266526662667266826692670267126722673267426752676267726782679268026812682268326842685268626872688268926902691269226932694269526962697269826992700270127022703270427052706270727082709271027112712271327142715271627172718271927202721272227232724272527262727272827292730273127322733273427352736273727382739274027412742274327442745274627472748274927502751275227532754275527562757275827592760276127622763276427652766276727682769277027712772277327742775277627772778277927802781278227832784278527862787278827892790279127922793279427952796279727982799280028012802280328042805280628072808280928102811281228132814281528162817281828192820282128222823282428252826282728282829283028312832283328342835283628372838283928402841284228432844284528462847284828492850285128522853285428552856285728582859286028612862286328642865286628672868286928702871287228732874287528762877287828792880288128822883288428852886288728882889289028912892289328942895289628972898289929002901290229032904290529062907290829092910291129122913291429152916291729182919292029212922292329242925292629272928292929302931293229332934293529362937293829392940294129422943294429452946294729482949295029512952295329542955295629572958295929602961296229632964296529662967296829692970297129722973297429752976297729782979298029812982298329842985298629872988298929902991299229932994299529962997299829993000300130023003300430053006300730083009301030113012301330143015301630173018301930203021302230233024302530263027302830293030303130323033303430353036303730383039304030413042304330443045304630473048304930503051305230533054305530563057305830593060306130623063306430653066306730683069307030713072307330743075307630773078307930803081308230833084308530863087308830893090309130923093309430953096309730983099310031013102310331043105310631073108310931103111311231133114311531163117311831193120312131223123312431253126312731283129313031313132313331343135313631373138313931403141314231433144314531463147314831493150315131523153315431553156315731583159316031613162316331643165316631673168316931703171317231733174317531763177317831793180318131823183318431853186318731883189319031913192319331943195319631973198319932003201320232033204320532063207320832093210321132123213321432153216321732183219322032213222322332243225322632273228322932303231323232333234323532363237323832393240324132423243324432453246324732483249325032513252325332543255325632573258325932603261326232633264326532663267326832693270327132723273327432753276327732783279328032813282328332843285328632873288328932903291329232933294329532963297329832993300330133023303330433053306330733083309331033113312331333143315331633173318331933203321332233233324332533263327332833293330333133323333333433353336333733383339334033413342334333443345334633473348334933503351335233533354335533563357335833593360336133623363336433653366336733683369337033713372337333743375337633773378337933803381338233833384338533863387338833893390339133923393339433953396339733983399340034013402340334043405340634073408340934103411341234133414341534163417341834193420342134223423342434253426342734283429343034313432343334343435343634373438343934403441344234433444344534463447344834493450345134523453345434553456345734583459346034613462346334643465346634673468346934703471347234733474347534763477347834793480348134823483348434853486348734883489349034913492349334943495349634973498349935003501350235033504350535063507350835093510351135123513351435153516351735183519352035213522352335243525352635273528352935303531353235333534353535363537353835393540354135423543354435453546354735483549355035513552355335543555355635573558355935603561356235633564356535663567356835693570357135723573357435753576357735783579358035813582358335843585358635873588358935903591359235933594359535963597359835993600360136023603360436053606360736083609361036113612361336143615361636173618361936203621362236233624362536263627362836293630363136323633363436353636363736383639364036413642364336443645364636473648364936503651365236533654365536563657365836593660366136623663366436653666366736683669367036713672367336743675367636773678367936803681368236833684368536863687368836893690369136923693369436953696369736983699370037013702370337043705370637073708370937103711371237133714371537163717371837193720372137223723372437253726372737283729373037313732373337343735373637373738373937403741374237433744374537463747374837493750375137523753375437553756375737583759376037613762376337643765376637673768376937703771377237733774377537763777377837793780378137823783378437853786378737883789379037913792379337943795379637973798379938003801380238033804380538063807380838093810381138123813381438153816381738183819382038213822382338243825382638273828382938303831383238333834383538363837383838393840384138423843384438453846384738483849385038513852385338543855385638573858385938603861386238633864386538663867386838693870387138723873387438753876387738783879388038813882388338843885388638873888388938903891389238933894389538963897389838993900390139023903390439053906390739083909391039113912391339143915391639173918391939203921392239233924392539263927392839293930393139323933393439353936393739383939394039413942394339443945394639473948394939503951395239533954395539563957395839593960396139623963396439653966396739683969397039713972397339743975397639773978397939803981398239833984398539863987398839893990399139923993399439953996399739983999400040014002400340044005400640074008400940104011401240134014401540164017401840194020402140224023402440254026402740284029403040314032403340344035403640374038403940404041404240434044404540464047404840494050405140524053405440554056405740584059406040614062406340644065406640674068406940704071407240734074407540764077407840794080408140824083408440854086408740884089409040914092409340944095409640974098409941004101410241034104410541064107410841094110411141124113411441154116411741184119412041214122412341244125412641274128412941304131413241334134413541364137413841394140414141424143414441454146414741484149415041514152415341544155415641574158415941604161416241634164416541664167416841694170417141724173417441754176417741784179418041814182418341844185418641874188418941904191419241934194419541964197419841994200420142024203420442054206420742084209421042114212421342144215421642174218421942204221422242234224422542264227422842294230423142324233423442354236423742384239424042414242424342444245424642474248424942504251425242534254425542564257425842594260426142624263426442654266426742684269427042714272427342744275427642774278427942804281428242834284428542864287428842894290429142924293429442954296429742984299430043014302430343044305430643074308430943104311431243134314431543164317431843194320432143224323432443254326432743284329433043314332433343344335433643374338433943404341434243434344434543464347434843494350435143524353435443554356435743584359436043614362436343644365436643674368436943704371437243734374437543764377437843794380438143824383438443854386438743884389439043914392439343944395439643974398439944004401440244034404440544064407440844094410441144124413441444154416441744184419442044214422442344244425442644274428442944304431443244334434443544364437443844394440444144424443444444454446444744484449445044514452445344544455445644574458445944604461446244634464446544664467446844694470447144724473447444754476447744784479448044814482448344844485448644874488448944904491449244934494449544964497449844994500450145024503450445054506450745084509451045114512451345144515451645174518451945204521452245234524452545264527452845294530453145324533453445354536453745384539454045414542454345444545454645474548454945504551455245534554455545564557455845594560456145624563456445654566456745684569457045714572457345744575457645774578457945804581458245834584458545864587458845894590459145924593459445954596459745984599460046014602460346044605460646074608460946104611461246134614461546164617461846194620462146224623462446254626462746284629463046314632463346344635463646374638463946404641464246434644464546464647464846494650465146524653465446554656465746584659466046614662466346644665466646674668466946704671467246734674467546764677467846794680468146824683468446854686468746884689469046914692469346944695469646974698469947004701470247034704470547064707470847094710471147124713471447154716471747184719472047214722472347244725472647274728472947304731473247334734473547364737473847394740474147424743474447454746474747484749475047514752475347544755475647574758475947604761476247634764476547664767476847694770477147724773477447754776477747784779478047814782478347844785478647874788478947904791479247934794479547964797479847994800480148024803480448054806480748084809481048114812481348144815481648174818481948204821482248234824482548264827482848294830483148324833483448354836483748384839484048414842484348444845484648474848484948504851485248534854485548564857485848594860486148624863486448654866486748684869487048714872487348744875487648774878487948804881488248834884488548864887488848894890489148924893489448954896489748984899490049014902490349044905490649074908490949104911491249134914491549164917491849194920492149224923492449254926492749284929493049314932493349344935493649374938493949404941494249434944494549464947494849494950495149524953495449554956495749584959496049614962496349644965496649674968496949704971497249734974497549764977497849794980498149824983498449854986498749884989499049914992499349944995499649974998499950005001500250035004500550065007500850095010501150125013501450155016501750185019502050215022502350245025502650275028502950305031503250335034503550365037503850395040504150425043504450455046504750485049505050515052505350545055505650575058505950605061506250635064506550665067506850695070507150725073507450755076507750785079508050815082508350845085508650875088508950905091509250935094509550965097509850995100510151025103510451055106510751085109511051115112511351145115511651175118511951205121512251235124512551265127512851295130513151325133513451355136513751385139514051415142514351445145514651475148514951505151515251535154515551565157515851595160516151625163516451655166516751685169517051715172517351745175517651775178517951805181518251835184518551865187518851895190519151925193519451955196519751985199520052015202520352045205520652075208520952105211521252135214521552165217521852195220522152225223522452255226522752285229523052315232523352345235523652375238523952405241524252435244524552465247524852495250525152525253525452555256525752585259526052615262526352645265526652675268526952705271527252735274527552765277527852795280528152825283528452855286528752885289529052915292529352945295529652975298529953005301530253035304530553065307530853095310531153125313531453155316531753185319532053215322532353245325532653275328532953305331533253335334533553365337533853395340534153425343534453455346534753485349535053515352535353545355535653575358535953605361536253635364536553665367536853695370537153725373537453755376537753785379538053815382538353845385538653875388538953905391539253935394539553965397539853995400540154025403540454055406540754085409541054115412541354145415541654175418541954205421542254235424542554265427542854295430543154325433543454355436543754385439544054415442544354445445544654475448544954505451545254535454545554565457545854595460546154625463546454655466546754685469547054715472547354745475547654775478547954805481548254835484548554865487548854895490549154925493549454955496549754985499550055015502550355045505550655075508550955105511551255135514551555165517551855195520552155225523552455255526552755285529553055315532553355345535553655375538553955405541554255435544554555465547554855495550555155525553555455555556555755585559556055615562556355645565556655675568556955705571557255735574557555765577557855795580558155825583558455855586558755885589559055915592559355945595559655975598559956005601560256035604560556065607560856095610561156125613561456155616561756185619562056215622562356245625562656275628562956305631563256335634563556365637563856395640564156425643564456455646564756485649565056515652565356545655565656575658565956605661566256635664566556665667566856695670567156725673567456755676567756785679568056815682568356845685568656875688568956905691569256935694569556965697569856995700570157025703570457055706570757085709571057115712571357145715571657175718571957205721572257235724572557265727572857295730573157325733573457355736573757385739574057415742574357445745574657475748574957505751575257535754575557565757575857595760576157625763576457655766576757685769577057715772577357745775577657775778577957805781578257835784578557865787578857895790579157925793579457955796579757985799580058015802580358045805580658075808580958105811581258135814581558165817581858195820582158225823582458255826582758285829583058315832583358345835583658375838583958405841584258435844584558465847584858495850585158525853585458555856585758585859586058615862586358645865586658675868586958705871587258735874587558765877587858795880588158825883588458855886588758885889589058915892589358945895589658975898589959005901590259035904590559065907590859095910591159125913591459155916591759185919592059215922592359245925592659275928592959305931593259335934593559365937593859395940594159425943594459455946594759485949595059515952595359545955595659575958595959605961596259635964596559665967596859695970597159725973597459755976597759785979598059815982598359845985598659875988598959905991599259935994599559965997599859996000600160026003600460056006600760086009601060116012601360146015601660176018601960206021602260236024602560266027602860296030603160326033603460356036603760386039604060416042604360446045604660476048604960506051605260536054605560566057605860596060606160626063606460656066606760686069607060716072607360746075607660776078607960806081608260836084608560866087608860896090609160926093609460956096609760986099610061016102610361046105610661076108610961106111611261136114611561166117611861196120612161226123612461256126612761286129613061316132613361346135613661376138613961406141614261436144614561466147614861496150615161526153615461556156615761586159616061616162616361646165616661676168616961706171617261736174617561766177617861796180618161826183618461856186618761886189619061916192619361946195619661976198619962006201620262036204620562066207620862096210621162126213621462156216621762186219622062216222622362246225622662276228622962306231623262336234623562366237623862396240624162426243624462456246624762486249625062516252625362546255625662576258625962606261626262636264626562666267626862696270627162726273627462756276627762786279628062816282628362846285628662876288628962906291629262936294629562966297629862996300630163026303630463056306630763086309631063116312631363146315631663176318631963206321632263236324632563266327632863296330633163326333633463356336633763386339634063416342634363446345634663476348634963506351635263536354635563566357635863596360636163626363636463656366636763686369637063716372637363746375637663776378637963806381638263836384638563866387638863896390639163926393639463956396639763986399640064016402640364046405640664076408640964106411641264136414641564166417641864196420642164226423642464256426642764286429643064316432643364346435643664376438643964406441644264436444644564466447644864496450645164526453645464556456645764586459646064616462646364646465646664676468646964706471647264736474647564766477647864796480648164826483648464856486648764886489649064916492649364946495649664976498649965006501650265036504650565066507650865096510651165126513651465156516651765186519652065216522652365246525652665276528652965306531653265336534653565366537653865396540654165426543654465456546654765486549655065516552655365546555655665576558655965606561656265636564656565666567656865696570657165726573657465756576657765786579658065816582658365846585658665876588658965906591659265936594659565966597659865996600660166026603660466056606660766086609661066116612661366146615661666176618661966206621662266236624662566266627662866296630663166326633663466356636663766386639664066416642664366446645664666476648664966506651665266536654665566566657665866596660666166626663666466656666666766686669667066716672667366746675667666776678667966806681668266836684668566866687668866896690669166926693669466956696669766986699670067016702670367046705670667076708670967106711671267136714671567166717671867196720672167226723672467256726672767286729673067316732673367346735673667376738673967406741674267436744674567466747674867496750675167526753675467556756675767586759676067616762676367646765676667676768676967706771677267736774677567766777677867796780678167826783678467856786678767886789679067916792679367946795679667976798679968006801680268036804680568066807680868096810681168126813681468156816681768186819682068216822682368246825682668276828682968306831683268336834683568366837683868396840684168426843684468456846684768486849685068516852685368546855685668576858685968606861686268636864686568666867686868696870687168726873687468756876687768786879688068816882688368846885688668876888688968906891689268936894689568966897689868996900690169026903690469056906690769086909691069116912691369146915691669176918691969206921692269236924692569266927692869296930693169326933693469356936693769386939694069416942694369446945694669476948694969506951695269536954695569566957695869596960696169626963696469656966696769686969697069716972697369746975697669776978697969806981698269836984698569866987698869896990699169926993699469956996699769986999700070017002700370047005700670077008700970107011701270137014701570167017701870197020702170227023702470257026702770287029703070317032703370347035703670377038703970407041704270437044704570467047704870497050705170527053705470557056705770587059706070617062706370647065706670677068706970707071707270737074707570767077707870797080708170827083708470857086708770887089709070917092709370947095709670977098709971007101710271037104710571067107710871097110711171127113711471157116711771187119712071217122712371247125712671277128712971307131713271337134713571367137713871397140714171427143714471457146714771487149715071517152715371547155715671577158715971607161716271637164716571667167716871697170717171727173717471757176717771787179718071817182718371847185718671877188 |
- // Copyright 2021 Tencent Inc. All rights reserved.
- //
- // 营销商家券对外API
- //
- // No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
- //
- // API version: 0.0.11
- // Code generated by WechatPay APIv3 Generator based on [OpenAPI Generator](https://openapi-generator.tech); DO NOT EDIT.
- package merchantexclusivecoupon
- import (
- "encoding/json"
- "fmt"
- "strings"
- "time"
- )
- // AssociateTradeInfoRequest
- type AssociateTradeInfoRequest struct {
- // 微信为每个商家券批次分配的唯一ID,对于商户自定义code的批次,关联请求必须填写批次号
- StockId *string `json:"stock_id"`
- // 券的唯一标识
- CouponCode *string `json:"coupon_code"`
- // 微信支付下单时的商户订单号,欲与该商家券关联的微信支付
- OutTradeNo *string `json:"out_trade_no"`
- // 商户创建批次凭据号(格式:商户ID+日期+流水号),商户侧需保持唯一性,可包含英文字母,数字,|,\\_,\\*,-等内容,不允许出现其他不合法符号。
- OutRequestNo *string `json:"out_request_no"`
- }
- func (o AssociateTradeInfoRequest) MarshalJSON() ([]byte, error) {
- toSerialize := map[string]interface{}{}
- if o.StockId == nil {
- return nil, fmt.Errorf("field `StockId` is required and must be specified in AssociateTradeInfoRequest")
- }
- toSerialize["stock_id"] = o.StockId
- if o.CouponCode == nil {
- return nil, fmt.Errorf("field `CouponCode` is required and must be specified in AssociateTradeInfoRequest")
- }
- toSerialize["coupon_code"] = o.CouponCode
- if o.OutTradeNo == nil {
- return nil, fmt.Errorf("field `OutTradeNo` is required and must be specified in AssociateTradeInfoRequest")
- }
- toSerialize["out_trade_no"] = o.OutTradeNo
- if o.OutRequestNo == nil {
- return nil, fmt.Errorf("field `OutRequestNo` is required and must be specified in AssociateTradeInfoRequest")
- }
- toSerialize["out_request_no"] = o.OutRequestNo
- return json.Marshal(toSerialize)
- }
- func (o AssociateTradeInfoRequest) String() string {
- var ret string
- if o.StockId == nil {
- ret += "StockId:<nil>, "
- } else {
- ret += fmt.Sprintf("StockId:%v, ", *o.StockId)
- }
- if o.CouponCode == nil {
- ret += "CouponCode:<nil>, "
- } else {
- ret += fmt.Sprintf("CouponCode:%v, ", *o.CouponCode)
- }
- if o.OutTradeNo == nil {
- ret += "OutTradeNo:<nil>, "
- } else {
- ret += fmt.Sprintf("OutTradeNo:%v, ", *o.OutTradeNo)
- }
- if o.OutRequestNo == nil {
- ret += "OutRequestNo:<nil>"
- } else {
- ret += fmt.Sprintf("OutRequestNo:%v", *o.OutRequestNo)
- }
- return fmt.Sprintf("AssociateTradeInfoRequest{%s}", ret)
- }
- func (o AssociateTradeInfoRequest) Clone() *AssociateTradeInfoRequest {
- ret := AssociateTradeInfoRequest{}
- if o.StockId != nil {
- ret.StockId = new(string)
- *ret.StockId = *o.StockId
- }
- if o.CouponCode != nil {
- ret.CouponCode = new(string)
- *ret.CouponCode = *o.CouponCode
- }
- if o.OutTradeNo != nil {
- ret.OutTradeNo = new(string)
- *ret.OutTradeNo = *o.OutTradeNo
- }
- if o.OutRequestNo != nil {
- ret.OutRequestNo = new(string)
- *ret.OutRequestNo = *o.OutRequestNo
- }
- return &ret
- }
- // AssociateTradeInfoResponse
- type AssociateTradeInfoResponse struct {
- // 系统关联券成功的时间,遵循[rfc3339](https://datatracker.ietf.org/doc/html/rfc3339)标准格式,格式为yyyy-MM-DDTHH:mm:ss+TIMEZONE,yyyy-MM-DD表示年月日,T出现在字符串中,表示time元素的开头,HH:mm:ss表示时分秒,TIMEZONE表示时区(+08:00表示东八区时间,领先UTC 8小时,即北京时间)。例如:2015-05-20T13:29:35+08:00表示,北京时间2015年5月20日 13点29分35秒。
- WechatpayAssociateTime *time.Time `json:"wechatpay_associate_time"`
- }
- func (o AssociateTradeInfoResponse) MarshalJSON() ([]byte, error) {
- toSerialize := map[string]interface{}{}
- if o.WechatpayAssociateTime == nil {
- return nil, fmt.Errorf("field `WechatpayAssociateTime` is required and must be specified in AssociateTradeInfoResponse")
- }
- toSerialize["wechatpay_associate_time"] = o.WechatpayAssociateTime.Format(time.RFC3339)
- return json.Marshal(toSerialize)
- }
- func (o AssociateTradeInfoResponse) String() string {
- var ret string
- if o.WechatpayAssociateTime == nil {
- ret += "WechatpayAssociateTime:<nil>"
- } else {
- ret += fmt.Sprintf("WechatpayAssociateTime:%v", *o.WechatpayAssociateTime)
- }
- return fmt.Sprintf("AssociateTradeInfoResponse{%s}", ret)
- }
- func (o AssociateTradeInfoResponse) Clone() *AssociateTradeInfoResponse {
- ret := AssociateTradeInfoResponse{}
- if o.WechatpayAssociateTime != nil {
- ret.WechatpayAssociateTime = new(time.Time)
- *ret.WechatpayAssociateTime = *o.WechatpayAssociateTime
- }
- return &ret
- }
- // AvailableCurrentDayTime
- type AvailableCurrentDayTime struct {
- // 当天可用开始时间 单位秒 1代表当天0点0分1秒
- BeginTime *int64 `json:"begin_time,omitempty"`
- // 当天可用结束时间 单位秒 86399代表当天23点59分59秒
- EndTime *int64 `json:"end_time,omitempty"`
- }
- func (o AvailableCurrentDayTime) MarshalJSON() ([]byte, error) {
- toSerialize := map[string]interface{}{}
- if o.BeginTime != nil {
- toSerialize["begin_time"] = o.BeginTime
- }
- if o.EndTime != nil {
- toSerialize["end_time"] = o.EndTime
- }
- return json.Marshal(toSerialize)
- }
- func (o AvailableCurrentDayTime) String() string {
- var ret string
- if o.BeginTime == nil {
- ret += "BeginTime:<nil>, "
- } else {
- ret += fmt.Sprintf("BeginTime:%v, ", *o.BeginTime)
- }
- if o.EndTime == nil {
- ret += "EndTime:<nil>"
- } else {
- ret += fmt.Sprintf("EndTime:%v", *o.EndTime)
- }
- return fmt.Sprintf("AvailableCurrentDayTime{%s}", ret)
- }
- func (o AvailableCurrentDayTime) Clone() *AvailableCurrentDayTime {
- ret := AvailableCurrentDayTime{}
- if o.BeginTime != nil {
- ret.BeginTime = new(int64)
- *ret.BeginTime = *o.BeginTime
- }
- if o.EndTime != nil {
- ret.EndTime = new(int64)
- *ret.EndTime = *o.EndTime
- }
- return &ret
- }
- // AvailableWeek
- type AvailableWeek struct {
- // 0代表周日,1代表周一,以此类推 当填写available_day_time时,week_day必填
- WeekDay []int64 `json:"week_day,omitempty"`
- // 可以填写多个时间段,最多不超过2个
- AvailableDayTime []AvailableCurrentDayTime `json:"available_day_time,omitempty"`
- }
- func (o AvailableWeek) MarshalJSON() ([]byte, error) {
- toSerialize := map[string]interface{}{}
- if o.WeekDay != nil {
- toSerialize["week_day"] = o.WeekDay
- }
- if o.AvailableDayTime != nil {
- toSerialize["available_day_time"] = o.AvailableDayTime
- }
- return json.Marshal(toSerialize)
- }
- func (o AvailableWeek) String() string {
- var ret string
- ret += fmt.Sprintf("WeekDay:%v, ", o.WeekDay)
- ret += fmt.Sprintf("AvailableDayTime:%v", o.AvailableDayTime)
- return fmt.Sprintf("AvailableWeek{%s}", ret)
- }
- func (o AvailableWeek) Clone() *AvailableWeek {
- ret := AvailableWeek{}
- if o.WeekDay != nil {
- ret.WeekDay = make([]int64, len(o.WeekDay))
- for i, item := range o.WeekDay {
- ret.WeekDay[i] = item
- }
- }
- if o.AvailableDayTime != nil {
- ret.AvailableDayTime = make([]AvailableCurrentDayTime, len(o.AvailableDayTime))
- for i, item := range o.AvailableDayTime {
- ret.AvailableDayTime[i] = *item.Clone()
- }
- }
- return &ret
- }
- // BusiFavorStockType
- type BusiFavorStockType string
- func (e BusiFavorStockType) Ptr() *BusiFavorStockType {
- return &e
- }
- // Enums of BusiFavorStockType
- const (
- BUSIFAVORSTOCKTYPE_NORMAL BusiFavorStockType = "NORMAL"
- BUSIFAVORSTOCKTYPE_DISCOUNT BusiFavorStockType = "DISCOUNT"
- BUSIFAVORSTOCKTYPE_EXCHANGE BusiFavorStockType = "EXCHANGE"
- )
- // CodeDisplayMode
- type CodeDisplayMode string
- func (e CodeDisplayMode) Ptr() *CodeDisplayMode {
- return &e
- }
- // Enums of CodeDisplayMode
- const (
- CODEDISPLAYMODE_NOT_SHOW CodeDisplayMode = "NOT_SHOW"
- CODEDISPLAYMODE_BARCODE CodeDisplayMode = "BARCODE"
- CODEDISPLAYMODE_QRCODE CodeDisplayMode = "QRCODE"
- )
- // CouponCodeCount
- type CouponCodeCount struct {
- // 该批次总共已上传的code总数
- TotalCount *int64 `json:"total_count"`
- // 该批次当前可用的code数
- AvailableCount *int64 `json:"available_count"`
- }
- func (o CouponCodeCount) MarshalJSON() ([]byte, error) {
- toSerialize := map[string]interface{}{}
- if o.TotalCount == nil {
- return nil, fmt.Errorf("field `TotalCount` is required and must be specified in CouponCodeCount")
- }
- toSerialize["total_count"] = o.TotalCount
- if o.AvailableCount == nil {
- return nil, fmt.Errorf("field `AvailableCount` is required and must be specified in CouponCodeCount")
- }
- toSerialize["available_count"] = o.AvailableCount
- return json.Marshal(toSerialize)
- }
- func (o CouponCodeCount) String() string {
- var ret string
- if o.TotalCount == nil {
- ret += "TotalCount:<nil>, "
- } else {
- ret += fmt.Sprintf("TotalCount:%v, ", *o.TotalCount)
- }
- if o.AvailableCount == nil {
- ret += "AvailableCount:<nil>"
- } else {
- ret += fmt.Sprintf("AvailableCount:%v", *o.AvailableCount)
- }
- return fmt.Sprintf("CouponCodeCount{%s}", ret)
- }
- func (o CouponCodeCount) Clone() *CouponCodeCount {
- ret := CouponCodeCount{}
- if o.TotalCount != nil {
- ret.TotalCount = new(int64)
- *ret.TotalCount = *o.TotalCount
- }
- if o.AvailableCount != nil {
- ret.AvailableCount = new(int64)
- *ret.AvailableCount = *o.AvailableCount
- }
- return &ret
- }
- // CouponCodeEntity
- type CouponCodeEntity struct {
- // 商户上传code
- Code *string `json:"code"`
- // 商户上传code分配状态
- CodeStatus *CouponCodeStatus `json:"code_status"`
- // code上传成功的时间
- UploadTime *time.Time `json:"upload_time,omitempty"`
- // 当code状态为被分配时,code被分配的时间
- DispatchedTime *time.Time `json:"dispatched_time,omitempty"`
- // 领券用户的OpenID
- Openid *string `json:"openid,omitempty"`
- // 领券用户的UnionID,具体参见https://developers.weixin.qq.com/miniprogram/dev/framework/open-ability/union-id.html
- Unionid *string `json:"unionid,omitempty"`
- // 券的唯一标识
- CouponCode *string `json:"coupon_code,omitempty"`
- }
- func (o CouponCodeEntity) MarshalJSON() ([]byte, error) {
- toSerialize := map[string]interface{}{}
- if o.Code == nil {
- return nil, fmt.Errorf("field `Code` is required and must be specified in CouponCodeEntity")
- }
- toSerialize["code"] = o.Code
- if o.CodeStatus == nil {
- return nil, fmt.Errorf("field `CodeStatus` is required and must be specified in CouponCodeEntity")
- }
- toSerialize["code_status"] = o.CodeStatus
- if o.UploadTime != nil {
- toSerialize["upload_time"] = o.UploadTime.Format(time.RFC3339)
- }
- if o.DispatchedTime != nil {
- toSerialize["dispatched_time"] = o.DispatchedTime.Format(time.RFC3339)
- }
- if o.Openid != nil {
- toSerialize["openid"] = o.Openid
- }
- if o.Unionid != nil {
- toSerialize["unionid"] = o.Unionid
- }
- if o.CouponCode != nil {
- toSerialize["coupon_code"] = o.CouponCode
- }
- return json.Marshal(toSerialize)
- }
- func (o CouponCodeEntity) String() string {
- var ret string
- if o.Code == nil {
- ret += "Code:<nil>, "
- } else {
- ret += fmt.Sprintf("Code:%v, ", *o.Code)
- }
- if o.CodeStatus == nil {
- ret += "CodeStatus:<nil>, "
- } else {
- ret += fmt.Sprintf("CodeStatus:%v, ", *o.CodeStatus)
- }
- if o.UploadTime == nil {
- ret += "UploadTime:<nil>, "
- } else {
- ret += fmt.Sprintf("UploadTime:%v, ", *o.UploadTime)
- }
- if o.DispatchedTime == nil {
- ret += "DispatchedTime:<nil>, "
- } else {
- ret += fmt.Sprintf("DispatchedTime:%v, ", *o.DispatchedTime)
- }
- if o.Openid == nil {
- ret += "Openid:<nil>, "
- } else {
- ret += fmt.Sprintf("Openid:%v, ", *o.Openid)
- }
- if o.Unionid == nil {
- ret += "Unionid:<nil>, "
- } else {
- ret += fmt.Sprintf("Unionid:%v, ", *o.Unionid)
- }
- if o.CouponCode == nil {
- ret += "CouponCode:<nil>"
- } else {
- ret += fmt.Sprintf("CouponCode:%v", *o.CouponCode)
- }
- return fmt.Sprintf("CouponCodeEntity{%s}", ret)
- }
- func (o CouponCodeEntity) Clone() *CouponCodeEntity {
- ret := CouponCodeEntity{}
- if o.Code != nil {
- ret.Code = new(string)
- *ret.Code = *o.Code
- }
- if o.CodeStatus != nil {
- ret.CodeStatus = new(CouponCodeStatus)
- *ret.CodeStatus = *o.CodeStatus
- }
- if o.UploadTime != nil {
- ret.UploadTime = new(time.Time)
- *ret.UploadTime = *o.UploadTime
- }
- if o.DispatchedTime != nil {
- ret.DispatchedTime = new(time.Time)
- *ret.DispatchedTime = *o.DispatchedTime
- }
- if o.Openid != nil {
- ret.Openid = new(string)
- *ret.Openid = *o.Openid
- }
- if o.Unionid != nil {
- ret.Unionid = new(string)
- *ret.Unionid = *o.Unionid
- }
- if o.CouponCode != nil {
- ret.CouponCode = new(string)
- *ret.CouponCode = *o.CouponCode
- }
- return &ret
- }
- // CouponCodeInfoRequest
- type CouponCodeInfoRequest struct {
- // 商家券批次号
- StockId *string `json:"stock_id"`
- // 商户上传code
- CouponCode *string `json:"coupon_code"`
- // 公众账号ID
- Appid *string `json:"appid,omitempty"`
- }
- func (o CouponCodeInfoRequest) MarshalJSON() ([]byte, error) {
- toSerialize := map[string]interface{}{}
- if o.StockId == nil {
- return nil, fmt.Errorf("field `StockId` is required and must be specified in CouponCodeInfoRequest")
- }
- toSerialize["stock_id"] = o.StockId
- if o.CouponCode == nil {
- return nil, fmt.Errorf("field `CouponCode` is required and must be specified in CouponCodeInfoRequest")
- }
- toSerialize["coupon_code"] = o.CouponCode
- if o.Appid != nil {
- toSerialize["appid"] = o.Appid
- }
- return json.Marshal(toSerialize)
- }
- func (o CouponCodeInfoRequest) String() string {
- var ret string
- if o.StockId == nil {
- ret += "StockId:<nil>, "
- } else {
- ret += fmt.Sprintf("StockId:%v, ", *o.StockId)
- }
- if o.CouponCode == nil {
- ret += "CouponCode:<nil>, "
- } else {
- ret += fmt.Sprintf("CouponCode:%v, ", *o.CouponCode)
- }
- if o.Appid == nil {
- ret += "Appid:<nil>"
- } else {
- ret += fmt.Sprintf("Appid:%v", *o.Appid)
- }
- return fmt.Sprintf("CouponCodeInfoRequest{%s}", ret)
- }
- func (o CouponCodeInfoRequest) Clone() *CouponCodeInfoRequest {
- ret := CouponCodeInfoRequest{}
- if o.StockId != nil {
- ret.StockId = new(string)
- *ret.StockId = *o.StockId
- }
- if o.CouponCode != nil {
- ret.CouponCode = new(string)
- *ret.CouponCode = *o.CouponCode
- }
- if o.Appid != nil {
- ret.Appid = new(string)
- *ret.Appid = *o.Appid
- }
- return &ret
- }
- // CouponCodeInfoResponse
- type CouponCodeInfoResponse struct {
- // 商户上传code信息,含状态,上传时间等
- CodeInformation *CouponCodeEntity `json:"code_information"`
- // 用户券信息,仅当商户上传code的状态为DISPATCHED时返回券详情
- CouponInformation *CouponEntity `json:"coupon_information,omitempty"`
- }
- func (o CouponCodeInfoResponse) MarshalJSON() ([]byte, error) {
- toSerialize := map[string]interface{}{}
- if o.CodeInformation == nil {
- return nil, fmt.Errorf("field `CodeInformation` is required and must be specified in CouponCodeInfoResponse")
- }
- toSerialize["code_information"] = o.CodeInformation
- if o.CouponInformation != nil {
- toSerialize["coupon_information"] = o.CouponInformation
- }
- return json.Marshal(toSerialize)
- }
- func (o CouponCodeInfoResponse) String() string {
- var ret string
- ret += fmt.Sprintf("CodeInformation:%v, ", o.CodeInformation)
- ret += fmt.Sprintf("CouponInformation:%v", o.CouponInformation)
- return fmt.Sprintf("CouponCodeInfoResponse{%s}", ret)
- }
- func (o CouponCodeInfoResponse) Clone() *CouponCodeInfoResponse {
- ret := CouponCodeInfoResponse{}
- if o.CodeInformation != nil {
- ret.CodeInformation = o.CodeInformation.Clone()
- }
- if o.CouponInformation != nil {
- ret.CouponInformation = o.CouponInformation.Clone()
- }
- return &ret
- }
- // CouponCodeListResponse
- type CouponCodeListResponse struct {
- // 商家券批次号
- StockId *string `json:"stock_id"`
- // 该批次已上传code总个数
- TotalCount *int64 `json:"total_count"`
- // 查询code的结果列表
- Data []CouponCodeEntity `json:"data,omitempty"`
- // 分页起始位置,与请求相同
- Offset *int64 `json:"offset"`
- // 返回数据的实际个数
- Limit *int64 `json:"limit"`
- }
- func (o CouponCodeListResponse) MarshalJSON() ([]byte, error) {
- toSerialize := map[string]interface{}{}
- if o.StockId == nil {
- return nil, fmt.Errorf("field `StockId` is required and must be specified in CouponCodeListResponse")
- }
- toSerialize["stock_id"] = o.StockId
- if o.TotalCount == nil {
- return nil, fmt.Errorf("field `TotalCount` is required and must be specified in CouponCodeListResponse")
- }
- toSerialize["total_count"] = o.TotalCount
- if o.Data != nil {
- toSerialize["data"] = o.Data
- }
- if o.Offset == nil {
- return nil, fmt.Errorf("field `Offset` is required and must be specified in CouponCodeListResponse")
- }
- toSerialize["offset"] = o.Offset
- if o.Limit == nil {
- return nil, fmt.Errorf("field `Limit` is required and must be specified in CouponCodeListResponse")
- }
- toSerialize["limit"] = o.Limit
- return json.Marshal(toSerialize)
- }
- func (o CouponCodeListResponse) String() string {
- var ret string
- if o.StockId == nil {
- ret += "StockId:<nil>, "
- } else {
- ret += fmt.Sprintf("StockId:%v, ", *o.StockId)
- }
- if o.TotalCount == nil {
- ret += "TotalCount:<nil>, "
- } else {
- ret += fmt.Sprintf("TotalCount:%v, ", *o.TotalCount)
- }
- ret += fmt.Sprintf("Data:%v, ", o.Data)
- if o.Offset == nil {
- ret += "Offset:<nil>, "
- } else {
- ret += fmt.Sprintf("Offset:%v, ", *o.Offset)
- }
- if o.Limit == nil {
- ret += "Limit:<nil>"
- } else {
- ret += fmt.Sprintf("Limit:%v", *o.Limit)
- }
- return fmt.Sprintf("CouponCodeListResponse{%s}", ret)
- }
- func (o CouponCodeListResponse) Clone() *CouponCodeListResponse {
- ret := CouponCodeListResponse{}
- if o.StockId != nil {
- ret.StockId = new(string)
- *ret.StockId = *o.StockId
- }
- if o.TotalCount != nil {
- ret.TotalCount = new(int64)
- *ret.TotalCount = *o.TotalCount
- }
- if o.Data != nil {
- ret.Data = make([]CouponCodeEntity, len(o.Data))
- for i, item := range o.Data {
- ret.Data[i] = *item.Clone()
- }
- }
- if o.Offset != nil {
- ret.Offset = new(int64)
- *ret.Offset = *o.Offset
- }
- if o.Limit != nil {
- ret.Limit = new(int64)
- *ret.Limit = *o.Limit
- }
- return &ret
- }
- // CouponCodeMode
- type CouponCodeMode string
- func (e CouponCodeMode) Ptr() *CouponCodeMode {
- return &e
- }
- // Enums of CouponCodeMode
- const (
- COUPONCODEMODE_WECHATPAY_MODE CouponCodeMode = "WECHATPAY_MODE"
- COUPONCODEMODE_MERCHANT_API CouponCodeMode = "MERCHANT_API"
- COUPONCODEMODE_MERCHANT_UPLOAD CouponCodeMode = "MERCHANT_UPLOAD"
- )
- // CouponCodeStatus
- type CouponCodeStatus string
- func (e CouponCodeStatus) Ptr() *CouponCodeStatus {
- return &e
- }
- // Enums of CouponCodeStatus
- const (
- COUPONCODESTATUS_AVAILABLE CouponCodeStatus = "AVAILABLE"
- COUPONCODESTATUS_DISPATCHED CouponCodeStatus = "DISPATCHED"
- )
- // CouponEntity
- type CouponEntity struct {
- // 代金券的所属商户号
- BelongMerchant *string `json:"belong_merchant"`
- // 批次名称,字数上限为21个,一个中文汉字/英文字母/数字均占用一个字数。
- StockName *string `json:"stock_name"`
- // 仅配置商户可见,用于自定义信息。字数上限为20个,一个中文汉字/英文字母/数字均占用一个字数。
- Comment *string `json:"comment,omitempty"`
- // 适用商品范围,字数上限为15个,一个中文汉字/英文字母/数字均占用一个字数。
- GoodsName *string `json:"goods_name"`
- // 批次类型
- StockType *BusiFavorStockType `json:"stock_type"`
- // 不填默认否,枚举值: true:是 false:否 该字段暂未开放
- Transferable *bool `json:"transferable,omitempty"`
- // 不填默认否,枚举值: true:是 false:否 该字段暂未开放
- Shareable *bool `json:"shareable,omitempty"`
- // 商家券状态
- CouponState *CouponStatus `json:"coupon_state,omitempty"`
- //
- DisplayPatternInfo *DisplayPatternInfo `json:"display_pattern_info,omitempty"`
- //
- CouponUseRule *CouponUseRule `json:"coupon_use_rule"`
- //
- CustomEntrance *CustomEntrance `json:"custom_entrance,omitempty"`
- // 券的唯一标识
- CouponCode *string `json:"coupon_code,omitempty"`
- // 批次号
- StockId *string `json:"stock_id,omitempty"`
- // 用户领取到的这张券实际可使用的开始时间:如批次设置的领取后可用,则开始时间即为券的领取时间; 如批次设置的领取后第X天可用,则为领取时间后第X天00:00:00
- AvailableStartTime *time.Time `json:"available_start_time,omitempty"`
- // 用户领取到这张券的过期时间
- ExpireTime *time.Time `json:"expire_time,omitempty"`
- // 用户领取到这张券的时间
- ReceiveTime *time.Time `json:"receive_time,omitempty"`
- // 发券时传入的唯一凭证
- SendRequestNo *string `json:"send_request_no,omitempty"`
- // 核销时传入的唯一凭证(如券已被核销,将返回此字段)
- UseRequestNo *string `json:"use_request_no,omitempty"`
- // 券被核销的时间(如券已被核销,将返回此字段)
- UseTime *time.Time `json:"use_time,omitempty"`
- // 若商家券操作过关联商户订单信息,则该字段返回商家券已关联的商户订单号。
- AssociateOutTradeNo *time.Time `json:"associate_out_trade_no,omitempty"`
- // 回退时传入的唯一凭证(如券发生了退回,将返回此字段)
- ReturnRequestNo *string `json:"return_request_no,omitempty"`
- // 券被回退的时间(如券发生了退回,将返回此字段)
- ReturnTime *time.Time `json:"return_time,omitempty"`
- // 失效时传入的唯一凭证(如果一张券已失效,将返回此字段)
- DeactivateRequestNo *string `json:"deactivate_request_no,omitempty"`
- // 券被失效的时间(如果一张券已失效,将返回此字段)
- DeactivateTime *time.Time `json:"deactivate_time,omitempty"`
- // 失效一张券的原因(如果一张券已失效,可能返回此字段)
- DeactivateReason *string `json:"deactivate_reason,omitempty"`
- }
- func (o CouponEntity) MarshalJSON() ([]byte, error) {
- toSerialize := map[string]interface{}{}
- if o.BelongMerchant == nil {
- return nil, fmt.Errorf("field `BelongMerchant` is required and must be specified in CouponEntity")
- }
- toSerialize["belong_merchant"] = o.BelongMerchant
- if o.StockName == nil {
- return nil, fmt.Errorf("field `StockName` is required and must be specified in CouponEntity")
- }
- toSerialize["stock_name"] = o.StockName
- if o.Comment != nil {
- toSerialize["comment"] = o.Comment
- }
- if o.GoodsName == nil {
- return nil, fmt.Errorf("field `GoodsName` is required and must be specified in CouponEntity")
- }
- toSerialize["goods_name"] = o.GoodsName
- if o.StockType == nil {
- return nil, fmt.Errorf("field `StockType` is required and must be specified in CouponEntity")
- }
- toSerialize["stock_type"] = o.StockType
- if o.Transferable != nil {
- toSerialize["transferable"] = o.Transferable
- }
- if o.Shareable != nil {
- toSerialize["shareable"] = o.Shareable
- }
- if o.CouponState != nil {
- toSerialize["coupon_state"] = o.CouponState
- }
- if o.DisplayPatternInfo != nil {
- toSerialize["display_pattern_info"] = o.DisplayPatternInfo
- }
- if o.CouponUseRule == nil {
- return nil, fmt.Errorf("field `CouponUseRule` is required and must be specified in CouponEntity")
- }
- toSerialize["coupon_use_rule"] = o.CouponUseRule
- if o.CustomEntrance != nil {
- toSerialize["custom_entrance"] = o.CustomEntrance
- }
- if o.CouponCode != nil {
- toSerialize["coupon_code"] = o.CouponCode
- }
- if o.StockId != nil {
- toSerialize["stock_id"] = o.StockId
- }
- if o.AvailableStartTime != nil {
- toSerialize["available_start_time"] = o.AvailableStartTime.Format(time.RFC3339)
- }
- if o.ExpireTime != nil {
- toSerialize["expire_time"] = o.ExpireTime.Format(time.RFC3339)
- }
- if o.ReceiveTime != nil {
- toSerialize["receive_time"] = o.ReceiveTime.Format(time.RFC3339)
- }
- if o.SendRequestNo != nil {
- toSerialize["send_request_no"] = o.SendRequestNo
- }
- if o.UseRequestNo != nil {
- toSerialize["use_request_no"] = o.UseRequestNo
- }
- if o.UseTime != nil {
- toSerialize["use_time"] = o.UseTime.Format(time.RFC3339)
- }
- if o.AssociateOutTradeNo != nil {
- toSerialize["associate_out_trade_no"] = o.AssociateOutTradeNo.Format(time.RFC3339)
- }
- if o.ReturnRequestNo != nil {
- toSerialize["return_request_no"] = o.ReturnRequestNo
- }
- if o.ReturnTime != nil {
- toSerialize["return_time"] = o.ReturnTime.Format(time.RFC3339)
- }
- if o.DeactivateRequestNo != nil {
- toSerialize["deactivate_request_no"] = o.DeactivateRequestNo
- }
- if o.DeactivateTime != nil {
- toSerialize["deactivate_time"] = o.DeactivateTime.Format(time.RFC3339)
- }
- if o.DeactivateReason != nil {
- toSerialize["deactivate_reason"] = o.DeactivateReason
- }
- return json.Marshal(toSerialize)
- }
- func (o CouponEntity) String() string {
- var ret string
- if o.BelongMerchant == nil {
- ret += "BelongMerchant:<nil>, "
- } else {
- ret += fmt.Sprintf("BelongMerchant:%v, ", *o.BelongMerchant)
- }
- if o.StockName == nil {
- ret += "StockName:<nil>, "
- } else {
- ret += fmt.Sprintf("StockName:%v, ", *o.StockName)
- }
- if o.Comment == nil {
- ret += "Comment:<nil>, "
- } else {
- ret += fmt.Sprintf("Comment:%v, ", *o.Comment)
- }
- if o.GoodsName == nil {
- ret += "GoodsName:<nil>, "
- } else {
- ret += fmt.Sprintf("GoodsName:%v, ", *o.GoodsName)
- }
- if o.StockType == nil {
- ret += "StockType:<nil>, "
- } else {
- ret += fmt.Sprintf("StockType:%v, ", *o.StockType)
- }
- if o.Transferable == nil {
- ret += "Transferable:<nil>, "
- } else {
- ret += fmt.Sprintf("Transferable:%v, ", *o.Transferable)
- }
- if o.Shareable == nil {
- ret += "Shareable:<nil>, "
- } else {
- ret += fmt.Sprintf("Shareable:%v, ", *o.Shareable)
- }
- if o.CouponState == nil {
- ret += "CouponState:<nil>, "
- } else {
- ret += fmt.Sprintf("CouponState:%v, ", *o.CouponState)
- }
- ret += fmt.Sprintf("DisplayPatternInfo:%v, ", o.DisplayPatternInfo)
- ret += fmt.Sprintf("CouponUseRule:%v, ", o.CouponUseRule)
- ret += fmt.Sprintf("CustomEntrance:%v, ", o.CustomEntrance)
- if o.CouponCode == nil {
- ret += "CouponCode:<nil>, "
- } else {
- ret += fmt.Sprintf("CouponCode:%v, ", *o.CouponCode)
- }
- if o.StockId == nil {
- ret += "StockId:<nil>, "
- } else {
- ret += fmt.Sprintf("StockId:%v, ", *o.StockId)
- }
- if o.AvailableStartTime == nil {
- ret += "AvailableStartTime:<nil>, "
- } else {
- ret += fmt.Sprintf("AvailableStartTime:%v, ", *o.AvailableStartTime)
- }
- if o.ExpireTime == nil {
- ret += "ExpireTime:<nil>, "
- } else {
- ret += fmt.Sprintf("ExpireTime:%v, ", *o.ExpireTime)
- }
- if o.ReceiveTime == nil {
- ret += "ReceiveTime:<nil>, "
- } else {
- ret += fmt.Sprintf("ReceiveTime:%v, ", *o.ReceiveTime)
- }
- if o.SendRequestNo == nil {
- ret += "SendRequestNo:<nil>, "
- } else {
- ret += fmt.Sprintf("SendRequestNo:%v, ", *o.SendRequestNo)
- }
- if o.UseRequestNo == nil {
- ret += "UseRequestNo:<nil>, "
- } else {
- ret += fmt.Sprintf("UseRequestNo:%v, ", *o.UseRequestNo)
- }
- if o.UseTime == nil {
- ret += "UseTime:<nil>, "
- } else {
- ret += fmt.Sprintf("UseTime:%v, ", *o.UseTime)
- }
- if o.AssociateOutTradeNo == nil {
- ret += "AssociateOutTradeNo:<nil>, "
- } else {
- ret += fmt.Sprintf("AssociateOutTradeNo:%v, ", *o.AssociateOutTradeNo)
- }
- if o.ReturnRequestNo == nil {
- ret += "ReturnRequestNo:<nil>, "
- } else {
- ret += fmt.Sprintf("ReturnRequestNo:%v, ", *o.ReturnRequestNo)
- }
- if o.ReturnTime == nil {
- ret += "ReturnTime:<nil>, "
- } else {
- ret += fmt.Sprintf("ReturnTime:%v, ", *o.ReturnTime)
- }
- if o.DeactivateRequestNo == nil {
- ret += "DeactivateRequestNo:<nil>, "
- } else {
- ret += fmt.Sprintf("DeactivateRequestNo:%v, ", *o.DeactivateRequestNo)
- }
- if o.DeactivateTime == nil {
- ret += "DeactivateTime:<nil>, "
- } else {
- ret += fmt.Sprintf("DeactivateTime:%v, ", *o.DeactivateTime)
- }
- if o.DeactivateReason == nil {
- ret += "DeactivateReason:<nil>"
- } else {
- ret += fmt.Sprintf("DeactivateReason:%v", *o.DeactivateReason)
- }
- return fmt.Sprintf("CouponEntity{%s}", ret)
- }
- func (o CouponEntity) Clone() *CouponEntity {
- ret := CouponEntity{}
- if o.BelongMerchant != nil {
- ret.BelongMerchant = new(string)
- *ret.BelongMerchant = *o.BelongMerchant
- }
- if o.StockName != nil {
- ret.StockName = new(string)
- *ret.StockName = *o.StockName
- }
- if o.Comment != nil {
- ret.Comment = new(string)
- *ret.Comment = *o.Comment
- }
- if o.GoodsName != nil {
- ret.GoodsName = new(string)
- *ret.GoodsName = *o.GoodsName
- }
- if o.StockType != nil {
- ret.StockType = new(BusiFavorStockType)
- *ret.StockType = *o.StockType
- }
- if o.Transferable != nil {
- ret.Transferable = new(bool)
- *ret.Transferable = *o.Transferable
- }
- if o.Shareable != nil {
- ret.Shareable = new(bool)
- *ret.Shareable = *o.Shareable
- }
- if o.CouponState != nil {
- ret.CouponState = new(CouponStatus)
- *ret.CouponState = *o.CouponState
- }
- if o.DisplayPatternInfo != nil {
- ret.DisplayPatternInfo = o.DisplayPatternInfo.Clone()
- }
- if o.CouponUseRule != nil {
- ret.CouponUseRule = o.CouponUseRule.Clone()
- }
- if o.CustomEntrance != nil {
- ret.CustomEntrance = o.CustomEntrance.Clone()
- }
- if o.CouponCode != nil {
- ret.CouponCode = new(string)
- *ret.CouponCode = *o.CouponCode
- }
- if o.StockId != nil {
- ret.StockId = new(string)
- *ret.StockId = *o.StockId
- }
- if o.AvailableStartTime != nil {
- ret.AvailableStartTime = new(time.Time)
- *ret.AvailableStartTime = *o.AvailableStartTime
- }
- if o.ExpireTime != nil {
- ret.ExpireTime = new(time.Time)
- *ret.ExpireTime = *o.ExpireTime
- }
- if o.ReceiveTime != nil {
- ret.ReceiveTime = new(time.Time)
- *ret.ReceiveTime = *o.ReceiveTime
- }
- if o.SendRequestNo != nil {
- ret.SendRequestNo = new(string)
- *ret.SendRequestNo = *o.SendRequestNo
- }
- if o.UseRequestNo != nil {
- ret.UseRequestNo = new(string)
- *ret.UseRequestNo = *o.UseRequestNo
- }
- if o.UseTime != nil {
- ret.UseTime = new(time.Time)
- *ret.UseTime = *o.UseTime
- }
- if o.AssociateOutTradeNo != nil {
- ret.AssociateOutTradeNo = new(time.Time)
- *ret.AssociateOutTradeNo = *o.AssociateOutTradeNo
- }
- if o.ReturnRequestNo != nil {
- ret.ReturnRequestNo = new(string)
- *ret.ReturnRequestNo = *o.ReturnRequestNo
- }
- if o.ReturnTime != nil {
- ret.ReturnTime = new(time.Time)
- *ret.ReturnTime = *o.ReturnTime
- }
- if o.DeactivateRequestNo != nil {
- ret.DeactivateRequestNo = new(string)
- *ret.DeactivateRequestNo = *o.DeactivateRequestNo
- }
- if o.DeactivateTime != nil {
- ret.DeactivateTime = new(time.Time)
- *ret.DeactivateTime = *o.DeactivateTime
- }
- if o.DeactivateReason != nil {
- ret.DeactivateReason = new(string)
- *ret.DeactivateReason = *o.DeactivateReason
- }
- return &ret
- }
- // CouponListResponse
- type CouponListResponse struct {
- Data []CouponEntity `json:"data,omitempty"`
- // 总数量
- TotalCount *int64 `json:"total_count"`
- // 分页大小
- Limit *int64 `json:"limit"`
- // 分页页码
- Offset *int64 `json:"offset"`
- }
- func (o CouponListResponse) MarshalJSON() ([]byte, error) {
- toSerialize := map[string]interface{}{}
- if o.Data != nil {
- toSerialize["data"] = o.Data
- }
- if o.TotalCount == nil {
- return nil, fmt.Errorf("field `TotalCount` is required and must be specified in CouponListResponse")
- }
- toSerialize["total_count"] = o.TotalCount
- if o.Limit == nil {
- return nil, fmt.Errorf("field `Limit` is required and must be specified in CouponListResponse")
- }
- toSerialize["limit"] = o.Limit
- if o.Offset == nil {
- return nil, fmt.Errorf("field `Offset` is required and must be specified in CouponListResponse")
- }
- toSerialize["offset"] = o.Offset
- return json.Marshal(toSerialize)
- }
- func (o CouponListResponse) String() string {
- var ret string
- ret += fmt.Sprintf("Data:%v, ", o.Data)
- if o.TotalCount == nil {
- ret += "TotalCount:<nil>, "
- } else {
- ret += fmt.Sprintf("TotalCount:%v, ", *o.TotalCount)
- }
- if o.Limit == nil {
- ret += "Limit:<nil>, "
- } else {
- ret += fmt.Sprintf("Limit:%v, ", *o.Limit)
- }
- if o.Offset == nil {
- ret += "Offset:<nil>"
- } else {
- ret += fmt.Sprintf("Offset:%v", *o.Offset)
- }
- return fmt.Sprintf("CouponListResponse{%s}", ret)
- }
- func (o CouponListResponse) Clone() *CouponListResponse {
- ret := CouponListResponse{}
- if o.Data != nil {
- ret.Data = make([]CouponEntity, len(o.Data))
- for i, item := range o.Data {
- ret.Data[i] = *item.Clone()
- }
- }
- if o.TotalCount != nil {
- ret.TotalCount = new(int64)
- *ret.TotalCount = *o.TotalCount
- }
- if o.Limit != nil {
- ret.Limit = new(int64)
- *ret.Limit = *o.Limit
- }
- if o.Offset != nil {
- ret.Offset = new(int64)
- *ret.Offset = *o.Offset
- }
- return &ret
- }
- // CouponSendGovCardRequest
- type CouponSendGovCardRequest struct {
- // 消费卡cardi\\_d创建方的AppID,需与API调用方商户号有绑定关系,入参中的用户OpenID也需用此AppID生成
- Appid *string `json:"appid"`
- // 待发券用户的OpenID,需为消费卡创建方AppID生成的OpenID
- Openid *string `json:"openid"`
- // 商户此次发放凭据号。推荐使用大小写字母和数字,不同添加请求发放凭据号不同,商户侧需保证同一发券请求的out_request_no+send_time唯一性
- OutRequestNo *string `json:"out_request_no"`
- // 单次请求发卡时间,消费卡在商户系统的实际发放时间,为东八区标准时间(UTC+8)。商户需保证同一次请求的out_request_no+send_time唯一。由于系统限制,暂不支持传入早于当前时间24小时以上的时间进行发券请求。
- SendTime *string `json:"send_time"`
- }
- func (o CouponSendGovCardRequest) MarshalJSON() ([]byte, error) {
- toSerialize := map[string]interface{}{}
- if o.Appid == nil {
- return nil, fmt.Errorf("field `Appid` is required and must be specified in CouponSendGovCardRequest")
- }
- toSerialize["appid"] = o.Appid
- if o.Openid == nil {
- return nil, fmt.Errorf("field `Openid` is required and must be specified in CouponSendGovCardRequest")
- }
- toSerialize["openid"] = o.Openid
- if o.OutRequestNo == nil {
- return nil, fmt.Errorf("field `OutRequestNo` is required and must be specified in CouponSendGovCardRequest")
- }
- toSerialize["out_request_no"] = o.OutRequestNo
- if o.SendTime == nil {
- return nil, fmt.Errorf("field `SendTime` is required and must be specified in CouponSendGovCardRequest")
- }
- toSerialize["send_time"] = o.SendTime
- return json.Marshal(toSerialize)
- }
- func (o CouponSendGovCardRequest) String() string {
- var ret string
- if o.Appid == nil {
- ret += "Appid:<nil>, "
- } else {
- ret += fmt.Sprintf("Appid:%v, ", *o.Appid)
- }
- if o.Openid == nil {
- ret += "Openid:<nil>, "
- } else {
- ret += fmt.Sprintf("Openid:%v, ", *o.Openid)
- }
- if o.OutRequestNo == nil {
- ret += "OutRequestNo:<nil>, "
- } else {
- ret += fmt.Sprintf("OutRequestNo:%v, ", *o.OutRequestNo)
- }
- if o.SendTime == nil {
- ret += "SendTime:<nil>"
- } else {
- ret += fmt.Sprintf("SendTime:%v", *o.SendTime)
- }
- return fmt.Sprintf("CouponSendGovCardRequest{%s}", ret)
- }
- func (o CouponSendGovCardRequest) Clone() *CouponSendGovCardRequest {
- ret := CouponSendGovCardRequest{}
- if o.Appid != nil {
- ret.Appid = new(string)
- *ret.Appid = *o.Appid
- }
- if o.Openid != nil {
- ret.Openid = new(string)
- *ret.Openid = *o.Openid
- }
- if o.OutRequestNo != nil {
- ret.OutRequestNo = new(string)
- *ret.OutRequestNo = *o.OutRequestNo
- }
- if o.SendTime != nil {
- ret.SendTime = new(string)
- *ret.SendTime = *o.SendTime
- }
- return &ret
- }
- // CouponSendGovCardResponse
- type CouponSendGovCardResponse struct {
- // 消费卡card_id下的code
- CardCode *string `json:"card_code"`
- }
- func (o CouponSendGovCardResponse) MarshalJSON() ([]byte, error) {
- toSerialize := map[string]interface{}{}
- if o.CardCode == nil {
- return nil, fmt.Errorf("field `CardCode` is required and must be specified in CouponSendGovCardResponse")
- }
- toSerialize["card_code"] = o.CardCode
- return json.Marshal(toSerialize)
- }
- func (o CouponSendGovCardResponse) String() string {
- var ret string
- if o.CardCode == nil {
- ret += "CardCode:<nil>"
- } else {
- ret += fmt.Sprintf("CardCode:%v", *o.CardCode)
- }
- return fmt.Sprintf("CouponSendGovCardResponse{%s}", ret)
- }
- func (o CouponSendGovCardResponse) Clone() *CouponSendGovCardResponse {
- ret := CouponSendGovCardResponse{}
- if o.CardCode != nil {
- ret.CardCode = new(string)
- *ret.CardCode = *o.CardCode
- }
- return &ret
- }
- // CouponStatus
- type CouponStatus string
- func (e CouponStatus) Ptr() *CouponStatus {
- return &e
- }
- // Enums of CouponStatus
- const (
- COUPONSTATUS_SENDED CouponStatus = "SENDED"
- COUPONSTATUS_USED CouponStatus = "USED"
- COUPONSTATUS_EXPIRED CouponStatus = "EXPIRED"
- COUPONSTATUS_DELETED CouponStatus = "DELETED"
- COUPONSTATUS_DEACTIVATED CouponStatus = "DEACTIVATED"
- )
- // CouponUseMethod
- type CouponUseMethod string
- func (e CouponUseMethod) Ptr() *CouponUseMethod {
- return &e
- }
- // Enums of CouponUseMethod
- const (
- COUPONUSEMETHOD_OFF_LINE CouponUseMethod = "OFF_LINE"
- COUPONUSEMETHOD_MINI_PROGRAMS CouponUseMethod = "MINI_PROGRAMS"
- COUPONUSEMETHOD_SELF_CONSUME CouponUseMethod = "SELF_CONSUME"
- COUPONUSEMETHOD_PAYMENT_CODE CouponUseMethod = "PAYMENT_CODE"
- )
- // CouponUseRule
- type CouponUseRule struct {
- // 日期区间内可以使用优惠
- CouponAvailableTime *FavorAvailableTime `json:"coupon_available_time"`
- // 固定面额满减,折扣券,换购券使用规则三选一,stock_type为NORMAL时必填。
- FixedNormalCoupon *FixedValueStockMsg `json:"fixed_normal_coupon,omitempty"`
- // 固定面额满减,折扣券,换购券使用规则三选一,stock_type为DISCOUNT时必填。
- DiscountCoupon *DiscountMsg `json:"discount_coupon,omitempty"`
- // 固定面额满减,折扣券,换购券使用规则三选一,stock_type为EXCHANGE时必填。
- ExchangeCoupon *ExchangeMsg `json:"exchange_coupon,omitempty"`
- // 核销方式
- UseMethod *CouponUseMethod `json:"use_method"`
- // 核销方式为线上小程序核销才有效
- MiniProgramsAppid *string `json:"mini_programs_appid,omitempty"`
- // 核销方式为线上小程序核销才有效
- MiniProgramsPath *string `json:"mini_programs_path,omitempty"`
- }
- func (o CouponUseRule) MarshalJSON() ([]byte, error) {
- toSerialize := map[string]interface{}{}
- if o.CouponAvailableTime == nil {
- return nil, fmt.Errorf("field `CouponAvailableTime` is required and must be specified in CouponUseRule")
- }
- toSerialize["coupon_available_time"] = o.CouponAvailableTime
- if o.FixedNormalCoupon != nil {
- toSerialize["fixed_normal_coupon"] = o.FixedNormalCoupon
- }
- if o.DiscountCoupon != nil {
- toSerialize["discount_coupon"] = o.DiscountCoupon
- }
- if o.ExchangeCoupon != nil {
- toSerialize["exchange_coupon"] = o.ExchangeCoupon
- }
- if o.UseMethod == nil {
- return nil, fmt.Errorf("field `UseMethod` is required and must be specified in CouponUseRule")
- }
- toSerialize["use_method"] = o.UseMethod
- if o.MiniProgramsAppid != nil {
- toSerialize["mini_programs_appid"] = o.MiniProgramsAppid
- }
- if o.MiniProgramsPath != nil {
- toSerialize["mini_programs_path"] = o.MiniProgramsPath
- }
- return json.Marshal(toSerialize)
- }
- func (o CouponUseRule) String() string {
- var ret string
- ret += fmt.Sprintf("CouponAvailableTime:%v, ", o.CouponAvailableTime)
- ret += fmt.Sprintf("FixedNormalCoupon:%v, ", o.FixedNormalCoupon)
- ret += fmt.Sprintf("DiscountCoupon:%v, ", o.DiscountCoupon)
- ret += fmt.Sprintf("ExchangeCoupon:%v, ", o.ExchangeCoupon)
- if o.UseMethod == nil {
- ret += "UseMethod:<nil>, "
- } else {
- ret += fmt.Sprintf("UseMethod:%v, ", *o.UseMethod)
- }
- if o.MiniProgramsAppid == nil {
- ret += "MiniProgramsAppid:<nil>, "
- } else {
- ret += fmt.Sprintf("MiniProgramsAppid:%v, ", *o.MiniProgramsAppid)
- }
- if o.MiniProgramsPath == nil {
- ret += "MiniProgramsPath:<nil>"
- } else {
- ret += fmt.Sprintf("MiniProgramsPath:%v", *o.MiniProgramsPath)
- }
- return fmt.Sprintf("CouponUseRule{%s}", ret)
- }
- func (o CouponUseRule) Clone() *CouponUseRule {
- ret := CouponUseRule{}
- if o.CouponAvailableTime != nil {
- ret.CouponAvailableTime = o.CouponAvailableTime.Clone()
- }
- if o.FixedNormalCoupon != nil {
- ret.FixedNormalCoupon = o.FixedNormalCoupon.Clone()
- }
- if o.DiscountCoupon != nil {
- ret.DiscountCoupon = o.DiscountCoupon.Clone()
- }
- if o.ExchangeCoupon != nil {
- ret.ExchangeCoupon = o.ExchangeCoupon.Clone()
- }
- if o.UseMethod != nil {
- ret.UseMethod = new(CouponUseMethod)
- *ret.UseMethod = *o.UseMethod
- }
- if o.MiniProgramsAppid != nil {
- ret.MiniProgramsAppid = new(string)
- *ret.MiniProgramsAppid = *o.MiniProgramsAppid
- }
- if o.MiniProgramsPath != nil {
- ret.MiniProgramsPath = new(string)
- *ret.MiniProgramsPath = *o.MiniProgramsPath
- }
- return &ret
- }
- // CreateBusiFavorStockRequest
- type CreateBusiFavorStockRequest struct {
- // 批次名称,字数上限为21个,一个中文汉字/英文字母/数字均占用一个字数。
- StockName *string `json:"stock_name"`
- // 批次归属于哪个商户。 注: 普通直连模式,该参数为直连商户号; 服务商模式,该参数为子商户号; 间连模式,该参数为子商户号。
- BelongMerchant *string `json:"belong_merchant"`
- // 仅配置商户可见,用于自定义信息。字数上限为20个,一个中文汉字/英文字母/数字均占用一个字数。
- Comment *string `json:"comment,omitempty"`
- // 用来描述批次在哪些商品可用,会显示在微信卡包中。字数上限为15个,一个中文汉字/英文字母/数字均占用一个字数。
- GoodsName *string `json:"goods_name"`
- // 批次类型
- StockType *BusiFavorStockType `json:"stock_type"`
- // 券核销相关规则
- CouponUseRule *CouponUseRule `json:"coupon_use_rule"`
- // 券发放相关规则
- StockSendRule *StockSendRule `json:"stock_send_rule"`
- // 商户创建批次凭据号(格式:商户ID+日期+流水号),商户侧需保持唯一性
- OutRequestNo *string `json:"out_request_no"`
- // 卡详情页面,可选择多种入口引导用户
- CustomEntrance *CustomEntrance `json:"custom_entrance,omitempty"`
- // 创建批次时的样式信息。
- DisplayPatternInfo *DisplayPatternInfo `json:"display_pattern_info,omitempty"`
- // 特殊规则: 1、券code模式为WECHATPAY\\_MODE时,是微信自动分配券code,商户不需要预存code;适用于多种场景 2、券code模式为MERCHANT\\_API时,无需调用上传预存code接口,调用发券接口时需指定券code;更多用在商家自有流量场景(例如:商家自有小程序、H5网页等) 3、券code模式为MERCHANT\\_UPLOAD,需要调用上传预存code接口上传code,调用发券接口时无需指定code;更多适用在微信支付平台流量场景(例如:支付有礼、支付有优惠等)
- CouponCodeMode *CouponCodeMode `json:"coupon_code_mode"`
- // 事件回调通知商户的配置
- NotifyConfig *NotifyConfig `json:"notify_config,omitempty"`
- // 该批次发放的券是否允许进行补差,默认为false 注:该字段暂未开放
- Subsidy *bool `json:"subsidy,omitempty"`
- }
- func (o CreateBusiFavorStockRequest) MarshalJSON() ([]byte, error) {
- toSerialize := map[string]interface{}{}
- if o.StockName == nil {
- return nil, fmt.Errorf("field `StockName` is required and must be specified in CreateBusiFavorStockRequest")
- }
- toSerialize["stock_name"] = o.StockName
- if o.BelongMerchant == nil {
- return nil, fmt.Errorf("field `BelongMerchant` is required and must be specified in CreateBusiFavorStockRequest")
- }
- toSerialize["belong_merchant"] = o.BelongMerchant
- if o.Comment != nil {
- toSerialize["comment"] = o.Comment
- }
- if o.GoodsName == nil {
- return nil, fmt.Errorf("field `GoodsName` is required and must be specified in CreateBusiFavorStockRequest")
- }
- toSerialize["goods_name"] = o.GoodsName
- if o.StockType == nil {
- return nil, fmt.Errorf("field `StockType` is required and must be specified in CreateBusiFavorStockRequest")
- }
- toSerialize["stock_type"] = o.StockType
- if o.CouponUseRule == nil {
- return nil, fmt.Errorf("field `CouponUseRule` is required and must be specified in CreateBusiFavorStockRequest")
- }
- toSerialize["coupon_use_rule"] = o.CouponUseRule
- if o.StockSendRule == nil {
- return nil, fmt.Errorf("field `StockSendRule` is required and must be specified in CreateBusiFavorStockRequest")
- }
- toSerialize["stock_send_rule"] = o.StockSendRule
- if o.OutRequestNo == nil {
- return nil, fmt.Errorf("field `OutRequestNo` is required and must be specified in CreateBusiFavorStockRequest")
- }
- toSerialize["out_request_no"] = o.OutRequestNo
- if o.CustomEntrance != nil {
- toSerialize["custom_entrance"] = o.CustomEntrance
- }
- if o.DisplayPatternInfo != nil {
- toSerialize["display_pattern_info"] = o.DisplayPatternInfo
- }
- if o.CouponCodeMode == nil {
- return nil, fmt.Errorf("field `CouponCodeMode` is required and must be specified in CreateBusiFavorStockRequest")
- }
- toSerialize["coupon_code_mode"] = o.CouponCodeMode
- if o.NotifyConfig != nil {
- toSerialize["notify_config"] = o.NotifyConfig
- }
- if o.Subsidy != nil {
- toSerialize["subsidy"] = o.Subsidy
- }
- return json.Marshal(toSerialize)
- }
- func (o CreateBusiFavorStockRequest) String() string {
- var ret string
- if o.StockName == nil {
- ret += "StockName:<nil>, "
- } else {
- ret += fmt.Sprintf("StockName:%v, ", *o.StockName)
- }
- if o.BelongMerchant == nil {
- ret += "BelongMerchant:<nil>, "
- } else {
- ret += fmt.Sprintf("BelongMerchant:%v, ", *o.BelongMerchant)
- }
- if o.Comment == nil {
- ret += "Comment:<nil>, "
- } else {
- ret += fmt.Sprintf("Comment:%v, ", *o.Comment)
- }
- if o.GoodsName == nil {
- ret += "GoodsName:<nil>, "
- } else {
- ret += fmt.Sprintf("GoodsName:%v, ", *o.GoodsName)
- }
- if o.StockType == nil {
- ret += "StockType:<nil>, "
- } else {
- ret += fmt.Sprintf("StockType:%v, ", *o.StockType)
- }
- ret += fmt.Sprintf("CouponUseRule:%v, ", o.CouponUseRule)
- ret += fmt.Sprintf("StockSendRule:%v, ", o.StockSendRule)
- if o.OutRequestNo == nil {
- ret += "OutRequestNo:<nil>, "
- } else {
- ret += fmt.Sprintf("OutRequestNo:%v, ", *o.OutRequestNo)
- }
- ret += fmt.Sprintf("CustomEntrance:%v, ", o.CustomEntrance)
- ret += fmt.Sprintf("DisplayPatternInfo:%v, ", o.DisplayPatternInfo)
- if o.CouponCodeMode == nil {
- ret += "CouponCodeMode:<nil>, "
- } else {
- ret += fmt.Sprintf("CouponCodeMode:%v, ", *o.CouponCodeMode)
- }
- ret += fmt.Sprintf("NotifyConfig:%v, ", o.NotifyConfig)
- if o.Subsidy == nil {
- ret += "Subsidy:<nil>"
- } else {
- ret += fmt.Sprintf("Subsidy:%v", *o.Subsidy)
- }
- return fmt.Sprintf("CreateBusiFavorStockRequest{%s}", ret)
- }
- func (o CreateBusiFavorStockRequest) Clone() *CreateBusiFavorStockRequest {
- ret := CreateBusiFavorStockRequest{}
- if o.StockName != nil {
- ret.StockName = new(string)
- *ret.StockName = *o.StockName
- }
- if o.BelongMerchant != nil {
- ret.BelongMerchant = new(string)
- *ret.BelongMerchant = *o.BelongMerchant
- }
- if o.Comment != nil {
- ret.Comment = new(string)
- *ret.Comment = *o.Comment
- }
- if o.GoodsName != nil {
- ret.GoodsName = new(string)
- *ret.GoodsName = *o.GoodsName
- }
- if o.StockType != nil {
- ret.StockType = new(BusiFavorStockType)
- *ret.StockType = *o.StockType
- }
- if o.CouponUseRule != nil {
- ret.CouponUseRule = o.CouponUseRule.Clone()
- }
- if o.StockSendRule != nil {
- ret.StockSendRule = o.StockSendRule.Clone()
- }
- if o.OutRequestNo != nil {
- ret.OutRequestNo = new(string)
- *ret.OutRequestNo = *o.OutRequestNo
- }
- if o.CustomEntrance != nil {
- ret.CustomEntrance = o.CustomEntrance.Clone()
- }
- if o.DisplayPatternInfo != nil {
- ret.DisplayPatternInfo = o.DisplayPatternInfo.Clone()
- }
- if o.CouponCodeMode != nil {
- ret.CouponCodeMode = new(CouponCodeMode)
- *ret.CouponCodeMode = *o.CouponCodeMode
- }
- if o.NotifyConfig != nil {
- ret.NotifyConfig = o.NotifyConfig.Clone()
- }
- if o.Subsidy != nil {
- ret.Subsidy = new(bool)
- *ret.Subsidy = *o.Subsidy
- }
- return &ret
- }
- type CreateBusifavorStockRequest CreateBusiFavorStockRequest
- func (o CreateBusifavorStockRequest) MarshalJSON() ([]byte, error) {
- return json.Marshal(CreateBusiFavorStockRequest(o))
- }
- func (o CreateBusifavorStockRequest) String() string {
- return "CreateBusifavorStockRequest" + strings.TrimPrefix(CreateBusiFavorStockRequest(o).String(), "CreateBusiFavorStockRequest")
- }
- func (o CreateBusifavorStockRequest) Clone() *CreateBusifavorStockRequest {
- clone := CreateBusiFavorStockRequest(o).Clone()
- return (*CreateBusifavorStockRequest)(clone)
- }
- // CreateBusiFavorStockResponse
- type CreateBusiFavorStockResponse struct {
- // 批次号
- StockId *string `json:"stock_id"`
- // 创建时间,遵循[rfc3339](https://datatracker.ietf.org/doc/html/rfc3339)标准格式,格式为yyyy-MM-DDTHH:mm:ss+TIMEZONE,yyyy-MM-DD表示年月日,T出现在字符串中,表示time元素的开头,HH:mm:ss表示时分秒,TIMEZONE表示时区(+08:00表示东八区时间,领先UTC 8小时,即北京时间)。例如:2015-05-20T13:29:35+08:00表示,北京时间2015年5月20日 13点29分35秒。
- CreateTime *string `json:"create_time"`
- }
- func (o CreateBusiFavorStockResponse) MarshalJSON() ([]byte, error) {
- toSerialize := map[string]interface{}{}
- if o.StockId == nil {
- return nil, fmt.Errorf("field `StockId` is required and must be specified in CreateBusiFavorStockResponse")
- }
- toSerialize["stock_id"] = o.StockId
- if o.CreateTime == nil {
- return nil, fmt.Errorf("field `CreateTime` is required and must be specified in CreateBusiFavorStockResponse")
- }
- toSerialize["create_time"] = o.CreateTime
- return json.Marshal(toSerialize)
- }
- func (o CreateBusiFavorStockResponse) String() string {
- var ret string
- if o.StockId == nil {
- ret += "StockId:<nil>, "
- } else {
- ret += fmt.Sprintf("StockId:%v, ", *o.StockId)
- }
- if o.CreateTime == nil {
- ret += "CreateTime:<nil>"
- } else {
- ret += fmt.Sprintf("CreateTime:%v", *o.CreateTime)
- }
- return fmt.Sprintf("CreateBusiFavorStockResponse{%s}", ret)
- }
- func (o CreateBusiFavorStockResponse) Clone() *CreateBusiFavorStockResponse {
- ret := CreateBusiFavorStockResponse{}
- if o.StockId != nil {
- ret.StockId = new(string)
- *ret.StockId = *o.StockId
- }
- if o.CreateTime != nil {
- ret.CreateTime = new(string)
- *ret.CreateTime = *o.CreateTime
- }
- return &ret
- }
- // CustomEntrance
- type CustomEntrance struct {
- // 需要小程序APPID、path、入口文案、引导文案。如果需要跳转小程序,APPID、path、入口文案为必填,引导文案非必填。 AppID要与归属商户号有M-A or M-m-suba关系。 注:请查看[绑定关系说明文档](https://pay.weixin.qq.com/wiki/doc/apiv3/open/pay/chapter5_2_2.shtml#part-7)
- MiniProgramsInfo *MiniAppInfo `json:"mini_programs_info,omitempty"`
- // 可配置商户公众号,从券详情可跳转至公众号,用户自定义字段。 校验规则:传入的AppID得是与调用方商户号(即请求头里面的商户号)有绑定关系的AppID 或 传入的AppID得是归属商户号有绑定关系的AppID
- Appid *string `json:"appid,omitempty"`
- // 填写微信支付营销馆的馆ID,用户自定义字段。[营销馆](https://pay.weixin.qq.com/index.php/xphp/cfav_market/hall#/pages/list/list)需在商户平台创建。
- HallId *string `json:"hall_id,omitempty"`
- // 填写代金券可用门店ID
- StoreId *string `json:"store_id,omitempty"`
- // code展示模式
- CodeDisplayMode *CodeDisplayMode `json:"code_display_mode,omitempty"`
- }
- func (o CustomEntrance) MarshalJSON() ([]byte, error) {
- toSerialize := map[string]interface{}{}
- if o.MiniProgramsInfo != nil {
- toSerialize["mini_programs_info"] = o.MiniProgramsInfo
- }
- if o.Appid != nil {
- toSerialize["appid"] = o.Appid
- }
- if o.HallId != nil {
- toSerialize["hall_id"] = o.HallId
- }
- if o.StoreId != nil {
- toSerialize["store_id"] = o.StoreId
- }
- if o.CodeDisplayMode != nil {
- toSerialize["code_display_mode"] = o.CodeDisplayMode
- }
- return json.Marshal(toSerialize)
- }
- func (o CustomEntrance) String() string {
- var ret string
- ret += fmt.Sprintf("MiniProgramsInfo:%v, ", o.MiniProgramsInfo)
- if o.Appid == nil {
- ret += "Appid:<nil>, "
- } else {
- ret += fmt.Sprintf("Appid:%v, ", *o.Appid)
- }
- if o.HallId == nil {
- ret += "HallId:<nil>, "
- } else {
- ret += fmt.Sprintf("HallId:%v, ", *o.HallId)
- }
- if o.StoreId == nil {
- ret += "StoreId:<nil>, "
- } else {
- ret += fmt.Sprintf("StoreId:%v, ", *o.StoreId)
- }
- if o.CodeDisplayMode == nil {
- ret += "CodeDisplayMode:<nil>"
- } else {
- ret += fmt.Sprintf("CodeDisplayMode:%v", *o.CodeDisplayMode)
- }
- return fmt.Sprintf("CustomEntrance{%s}", ret)
- }
- func (o CustomEntrance) Clone() *CustomEntrance {
- ret := CustomEntrance{}
- if o.MiniProgramsInfo != nil {
- ret.MiniProgramsInfo = o.MiniProgramsInfo.Clone()
- }
- if o.Appid != nil {
- ret.Appid = new(string)
- *ret.Appid = *o.Appid
- }
- if o.HallId != nil {
- ret.HallId = new(string)
- *ret.HallId = *o.HallId
- }
- if o.StoreId != nil {
- ret.StoreId = new(string)
- *ret.StoreId = *o.StoreId
- }
- if o.CodeDisplayMode != nil {
- ret.CodeDisplayMode = new(CodeDisplayMode)
- *ret.CodeDisplayMode = *o.CodeDisplayMode
- }
- return &ret
- }
- // DeactivateCouponRequest
- type DeactivateCouponRequest struct {
- // 券的唯一标识
- CouponCode *string `json:"coupon_code"`
- // 券的所属批次号
- StockId *string `json:"stock_id"`
- // 每次失效请求的唯一标识,商户需保证唯一
- DeactivateRequestNo *string `json:"deactivate_request_no"`
- // 商户失效券的原因
- DeactivateReason *string `json:"deactivate_reason,omitempty"`
- }
- func (o DeactivateCouponRequest) MarshalJSON() ([]byte, error) {
- toSerialize := map[string]interface{}{}
- if o.CouponCode == nil {
- return nil, fmt.Errorf("field `CouponCode` is required and must be specified in DeactivateCouponRequest")
- }
- toSerialize["coupon_code"] = o.CouponCode
- if o.StockId == nil {
- return nil, fmt.Errorf("field `StockId` is required and must be specified in DeactivateCouponRequest")
- }
- toSerialize["stock_id"] = o.StockId
- if o.DeactivateRequestNo == nil {
- return nil, fmt.Errorf("field `DeactivateRequestNo` is required and must be specified in DeactivateCouponRequest")
- }
- toSerialize["deactivate_request_no"] = o.DeactivateRequestNo
- if o.DeactivateReason != nil {
- toSerialize["deactivate_reason"] = o.DeactivateReason
- }
- return json.Marshal(toSerialize)
- }
- func (o DeactivateCouponRequest) String() string {
- var ret string
- if o.CouponCode == nil {
- ret += "CouponCode:<nil>, "
- } else {
- ret += fmt.Sprintf("CouponCode:%v, ", *o.CouponCode)
- }
- if o.StockId == nil {
- ret += "StockId:<nil>, "
- } else {
- ret += fmt.Sprintf("StockId:%v, ", *o.StockId)
- }
- if o.DeactivateRequestNo == nil {
- ret += "DeactivateRequestNo:<nil>, "
- } else {
- ret += fmt.Sprintf("DeactivateRequestNo:%v, ", *o.DeactivateRequestNo)
- }
- if o.DeactivateReason == nil {
- ret += "DeactivateReason:<nil>"
- } else {
- ret += fmt.Sprintf("DeactivateReason:%v", *o.DeactivateReason)
- }
- return fmt.Sprintf("DeactivateCouponRequest{%s}", ret)
- }
- func (o DeactivateCouponRequest) Clone() *DeactivateCouponRequest {
- ret := DeactivateCouponRequest{}
- if o.CouponCode != nil {
- ret.CouponCode = new(string)
- *ret.CouponCode = *o.CouponCode
- }
- if o.StockId != nil {
- ret.StockId = new(string)
- *ret.StockId = *o.StockId
- }
- if o.DeactivateRequestNo != nil {
- ret.DeactivateRequestNo = new(string)
- *ret.DeactivateRequestNo = *o.DeactivateRequestNo
- }
- if o.DeactivateReason != nil {
- ret.DeactivateReason = new(string)
- *ret.DeactivateReason = *o.DeactivateReason
- }
- return &ret
- }
- // DeactivateCouponResponse
- type DeactivateCouponResponse struct {
- // 系统券成功失效的时间,遵循[rfc3339](https://datatracker.ietf.org/doc/html/rfc3339)标准格式,格式为yyyy-MM-DDTHH:mm:ss+TIMEZONE,yyyy-MM-DD表示年月日,T出现在字符串中,表示time元素的开头,HH:mm:ss表示时分秒,TIMEZONE表示时区(+08:00表示东八区时间,领先UTC 8小时,即北京时间)。例如:2015-05-20T13:29:35+08:00表示,北京时间2015年5月20日 13点29分35秒。
- WechatpayDeactivateTime *time.Time `json:"wechatpay_deactivate_time"`
- }
- func (o DeactivateCouponResponse) MarshalJSON() ([]byte, error) {
- toSerialize := map[string]interface{}{}
- if o.WechatpayDeactivateTime == nil {
- return nil, fmt.Errorf("field `WechatpayDeactivateTime` is required and must be specified in DeactivateCouponResponse")
- }
- toSerialize["wechatpay_deactivate_time"] = o.WechatpayDeactivateTime.Format(time.RFC3339)
- return json.Marshal(toSerialize)
- }
- func (o DeactivateCouponResponse) String() string {
- var ret string
- if o.WechatpayDeactivateTime == nil {
- ret += "WechatpayDeactivateTime:<nil>"
- } else {
- ret += fmt.Sprintf("WechatpayDeactivateTime:%v", *o.WechatpayDeactivateTime)
- }
- return fmt.Sprintf("DeactivateCouponResponse{%s}", ret)
- }
- func (o DeactivateCouponResponse) Clone() *DeactivateCouponResponse {
- ret := DeactivateCouponResponse{}
- if o.WechatpayDeactivateTime != nil {
- ret.WechatpayDeactivateTime = new(time.Time)
- *ret.WechatpayDeactivateTime = *o.WechatpayDeactivateTime
- }
- return &ret
- }
- // DeleteCouponCodeRequest
- type DeleteCouponCodeRequest struct {
- // 商家券批次号
- StockId *string `json:"stock_id"`
- // 上传的自定义code
- CouponCode *string `json:"coupon_code"`
- // 商户删除code的凭据号,商户侧需保持唯一性
- DeleteRequestNo *string `json:"delete_request_no"`
- }
- func (o DeleteCouponCodeRequest) MarshalJSON() ([]byte, error) {
- toSerialize := map[string]interface{}{}
- if o.StockId == nil {
- return nil, fmt.Errorf("field `StockId` is required and must be specified in DeleteCouponCodeRequest")
- }
- toSerialize["stock_id"] = o.StockId
- if o.CouponCode == nil {
- return nil, fmt.Errorf("field `CouponCode` is required and must be specified in DeleteCouponCodeRequest")
- }
- toSerialize["coupon_code"] = o.CouponCode
- if o.DeleteRequestNo == nil {
- return nil, fmt.Errorf("field `DeleteRequestNo` is required and must be specified in DeleteCouponCodeRequest")
- }
- toSerialize["delete_request_no"] = o.DeleteRequestNo
- return json.Marshal(toSerialize)
- }
- func (o DeleteCouponCodeRequest) String() string {
- var ret string
- if o.StockId == nil {
- ret += "StockId:<nil>, "
- } else {
- ret += fmt.Sprintf("StockId:%v, ", *o.StockId)
- }
- if o.CouponCode == nil {
- ret += "CouponCode:<nil>, "
- } else {
- ret += fmt.Sprintf("CouponCode:%v, ", *o.CouponCode)
- }
- if o.DeleteRequestNo == nil {
- ret += "DeleteRequestNo:<nil>"
- } else {
- ret += fmt.Sprintf("DeleteRequestNo:%v", *o.DeleteRequestNo)
- }
- return fmt.Sprintf("DeleteCouponCodeRequest{%s}", ret)
- }
- func (o DeleteCouponCodeRequest) Clone() *DeleteCouponCodeRequest {
- ret := DeleteCouponCodeRequest{}
- if o.StockId != nil {
- ret.StockId = new(string)
- *ret.StockId = *o.StockId
- }
- if o.CouponCode != nil {
- ret.CouponCode = new(string)
- *ret.CouponCode = *o.CouponCode
- }
- if o.DeleteRequestNo != nil {
- ret.DeleteRequestNo = new(string)
- *ret.DeleteRequestNo = *o.DeleteRequestNo
- }
- return &ret
- }
- // DeleteCouponCodeResponse
- type DeleteCouponCodeResponse struct {
- // 商家券批次号
- StockId *string `json:"stock_id"`
- // 商家券code实际被删除的时间
- DeleteTime *string `json:"delete_time"`
- }
- func (o DeleteCouponCodeResponse) MarshalJSON() ([]byte, error) {
- toSerialize := map[string]interface{}{}
- if o.StockId == nil {
- return nil, fmt.Errorf("field `StockId` is required and must be specified in DeleteCouponCodeResponse")
- }
- toSerialize["stock_id"] = o.StockId
- if o.DeleteTime == nil {
- return nil, fmt.Errorf("field `DeleteTime` is required and must be specified in DeleteCouponCodeResponse")
- }
- toSerialize["delete_time"] = o.DeleteTime
- return json.Marshal(toSerialize)
- }
- func (o DeleteCouponCodeResponse) String() string {
- var ret string
- if o.StockId == nil {
- ret += "StockId:<nil>, "
- } else {
- ret += fmt.Sprintf("StockId:%v, ", *o.StockId)
- }
- if o.DeleteTime == nil {
- ret += "DeleteTime:<nil>"
- } else {
- ret += fmt.Sprintf("DeleteTime:%v", *o.DeleteTime)
- }
- return fmt.Sprintf("DeleteCouponCodeResponse{%s}", ret)
- }
- func (o DeleteCouponCodeResponse) Clone() *DeleteCouponCodeResponse {
- ret := DeleteCouponCodeResponse{}
- if o.StockId != nil {
- ret.StockId = new(string)
- *ret.StockId = *o.StockId
- }
- if o.DeleteTime != nil {
- ret.DeleteTime = new(string)
- *ret.DeleteTime = *o.DeleteTime
- }
- return &ret
- }
- // DisassociateTradeInfoRequest
- type DisassociateTradeInfoRequest struct {
- // 微信为每个商家券批次分配的唯一ID, 对于商户自定义code的批次,关联请求必须填写批次号
- StockId *string `json:"stock_id"`
- // 券的唯一标识
- CouponCode *string `json:"coupon_code"`
- // 欲取消与商家券关联的微信支付下单的商户订单号,该单号需要已操作过与券关联,否则无法取消关联
- OutTradeNo *string `json:"out_trade_no"`
- // 商户创建批次凭据号(格式:商户ID+日期+流水号),商户侧需保持唯一性,可包含英文字母,数字,|,_,*,-等内容,不允许出现其他不合法符号。
- OutRequestNo *string `json:"out_request_no"`
- }
- func (o DisassociateTradeInfoRequest) MarshalJSON() ([]byte, error) {
- toSerialize := map[string]interface{}{}
- if o.StockId == nil {
- return nil, fmt.Errorf("field `StockId` is required and must be specified in DisassociateTradeInfoRequest")
- }
- toSerialize["stock_id"] = o.StockId
- if o.CouponCode == nil {
- return nil, fmt.Errorf("field `CouponCode` is required and must be specified in DisassociateTradeInfoRequest")
- }
- toSerialize["coupon_code"] = o.CouponCode
- if o.OutTradeNo == nil {
- return nil, fmt.Errorf("field `OutTradeNo` is required and must be specified in DisassociateTradeInfoRequest")
- }
- toSerialize["out_trade_no"] = o.OutTradeNo
- if o.OutRequestNo == nil {
- return nil, fmt.Errorf("field `OutRequestNo` is required and must be specified in DisassociateTradeInfoRequest")
- }
- toSerialize["out_request_no"] = o.OutRequestNo
- return json.Marshal(toSerialize)
- }
- func (o DisassociateTradeInfoRequest) String() string {
- var ret string
- if o.StockId == nil {
- ret += "StockId:<nil>, "
- } else {
- ret += fmt.Sprintf("StockId:%v, ", *o.StockId)
- }
- if o.CouponCode == nil {
- ret += "CouponCode:<nil>, "
- } else {
- ret += fmt.Sprintf("CouponCode:%v, ", *o.CouponCode)
- }
- if o.OutTradeNo == nil {
- ret += "OutTradeNo:<nil>, "
- } else {
- ret += fmt.Sprintf("OutTradeNo:%v, ", *o.OutTradeNo)
- }
- if o.OutRequestNo == nil {
- ret += "OutRequestNo:<nil>"
- } else {
- ret += fmt.Sprintf("OutRequestNo:%v", *o.OutRequestNo)
- }
- return fmt.Sprintf("DisassociateTradeInfoRequest{%s}", ret)
- }
- func (o DisassociateTradeInfoRequest) Clone() *DisassociateTradeInfoRequest {
- ret := DisassociateTradeInfoRequest{}
- if o.StockId != nil {
- ret.StockId = new(string)
- *ret.StockId = *o.StockId
- }
- if o.CouponCode != nil {
- ret.CouponCode = new(string)
- *ret.CouponCode = *o.CouponCode
- }
- if o.OutTradeNo != nil {
- ret.OutTradeNo = new(string)
- *ret.OutTradeNo = *o.OutTradeNo
- }
- if o.OutRequestNo != nil {
- ret.OutRequestNo = new(string)
- *ret.OutRequestNo = *o.OutRequestNo
- }
- return &ret
- }
- // DisassociateTradeInfoResponse
- type DisassociateTradeInfoResponse struct {
- // 系统成功取消商家券与订单信息关联关系的时间,遵循[rfc3339](https://datatracker.ietf.org/doc/html/rfc3339)标准格式,格式为yyyy-MM-DDTHH:mm:ss+TIMEZONE,yyyy-MM-DD表示年月日,T出现在字符串中,表示time元素的开头,HH:mm:ss表示时分秒,TIMEZONE表示时区(+08:00表示东八区时间,领先UTC 8小时,即北京时间)。例如:2015-05-20T13:29:35+08:00表示,北京时间2015年5月20日 13点29分35秒。
- WechatpayDisassociateTime *time.Time `json:"wechatpay_disassociate_time"`
- }
- func (o DisassociateTradeInfoResponse) MarshalJSON() ([]byte, error) {
- toSerialize := map[string]interface{}{}
- if o.WechatpayDisassociateTime == nil {
- return nil, fmt.Errorf("field `WechatpayDisassociateTime` is required and must be specified in DisassociateTradeInfoResponse")
- }
- toSerialize["wechatpay_disassociate_time"] = o.WechatpayDisassociateTime.Format(time.RFC3339)
- return json.Marshal(toSerialize)
- }
- func (o DisassociateTradeInfoResponse) String() string {
- var ret string
- if o.WechatpayDisassociateTime == nil {
- ret += "WechatpayDisassociateTime:<nil>"
- } else {
- ret += fmt.Sprintf("WechatpayDisassociateTime:%v", *o.WechatpayDisassociateTime)
- }
- return fmt.Sprintf("DisassociateTradeInfoResponse{%s}", ret)
- }
- func (o DisassociateTradeInfoResponse) Clone() *DisassociateTradeInfoResponse {
- ret := DisassociateTradeInfoResponse{}
- if o.WechatpayDisassociateTime != nil {
- ret.WechatpayDisassociateTime = new(time.Time)
- *ret.WechatpayDisassociateTime = *o.WechatpayDisassociateTime
- }
- return &ret
- }
- // DiscountMsg
- type DiscountMsg struct {
- // 折扣百分比,88为88折
- DiscountPercent *int64 `json:"discount_percent,omitempty"`
- // 消费门槛,单位:分。 特殊规则:取值范围 1 ≤ value ≤ 10000000
- TransactionMinimum *int64 `json:"transaction_minimum,omitempty"`
- }
- func (o DiscountMsg) MarshalJSON() ([]byte, error) {
- toSerialize := map[string]interface{}{}
- if o.DiscountPercent != nil {
- toSerialize["discount_percent"] = o.DiscountPercent
- }
- if o.TransactionMinimum != nil {
- toSerialize["transaction_minimum"] = o.TransactionMinimum
- }
- return json.Marshal(toSerialize)
- }
- func (o DiscountMsg) String() string {
- var ret string
- if o.DiscountPercent == nil {
- ret += "DiscountPercent:<nil>, "
- } else {
- ret += fmt.Sprintf("DiscountPercent:%v, ", *o.DiscountPercent)
- }
- if o.TransactionMinimum == nil {
- ret += "TransactionMinimum:<nil>"
- } else {
- ret += fmt.Sprintf("TransactionMinimum:%v", *o.TransactionMinimum)
- }
- return fmt.Sprintf("DiscountMsg{%s}", ret)
- }
- func (o DiscountMsg) Clone() *DiscountMsg {
- ret := DiscountMsg{}
- if o.DiscountPercent != nil {
- ret.DiscountPercent = new(int64)
- *ret.DiscountPercent = *o.DiscountPercent
- }
- if o.TransactionMinimum != nil {
- ret.TransactionMinimum = new(int64)
- *ret.TransactionMinimum = *o.TransactionMinimum
- }
- return &ret
- }
- // DisplayPatternInfo
- type DisplayPatternInfo struct {
- // 用于说明详细的活动规则,会展示在代金券详情页。
- Description *string `json:"description,omitempty"`
- // 若券归属商户号有认证品牌,则系统将自动拉取对应品牌logo;若券归属商户号不在认证品牌下,需自定义上传logo,未上传时将展示兜底灰色logo样式,影响券详情页用户体验,请及时上传。 商户logo的URL地址,仅支持通过《[图片上传API](https://pay.weixin.qq.com/wiki/doc/apiv3/apis/chapter9_0_1.shtml)》接口获取的图片URL地址。 1、商户logo大小需为120像素\\*120像素。 2、支持JPG/JPEG/PNG格式,且图片小于1M。 注:该字段暂不支持修改
- MerchantLogoUrl *string `json:"merchant_logo_url,omitempty"`
- // 不支持商户自定义。若券归属商户号有认证品牌,系统将自动拉取认证品牌号下的品牌名称;若券归属商户号不在认证品牌下,则拉取本商户号的商户简称。展示上限12个字符。 注:该字段暂不支持修改
- MerchantName *string `json:"merchant_name,omitempty"`
- // 券的背景颜色,可设置10种颜色,色值请参考[卡券背景颜色图](https://pay.weixin.qq.com/wiki/doc/apiv3/apis/chapter9_2_1.shtml#part-01)。颜色取值为颜色图中的颜色名称。
- BackgroundColor *string `json:"background_color,omitempty"`
- // 券详情图片,1074像素(宽)\\*603像素(高),图片大小不超过2M,支持JPG/PNG格式。仅支持通过《[图片上传API](https://pay.weixin.qq.com/wiki/doc/apiv3/apis/chapter9_0_1.shtml)》接口获取的图片URL地址。
- CouponImageUrl *string `json:"coupon_image_url,omitempty"`
- // 视频号相关信息
- FinderInfo *FinderInfo `json:"finder_info,omitempty"`
- }
- func (o DisplayPatternInfo) MarshalJSON() ([]byte, error) {
- toSerialize := map[string]interface{}{}
- if o.Description != nil {
- toSerialize["description"] = o.Description
- }
- if o.MerchantLogoUrl != nil {
- toSerialize["merchant_logo_url"] = o.MerchantLogoUrl
- }
- if o.MerchantName != nil {
- toSerialize["merchant_name"] = o.MerchantName
- }
- if o.BackgroundColor != nil {
- toSerialize["background_color"] = o.BackgroundColor
- }
- if o.CouponImageUrl != nil {
- toSerialize["coupon_image_url"] = o.CouponImageUrl
- }
- if o.FinderInfo != nil {
- toSerialize["finder_info"] = o.FinderInfo
- }
- return json.Marshal(toSerialize)
- }
- func (o DisplayPatternInfo) String() string {
- var ret string
- if o.Description == nil {
- ret += "Description:<nil>, "
- } else {
- ret += fmt.Sprintf("Description:%v, ", *o.Description)
- }
- if o.MerchantLogoUrl == nil {
- ret += "MerchantLogoUrl:<nil>, "
- } else {
- ret += fmt.Sprintf("MerchantLogoUrl:%v, ", *o.MerchantLogoUrl)
- }
- if o.MerchantName == nil {
- ret += "MerchantName:<nil>, "
- } else {
- ret += fmt.Sprintf("MerchantName:%v, ", *o.MerchantName)
- }
- if o.BackgroundColor == nil {
- ret += "BackgroundColor:<nil>, "
- } else {
- ret += fmt.Sprintf("BackgroundColor:%v, ", *o.BackgroundColor)
- }
- if o.CouponImageUrl == nil {
- ret += "CouponImageUrl:<nil>, "
- } else {
- ret += fmt.Sprintf("CouponImageUrl:%v, ", *o.CouponImageUrl)
- }
- ret += fmt.Sprintf("FinderInfo:%v", o.FinderInfo)
- return fmt.Sprintf("DisplayPatternInfo{%s}", ret)
- }
- func (o DisplayPatternInfo) Clone() *DisplayPatternInfo {
- ret := DisplayPatternInfo{}
- if o.Description != nil {
- ret.Description = new(string)
- *ret.Description = *o.Description
- }
- if o.MerchantLogoUrl != nil {
- ret.MerchantLogoUrl = new(string)
- *ret.MerchantLogoUrl = *o.MerchantLogoUrl
- }
- if o.MerchantName != nil {
- ret.MerchantName = new(string)
- *ret.MerchantName = *o.MerchantName
- }
- if o.BackgroundColor != nil {
- ret.BackgroundColor = new(string)
- *ret.BackgroundColor = *o.BackgroundColor
- }
- if o.CouponImageUrl != nil {
- ret.CouponImageUrl = new(string)
- *ret.CouponImageUrl = *o.CouponImageUrl
- }
- if o.FinderInfo != nil {
- ret.FinderInfo = o.FinderInfo.Clone()
- }
- return &ret
- }
- // ExchangeMsg
- type ExchangeMsg struct {
- // 单品换购价,单位:分。 特殊规则:取值范围 0 ≤ value ≤ 10000000
- ExchangePrice *int64 `json:"exchange_price,omitempty"`
- // 消费门槛,单位:分。 特殊规则:取值范围 1 ≤ value ≤ 10000000
- TransactionMinimum *int64 `json:"transaction_minimum,omitempty"`
- }
- func (o ExchangeMsg) MarshalJSON() ([]byte, error) {
- toSerialize := map[string]interface{}{}
- if o.ExchangePrice != nil {
- toSerialize["exchange_price"] = o.ExchangePrice
- }
- if o.TransactionMinimum != nil {
- toSerialize["transaction_minimum"] = o.TransactionMinimum
- }
- return json.Marshal(toSerialize)
- }
- func (o ExchangeMsg) String() string {
- var ret string
- if o.ExchangePrice == nil {
- ret += "ExchangePrice:<nil>, "
- } else {
- ret += fmt.Sprintf("ExchangePrice:%v, ", *o.ExchangePrice)
- }
- if o.TransactionMinimum == nil {
- ret += "TransactionMinimum:<nil>"
- } else {
- ret += fmt.Sprintf("TransactionMinimum:%v", *o.TransactionMinimum)
- }
- return fmt.Sprintf("ExchangeMsg{%s}", ret)
- }
- func (o ExchangeMsg) Clone() *ExchangeMsg {
- ret := ExchangeMsg{}
- if o.ExchangePrice != nil {
- ret.ExchangePrice = new(int64)
- *ret.ExchangePrice = *o.ExchangePrice
- }
- if o.TransactionMinimum != nil {
- ret.TransactionMinimum = new(int64)
- *ret.TransactionMinimum = *o.TransactionMinimum
- }
- return &ret
- }
- // FavorAvailableTime
- type FavorAvailableTime struct {
- // 批次开始时间,遵循[rfc3339](https://datatracker.ietf.org/doc/html/rfc3339)标准格式,格式为yyyy-MM-DDTHH:mm:ss+TIMEZONE,yyyy-MM-DD表示年月日,T出现在字符串中,表示time元素的开头,HH:mm:ss表示时分秒,TIMEZONE表示时区(+08:00表示东八区时间,领先UTC 8小时,即北京时间)。例如:2015-05-20T13:29:35+08:00表示,北京时间2015年5月20日 13点29分35秒。 注意:商家券有效期最长为1年。
- AvailableBeginTime *time.Time `json:"available_begin_time"`
- // 批次结束时间,遵循[rfc3339](https://datatracker.ietf.org/doc/html/rfc3339)标准格式,格式为yyyy-MM-DDTHH:mm:ss+TIMEZONE,yyyy-MM-DD表示年月日,T出现在字符串中,表示time元素的开头,HH:mm:ss表示时分秒,TIMEZONE表示时区(+08:00表示东八区时间,领先UTC 8小时,即北京时间)。例如:2015-05-20T13:29:35+08:00表示,北京时间2015年5月20日 13点29分35秒。 注意:商家券有效期最长为1年。
- AvailableEndTime *time.Time `json:"available_end_time"`
- // 日期区间内,券生效后x天内有效。例如生效当天内有效填1,生效后2天内有效填2,以此类推……注意,用户在有效期开始前领取商家券,则从有效期第1天开始计算天数,用户在有效期内领取商家券,则从领取当天开始计算天数,无论用户何时领取商家券,商家券在活动有效期结束后均不可用。可配合wait_days_after_receive一同填写,也可单独填写。单独填写时,有效期内领券后立即生效,生效后x天内有效。
- AvailableDayAfterReceive *int64 `json:"available_day_after_receive,omitempty"`
- // 可以设置多个星期下的多个可用时间段,比如每周二10点到18点
- AvailableWeek *AvailableWeek `json:"available_week,omitempty"`
- // 无规律的有效时间,多个无规律时间段
- IrregularyAvaliableTime []IrregularAvailableTime `json:"irregulary_avaliable_time,omitempty"`
- // 日期区间内,用户领券后需等待x天开始生效。例如领券后当天开始生效则无需填写,领券后第2天开始生效填1,以此类推……用户在有效期开始前领取商家券,则从有效期第1天开始计算天数,用户在有效期内领取商家券,则从领取当天开始计算天数。无论用户何时领取商家券,商家券在活动有效期结束后均不可用。需配合available_day_after_receive一同填写,不可单独填写。注:最大不能超过30天
- WaitDaysAfterReceive *int64 `json:"wait_days_after_receive,omitempty"`
- }
- func (o FavorAvailableTime) MarshalJSON() ([]byte, error) {
- toSerialize := map[string]interface{}{}
- if o.AvailableBeginTime == nil {
- return nil, fmt.Errorf("field `AvailableBeginTime` is required and must be specified in FavorAvailableTime")
- }
- toSerialize["available_begin_time"] = o.AvailableBeginTime.Format(time.RFC3339)
- if o.AvailableEndTime == nil {
- return nil, fmt.Errorf("field `AvailableEndTime` is required and must be specified in FavorAvailableTime")
- }
- toSerialize["available_end_time"] = o.AvailableEndTime.Format(time.RFC3339)
- if o.AvailableDayAfterReceive != nil {
- toSerialize["available_day_after_receive"] = o.AvailableDayAfterReceive
- }
- if o.AvailableWeek != nil {
- toSerialize["available_week"] = o.AvailableWeek
- }
- if o.IrregularyAvaliableTime != nil {
- toSerialize["irregulary_avaliable_time"] = o.IrregularyAvaliableTime
- }
- if o.WaitDaysAfterReceive != nil {
- toSerialize["wait_days_after_receive"] = o.WaitDaysAfterReceive
- }
- return json.Marshal(toSerialize)
- }
- func (o FavorAvailableTime) String() string {
- var ret string
- if o.AvailableBeginTime == nil {
- ret += "AvailableBeginTime:<nil>, "
- } else {
- ret += fmt.Sprintf("AvailableBeginTime:%v, ", *o.AvailableBeginTime)
- }
- if o.AvailableEndTime == nil {
- ret += "AvailableEndTime:<nil>, "
- } else {
- ret += fmt.Sprintf("AvailableEndTime:%v, ", *o.AvailableEndTime)
- }
- if o.AvailableDayAfterReceive == nil {
- ret += "AvailableDayAfterReceive:<nil>, "
- } else {
- ret += fmt.Sprintf("AvailableDayAfterReceive:%v, ", *o.AvailableDayAfterReceive)
- }
- ret += fmt.Sprintf("AvailableWeek:%v, ", o.AvailableWeek)
- ret += fmt.Sprintf("IrregularyAvaliableTime:%v, ", o.IrregularyAvaliableTime)
- if o.WaitDaysAfterReceive == nil {
- ret += "WaitDaysAfterReceive:<nil>"
- } else {
- ret += fmt.Sprintf("WaitDaysAfterReceive:%v", *o.WaitDaysAfterReceive)
- }
- return fmt.Sprintf("FavorAvailableTime{%s}", ret)
- }
- func (o FavorAvailableTime) Clone() *FavorAvailableTime {
- ret := FavorAvailableTime{}
- if o.AvailableBeginTime != nil {
- ret.AvailableBeginTime = new(time.Time)
- *ret.AvailableBeginTime = *o.AvailableBeginTime
- }
- if o.AvailableEndTime != nil {
- ret.AvailableEndTime = new(time.Time)
- *ret.AvailableEndTime = *o.AvailableEndTime
- }
- if o.AvailableDayAfterReceive != nil {
- ret.AvailableDayAfterReceive = new(int64)
- *ret.AvailableDayAfterReceive = *o.AvailableDayAfterReceive
- }
- if o.AvailableWeek != nil {
- ret.AvailableWeek = o.AvailableWeek.Clone()
- }
- if o.IrregularyAvaliableTime != nil {
- ret.IrregularyAvaliableTime = make([]IrregularAvailableTime, len(o.IrregularyAvaliableTime))
- for i, item := range o.IrregularyAvaliableTime {
- ret.IrregularyAvaliableTime[i] = *item.Clone()
- }
- }
- if o.WaitDaysAfterReceive != nil {
- ret.WaitDaysAfterReceive = new(int64)
- *ret.WaitDaysAfterReceive = *o.WaitDaysAfterReceive
- }
- return &ret
- }
- // FinderInfo
- type FinderInfo struct {
- // 关联视频号将展示在优惠券详情的顶部右侧,作为跳转去视频号的入口,入参参数请配置视频号id,请前往[视频号助手](https://channels.weixin.qq.com)管理查看视频号ID
- FinderId *string `json:"finder_id,omitempty"`
- // 券详情视频内容,支持配置关联视频号下的具体视频内容,入参参数请配置视频id,请前往[视频号助手](https://channels.weixin.qq.com)管理后台复制具体视频ID
- FinderVideoId *string `json:"finder_video_id,omitempty"`
- // 截取的视频号图片将在券到期提醒消息、券详情中展示。 1.图片尺寸:716像素(宽)\\*402像素(高);图片大小不超过2M,支持JPG/PNG格式。 2.仅支持通过《[图片上传API](https://pay.weixin.qq.com/wiki/doc/apiv3/apis/chapter9_0_1.shtml)》接口获取的图片URL地址。
- FinderVideoCoverImageUrl *string `json:"finder_video_cover_image_url,omitempty"`
- }
- func (o FinderInfo) MarshalJSON() ([]byte, error) {
- toSerialize := map[string]interface{}{}
- if o.FinderId != nil {
- toSerialize["finder_id"] = o.FinderId
- }
- if o.FinderVideoId != nil {
- toSerialize["finder_video_id"] = o.FinderVideoId
- }
- if o.FinderVideoCoverImageUrl != nil {
- toSerialize["finder_video_cover_image_url"] = o.FinderVideoCoverImageUrl
- }
- return json.Marshal(toSerialize)
- }
- func (o FinderInfo) String() string {
- var ret string
- if o.FinderId == nil {
- ret += "FinderId:<nil>, "
- } else {
- ret += fmt.Sprintf("FinderId:%v, ", *o.FinderId)
- }
- if o.FinderVideoId == nil {
- ret += "FinderVideoId:<nil>, "
- } else {
- ret += fmt.Sprintf("FinderVideoId:%v, ", *o.FinderVideoId)
- }
- if o.FinderVideoCoverImageUrl == nil {
- ret += "FinderVideoCoverImageUrl:<nil>"
- } else {
- ret += fmt.Sprintf("FinderVideoCoverImageUrl:%v", *o.FinderVideoCoverImageUrl)
- }
- return fmt.Sprintf("FinderInfo{%s}", ret)
- }
- func (o FinderInfo) Clone() *FinderInfo {
- ret := FinderInfo{}
- if o.FinderId != nil {
- ret.FinderId = new(string)
- *ret.FinderId = *o.FinderId
- }
- if o.FinderVideoId != nil {
- ret.FinderVideoId = new(string)
- *ret.FinderVideoId = *o.FinderVideoId
- }
- if o.FinderVideoCoverImageUrl != nil {
- ret.FinderVideoCoverImageUrl = new(string)
- *ret.FinderVideoCoverImageUrl = *o.FinderVideoCoverImageUrl
- }
- return &ret
- }
- // FixedValueStockMsg
- type FixedValueStockMsg struct {
- // 优惠金额 单位分。 特殊规则:取值范围 1 ≤ value ≤ 10000000
- DiscountAmount *int64 `json:"discount_amount,omitempty"`
- // 消费门槛,单位:分。 特殊规则:取值范围 1 ≤ value ≤ 10000000
- TransactionMinimum *int64 `json:"transaction_minimum,omitempty"`
- }
- func (o FixedValueStockMsg) MarshalJSON() ([]byte, error) {
- toSerialize := map[string]interface{}{}
- if o.DiscountAmount != nil {
- toSerialize["discount_amount"] = o.DiscountAmount
- }
- if o.TransactionMinimum != nil {
- toSerialize["transaction_minimum"] = o.TransactionMinimum
- }
- return json.Marshal(toSerialize)
- }
- func (o FixedValueStockMsg) String() string {
- var ret string
- if o.DiscountAmount == nil {
- ret += "DiscountAmount:<nil>, "
- } else {
- ret += fmt.Sprintf("DiscountAmount:%v, ", *o.DiscountAmount)
- }
- if o.TransactionMinimum == nil {
- ret += "TransactionMinimum:<nil>"
- } else {
- ret += fmt.Sprintf("TransactionMinimum:%v", *o.TransactionMinimum)
- }
- return fmt.Sprintf("FixedValueStockMsg{%s}", ret)
- }
- func (o FixedValueStockMsg) Clone() *FixedValueStockMsg {
- ret := FixedValueStockMsg{}
- if o.DiscountAmount != nil {
- ret.DiscountAmount = new(int64)
- *ret.DiscountAmount = *o.DiscountAmount
- }
- if o.TransactionMinimum != nil {
- ret.TransactionMinimum = new(int64)
- *ret.TransactionMinimum = *o.TransactionMinimum
- }
- return &ret
- }
- // GetCouponNotifyRequest
- type GetCouponNotifyRequest struct {
- // 商户号,不填默认查询调用方商户号
- Mchid *string `json:"mchid,omitempty"`
- }
- func (o GetCouponNotifyRequest) MarshalJSON() ([]byte, error) {
- toSerialize := map[string]interface{}{}
- if o.Mchid != nil {
- toSerialize["mchid"] = o.Mchid
- }
- return json.Marshal(toSerialize)
- }
- func (o GetCouponNotifyRequest) String() string {
- var ret string
- if o.Mchid == nil {
- ret += "Mchid:<nil>"
- } else {
- ret += fmt.Sprintf("Mchid:%v", *o.Mchid)
- }
- return fmt.Sprintf("GetCouponNotifyRequest{%s}", ret)
- }
- func (o GetCouponNotifyRequest) Clone() *GetCouponNotifyRequest {
- ret := GetCouponNotifyRequest{}
- if o.Mchid != nil {
- ret.Mchid = new(string)
- *ret.Mchid = *o.Mchid
- }
- return &ret
- }
- // GetCouponNotifyResponse
- type GetCouponNotifyResponse struct {
- // 商户号
- Mchid *string `json:"mchid"`
- // 商户提供的用于接收商家券事件通知的URL地址,必须支持HTTPS。
- NotifyUrl *string `json:"notify_url"`
- }
- func (o GetCouponNotifyResponse) MarshalJSON() ([]byte, error) {
- toSerialize := map[string]interface{}{}
- if o.Mchid == nil {
- return nil, fmt.Errorf("field `Mchid` is required and must be specified in GetCouponNotifyResponse")
- }
- toSerialize["mchid"] = o.Mchid
- if o.NotifyUrl == nil {
- return nil, fmt.Errorf("field `NotifyUrl` is required and must be specified in GetCouponNotifyResponse")
- }
- toSerialize["notify_url"] = o.NotifyUrl
- return json.Marshal(toSerialize)
- }
- func (o GetCouponNotifyResponse) String() string {
- var ret string
- if o.Mchid == nil {
- ret += "Mchid:<nil>, "
- } else {
- ret += fmt.Sprintf("Mchid:%v, ", *o.Mchid)
- }
- if o.NotifyUrl == nil {
- ret += "NotifyUrl:<nil>"
- } else {
- ret += fmt.Sprintf("NotifyUrl:%v", *o.NotifyUrl)
- }
- return fmt.Sprintf("GetCouponNotifyResponse{%s}", ret)
- }
- func (o GetCouponNotifyResponse) Clone() *GetCouponNotifyResponse {
- ret := GetCouponNotifyResponse{}
- if o.Mchid != nil {
- ret.Mchid = new(string)
- *ret.Mchid = *o.Mchid
- }
- if o.NotifyUrl != nil {
- ret.NotifyUrl = new(string)
- *ret.NotifyUrl = *o.NotifyUrl
- }
- return &ret
- }
- // IrregularAvailableTime
- type IrregularAvailableTime struct {
- // 开始时间,遵循[rfc3339](https://datatracker.ietf.org/doc/html/rfc3339)标准格式,格式为yyyy-MM-DDTHH:mm:ss+TIMEZONE,yyyy-MM-DD表示年月日,T出现在字符串中,表示time元素的开头,HH:mm:ss表示时分秒,TIMEZONE表示时区(+08:00表示东八区时间,领先UTC 8小时,即北京时间)。例如:2015-05-20T13:29:35+08:00表示,北京时间2015年5月20日 13点29分35秒。
- BeginTime *time.Time `json:"begin_time,omitempty"`
- // 结束时间,遵循[rfc3339](https://datatracker.ietf.org/doc/html/rfc3339)标准格式,格式为yyyy-MM-DDTHH:mm:ss+TIMEZONE,yyyy-MM-DD表示年月日,T出现在字符串中,表示time元素的开头,HH:mm:ss表示时分秒,TIMEZONE表示时区(+08:00表示东八区时间,领先UTC 8小时,即北京时间)。例如:2015-05-20T13:29:35+08:00表示,北京时间2015年5月20日 13点29分35秒。
- EndTime *time.Time `json:"end_time,omitempty"`
- }
- func (o IrregularAvailableTime) MarshalJSON() ([]byte, error) {
- toSerialize := map[string]interface{}{}
- if o.BeginTime != nil {
- toSerialize["begin_time"] = o.BeginTime.Format(time.RFC3339)
- }
- if o.EndTime != nil {
- toSerialize["end_time"] = o.EndTime.Format(time.RFC3339)
- }
- return json.Marshal(toSerialize)
- }
- func (o IrregularAvailableTime) String() string {
- var ret string
- if o.BeginTime == nil {
- ret += "BeginTime:<nil>, "
- } else {
- ret += fmt.Sprintf("BeginTime:%v, ", *o.BeginTime)
- }
- if o.EndTime == nil {
- ret += "EndTime:<nil>"
- } else {
- ret += fmt.Sprintf("EndTime:%v", *o.EndTime)
- }
- return fmt.Sprintf("IrregularAvailableTime{%s}", ret)
- }
- func (o IrregularAvailableTime) Clone() *IrregularAvailableTime {
- ret := IrregularAvailableTime{}
- if o.BeginTime != nil {
- ret.BeginTime = new(time.Time)
- *ret.BeginTime = *o.BeginTime
- }
- if o.EndTime != nil {
- ret.EndTime = new(time.Time)
- *ret.EndTime = *o.EndTime
- }
- return &ret
- }
- // ListCouponsByFilterRequest
- type ListCouponsByFilterRequest struct {
- // Openid信息,用户在AppID下的唯一标识。 校验规则:传入的OpenID得是调用方商户号(即请求头里面的商户号)有绑定关系的AppID获取的OpenID或传入的OpenID得是归属商户号有绑定关系的AppID获取的OpenID。[获取OpenID文档](https://pay.weixin.qq.com/wiki/doc/apiv3/terms_definition/chapter1_1_3.shtml#part-3)
- Openid *string `json:"openid"`
- // 支持传入与当前调用接口商户号有绑定关系的AppID。支持小程序AppID与公众号AppID。 校验规则:传入的AppID得是与调用方商户号(即请求头里面的商户号)有绑定关系的AppID 或 传入的AppID得是归属商户号有绑定关系的AppID
- Appid *string `json:"appid"`
- // 批次号,是否指定批次号查询
- StockId *string `json:"stock_id,omitempty"`
- // 批次创建方商户号 校验规则:当调用方商户号(即请求头中的商户号)为创建批次方商户号时,该参数必传
- CreatorMerchant *string `json:"creator_merchant,omitempty"`
- // 批次归属商户号 校验规则:当调用方商户号(即请求头中的商户号)为批次归属商户号时,该参数必传
- BelongMerchant *string `json:"belong_merchant,omitempty"`
- // 批次发放商户号 校验规则:当调用方商户号(即请求头中的商户号)为批次发放商户号时,该参数必传;委托营销关系下,请填写委托发券的商户号
- SenderMerchant *string `json:"sender_merchant,omitempty"`
- // 分页页码
- Offset *int64 `json:"offset,omitempty"`
- // 分页大小
- Limit *int64 `json:"limit,omitempty"`
- // 商家券状态
- CouponState *CouponStatus `json:"coupon_state,omitempty"`
- }
- func (o ListCouponsByFilterRequest) MarshalJSON() ([]byte, error) {
- toSerialize := map[string]interface{}{}
- if o.Openid == nil {
- return nil, fmt.Errorf("field `Openid` is required and must be specified in ListCouponsByFilterRequest")
- }
- toSerialize["openid"] = o.Openid
- if o.Appid == nil {
- return nil, fmt.Errorf("field `Appid` is required and must be specified in ListCouponsByFilterRequest")
- }
- toSerialize["appid"] = o.Appid
- if o.StockId != nil {
- toSerialize["stock_id"] = o.StockId
- }
- if o.CreatorMerchant != nil {
- toSerialize["creator_merchant"] = o.CreatorMerchant
- }
- if o.BelongMerchant != nil {
- toSerialize["belong_merchant"] = o.BelongMerchant
- }
- if o.SenderMerchant != nil {
- toSerialize["sender_merchant"] = o.SenderMerchant
- }
- if o.Offset != nil {
- toSerialize["offset"] = o.Offset
- }
- if o.Limit != nil {
- toSerialize["limit"] = o.Limit
- }
- if o.CouponState != nil {
- toSerialize["coupon_state"] = o.CouponState
- }
- return json.Marshal(toSerialize)
- }
- func (o ListCouponsByFilterRequest) String() string {
- var ret string
- if o.Openid == nil {
- ret += "Openid:<nil>, "
- } else {
- ret += fmt.Sprintf("Openid:%v, ", *o.Openid)
- }
- if o.Appid == nil {
- ret += "Appid:<nil>, "
- } else {
- ret += fmt.Sprintf("Appid:%v, ", *o.Appid)
- }
- if o.StockId == nil {
- ret += "StockId:<nil>, "
- } else {
- ret += fmt.Sprintf("StockId:%v, ", *o.StockId)
- }
- if o.CreatorMerchant == nil {
- ret += "CreatorMerchant:<nil>, "
- } else {
- ret += fmt.Sprintf("CreatorMerchant:%v, ", *o.CreatorMerchant)
- }
- if o.BelongMerchant == nil {
- ret += "BelongMerchant:<nil>, "
- } else {
- ret += fmt.Sprintf("BelongMerchant:%v, ", *o.BelongMerchant)
- }
- if o.SenderMerchant == nil {
- ret += "SenderMerchant:<nil>, "
- } else {
- ret += fmt.Sprintf("SenderMerchant:%v, ", *o.SenderMerchant)
- }
- if o.Offset == nil {
- ret += "Offset:<nil>, "
- } else {
- ret += fmt.Sprintf("Offset:%v, ", *o.Offset)
- }
- if o.Limit == nil {
- ret += "Limit:<nil>, "
- } else {
- ret += fmt.Sprintf("Limit:%v, ", *o.Limit)
- }
- if o.CouponState == nil {
- ret += "CouponState:<nil>"
- } else {
- ret += fmt.Sprintf("CouponState:%v", *o.CouponState)
- }
- return fmt.Sprintf("ListCouponsByFilterRequest{%s}", ret)
- }
- func (o ListCouponsByFilterRequest) Clone() *ListCouponsByFilterRequest {
- ret := ListCouponsByFilterRequest{}
- if o.Openid != nil {
- ret.Openid = new(string)
- *ret.Openid = *o.Openid
- }
- if o.Appid != nil {
- ret.Appid = new(string)
- *ret.Appid = *o.Appid
- }
- if o.StockId != nil {
- ret.StockId = new(string)
- *ret.StockId = *o.StockId
- }
- if o.CreatorMerchant != nil {
- ret.CreatorMerchant = new(string)
- *ret.CreatorMerchant = *o.CreatorMerchant
- }
- if o.BelongMerchant != nil {
- ret.BelongMerchant = new(string)
- *ret.BelongMerchant = *o.BelongMerchant
- }
- if o.SenderMerchant != nil {
- ret.SenderMerchant = new(string)
- *ret.SenderMerchant = *o.SenderMerchant
- }
- if o.Offset != nil {
- ret.Offset = new(int64)
- *ret.Offset = *o.Offset
- }
- if o.Limit != nil {
- ret.Limit = new(int64)
- *ret.Limit = *o.Limit
- }
- if o.CouponState != nil {
- ret.CouponState = new(CouponStatus)
- *ret.CouponState = *o.CouponState
- }
- return &ret
- }
- // MiniAppInfo
- type MiniAppInfo struct {
- // 商家小程序AppID要与归属商户号有M-A or M-m-suba关系。 校验规则:传入的AppID得是与调用方商户号(即请求头里面的商户号)有绑定关系的AppID 或 传入的AppID得是归属商户号有绑定关系的AppID
- MiniProgramsAppid *string `json:"mini_programs_appid"`
- // 商家小程序path
- MiniProgramsPath *string `json:"mini_programs_path"`
- // 入口文案,字数上限为5个,一个中文汉字/英文字母/数字均占用一个字数。
- EntranceWords *string `json:"entrance_words"`
- // 小程序入口引导文案,用户自定义字段。字数上限为6个,一个中文汉字/英文字母/数字均占用一个字数。
- GuidingWords *string `json:"guiding_words,omitempty"`
- }
- func (o MiniAppInfo) MarshalJSON() ([]byte, error) {
- toSerialize := map[string]interface{}{}
- if o.MiniProgramsAppid == nil {
- return nil, fmt.Errorf("field `MiniProgramsAppid` is required and must be specified in MiniAppInfo")
- }
- toSerialize["mini_programs_appid"] = o.MiniProgramsAppid
- if o.MiniProgramsPath == nil {
- return nil, fmt.Errorf("field `MiniProgramsPath` is required and must be specified in MiniAppInfo")
- }
- toSerialize["mini_programs_path"] = o.MiniProgramsPath
- if o.EntranceWords == nil {
- return nil, fmt.Errorf("field `EntranceWords` is required and must be specified in MiniAppInfo")
- }
- toSerialize["entrance_words"] = o.EntranceWords
- if o.GuidingWords != nil {
- toSerialize["guiding_words"] = o.GuidingWords
- }
- return json.Marshal(toSerialize)
- }
- func (o MiniAppInfo) String() string {
- var ret string
- if o.MiniProgramsAppid == nil {
- ret += "MiniProgramsAppid:<nil>, "
- } else {
- ret += fmt.Sprintf("MiniProgramsAppid:%v, ", *o.MiniProgramsAppid)
- }
- if o.MiniProgramsPath == nil {
- ret += "MiniProgramsPath:<nil>, "
- } else {
- ret += fmt.Sprintf("MiniProgramsPath:%v, ", *o.MiniProgramsPath)
- }
- if o.EntranceWords == nil {
- ret += "EntranceWords:<nil>, "
- } else {
- ret += fmt.Sprintf("EntranceWords:%v, ", *o.EntranceWords)
- }
- if o.GuidingWords == nil {
- ret += "GuidingWords:<nil>"
- } else {
- ret += fmt.Sprintf("GuidingWords:%v", *o.GuidingWords)
- }
- return fmt.Sprintf("MiniAppInfo{%s}", ret)
- }
- func (o MiniAppInfo) Clone() *MiniAppInfo {
- ret := MiniAppInfo{}
- if o.MiniProgramsAppid != nil {
- ret.MiniProgramsAppid = new(string)
- *ret.MiniProgramsAppid = *o.MiniProgramsAppid
- }
- if o.MiniProgramsPath != nil {
- ret.MiniProgramsPath = new(string)
- *ret.MiniProgramsPath = *o.MiniProgramsPath
- }
- if o.EntranceWords != nil {
- ret.EntranceWords = new(string)
- *ret.EntranceWords = *o.EntranceWords
- }
- if o.GuidingWords != nil {
- ret.GuidingWords = new(string)
- *ret.GuidingWords = *o.GuidingWords
- }
- return &ret
- }
- // ModifyBudgetBody
- type ModifyBudgetBody struct {
- // 批次最大发放个数,target\\_max\\_coupons与target\\_max\\_coupons\\_by\\_day只能修改一个 注:目标批次即修改后的批次
- TargetMaxCoupons *int64 `json:"target_max_coupons,omitempty"`
- // 当前批次最大发放个数,当传入target\\_max\\_coupons大于0时,current\\_max\\_coupons必传 注:当前批次即未修改的批次
- CurrentMaxCoupons *int64 `json:"current_max_coupons,omitempty"`
- // 单天发放上限个数,target\\_max\\_coupons与target\\_max\\_coupons\\_by\\_day只能修改一个 注:目标批次即修改后的批次
- TargetMaxCouponsByDay *int64 `json:"target_max_coupons_by_day,omitempty"`
- // 当前单天发放上限个数 ,当传入target\\_max\\_coupons\\_by\\_day大于0时,current\\_max\\_coupons\\_by\\_day必填 注:当前批次即未修改的批次
- CurrentMaxCouponsByDay *int64 `json:"current_max_coupons_by_day,omitempty"`
- // 修改预算请求单据号
- ModifyBudgetRequestNo *string `json:"modify_budget_request_no"`
- }
- func (o ModifyBudgetBody) MarshalJSON() ([]byte, error) {
- toSerialize := map[string]interface{}{}
- if o.TargetMaxCoupons != nil {
- toSerialize["target_max_coupons"] = o.TargetMaxCoupons
- }
- if o.CurrentMaxCoupons != nil {
- toSerialize["current_max_coupons"] = o.CurrentMaxCoupons
- }
- if o.TargetMaxCouponsByDay != nil {
- toSerialize["target_max_coupons_by_day"] = o.TargetMaxCouponsByDay
- }
- if o.CurrentMaxCouponsByDay != nil {
- toSerialize["current_max_coupons_by_day"] = o.CurrentMaxCouponsByDay
- }
- if o.ModifyBudgetRequestNo == nil {
- return nil, fmt.Errorf("field `ModifyBudgetRequestNo` is required and must be specified in ModifyBudgetBody")
- }
- toSerialize["modify_budget_request_no"] = o.ModifyBudgetRequestNo
- return json.Marshal(toSerialize)
- }
- func (o ModifyBudgetBody) String() string {
- var ret string
- if o.TargetMaxCoupons == nil {
- ret += "TargetMaxCoupons:<nil>, "
- } else {
- ret += fmt.Sprintf("TargetMaxCoupons:%v, ", *o.TargetMaxCoupons)
- }
- if o.CurrentMaxCoupons == nil {
- ret += "CurrentMaxCoupons:<nil>, "
- } else {
- ret += fmt.Sprintf("CurrentMaxCoupons:%v, ", *o.CurrentMaxCoupons)
- }
- if o.TargetMaxCouponsByDay == nil {
- ret += "TargetMaxCouponsByDay:<nil>, "
- } else {
- ret += fmt.Sprintf("TargetMaxCouponsByDay:%v, ", *o.TargetMaxCouponsByDay)
- }
- if o.CurrentMaxCouponsByDay == nil {
- ret += "CurrentMaxCouponsByDay:<nil>, "
- } else {
- ret += fmt.Sprintf("CurrentMaxCouponsByDay:%v, ", *o.CurrentMaxCouponsByDay)
- }
- if o.ModifyBudgetRequestNo == nil {
- ret += "ModifyBudgetRequestNo:<nil>"
- } else {
- ret += fmt.Sprintf("ModifyBudgetRequestNo:%v", *o.ModifyBudgetRequestNo)
- }
- return fmt.Sprintf("ModifyBudgetBody{%s}", ret)
- }
- func (o ModifyBudgetBody) Clone() *ModifyBudgetBody {
- ret := ModifyBudgetBody{}
- if o.TargetMaxCoupons != nil {
- ret.TargetMaxCoupons = new(int64)
- *ret.TargetMaxCoupons = *o.TargetMaxCoupons
- }
- if o.CurrentMaxCoupons != nil {
- ret.CurrentMaxCoupons = new(int64)
- *ret.CurrentMaxCoupons = *o.CurrentMaxCoupons
- }
- if o.TargetMaxCouponsByDay != nil {
- ret.TargetMaxCouponsByDay = new(int64)
- *ret.TargetMaxCouponsByDay = *o.TargetMaxCouponsByDay
- }
- if o.CurrentMaxCouponsByDay != nil {
- ret.CurrentMaxCouponsByDay = new(int64)
- *ret.CurrentMaxCouponsByDay = *o.CurrentMaxCouponsByDay
- }
- if o.ModifyBudgetRequestNo != nil {
- ret.ModifyBudgetRequestNo = new(string)
- *ret.ModifyBudgetRequestNo = *o.ModifyBudgetRequestNo
- }
- return &ret
- }
- // ModifyBudgetRequest
- type ModifyBudgetRequest struct {
- // 批次号
- StockId *string `json:"stock_id"`
- // 批次最大发放个数,target\\_max\\_coupons与target\\_max\\_coupons\\_by\\_day只能修改一个 注:目标批次即修改后的批次
- TargetMaxCoupons *int64 `json:"target_max_coupons,omitempty"`
- // 当前批次最大发放个数,当传入target\\_max\\_coupons大于0时,current\\_max\\_coupons必传 注:当前批次即未修改的批次
- CurrentMaxCoupons *int64 `json:"current_max_coupons,omitempty"`
- // 单天发放上限个数,target\\_max\\_coupons与target\\_max\\_coupons\\_by\\_day只能修改一个 注:目标批次即修改后的批次
- TargetMaxCouponsByDay *int64 `json:"target_max_coupons_by_day,omitempty"`
- // 当前单天发放上限个数 ,当传入target\\_max\\_coupons\\_by\\_day大于0时,current\\_max\\_coupons\\_by\\_day必填 注:当前批次即未修改的批次
- CurrentMaxCouponsByDay *int64 `json:"current_max_coupons_by_day,omitempty"`
- // 修改预算请求单据号
- ModifyBudgetRequestNo *string `json:"modify_budget_request_no"`
- }
- func (o ModifyBudgetRequest) MarshalJSON() ([]byte, error) {
- toSerialize := map[string]interface{}{}
- if o.StockId == nil {
- return nil, fmt.Errorf("field `StockId` is required and must be specified in ModifyBudgetRequest")
- }
- toSerialize["stock_id"] = o.StockId
- if o.TargetMaxCoupons != nil {
- toSerialize["target_max_coupons"] = o.TargetMaxCoupons
- }
- if o.CurrentMaxCoupons != nil {
- toSerialize["current_max_coupons"] = o.CurrentMaxCoupons
- }
- if o.TargetMaxCouponsByDay != nil {
- toSerialize["target_max_coupons_by_day"] = o.TargetMaxCouponsByDay
- }
- if o.CurrentMaxCouponsByDay != nil {
- toSerialize["current_max_coupons_by_day"] = o.CurrentMaxCouponsByDay
- }
- if o.ModifyBudgetRequestNo == nil {
- return nil, fmt.Errorf("field `ModifyBudgetRequestNo` is required and must be specified in ModifyBudgetRequest")
- }
- toSerialize["modify_budget_request_no"] = o.ModifyBudgetRequestNo
- return json.Marshal(toSerialize)
- }
- func (o ModifyBudgetRequest) String() string {
- var ret string
- if o.StockId == nil {
- ret += "StockId:<nil>, "
- } else {
- ret += fmt.Sprintf("StockId:%v, ", *o.StockId)
- }
- if o.TargetMaxCoupons == nil {
- ret += "TargetMaxCoupons:<nil>, "
- } else {
- ret += fmt.Sprintf("TargetMaxCoupons:%v, ", *o.TargetMaxCoupons)
- }
- if o.CurrentMaxCoupons == nil {
- ret += "CurrentMaxCoupons:<nil>, "
- } else {
- ret += fmt.Sprintf("CurrentMaxCoupons:%v, ", *o.CurrentMaxCoupons)
- }
- if o.TargetMaxCouponsByDay == nil {
- ret += "TargetMaxCouponsByDay:<nil>, "
- } else {
- ret += fmt.Sprintf("TargetMaxCouponsByDay:%v, ", *o.TargetMaxCouponsByDay)
- }
- if o.CurrentMaxCouponsByDay == nil {
- ret += "CurrentMaxCouponsByDay:<nil>, "
- } else {
- ret += fmt.Sprintf("CurrentMaxCouponsByDay:%v, ", *o.CurrentMaxCouponsByDay)
- }
- if o.ModifyBudgetRequestNo == nil {
- ret += "ModifyBudgetRequestNo:<nil>"
- } else {
- ret += fmt.Sprintf("ModifyBudgetRequestNo:%v", *o.ModifyBudgetRequestNo)
- }
- return fmt.Sprintf("ModifyBudgetRequest{%s}", ret)
- }
- func (o ModifyBudgetRequest) Clone() *ModifyBudgetRequest {
- ret := ModifyBudgetRequest{}
- if o.StockId != nil {
- ret.StockId = new(string)
- *ret.StockId = *o.StockId
- }
- if o.TargetMaxCoupons != nil {
- ret.TargetMaxCoupons = new(int64)
- *ret.TargetMaxCoupons = *o.TargetMaxCoupons
- }
- if o.CurrentMaxCoupons != nil {
- ret.CurrentMaxCoupons = new(int64)
- *ret.CurrentMaxCoupons = *o.CurrentMaxCoupons
- }
- if o.TargetMaxCouponsByDay != nil {
- ret.TargetMaxCouponsByDay = new(int64)
- *ret.TargetMaxCouponsByDay = *o.TargetMaxCouponsByDay
- }
- if o.CurrentMaxCouponsByDay != nil {
- ret.CurrentMaxCouponsByDay = new(int64)
- *ret.CurrentMaxCouponsByDay = *o.CurrentMaxCouponsByDay
- }
- if o.ModifyBudgetRequestNo != nil {
- ret.ModifyBudgetRequestNo = new(string)
- *ret.ModifyBudgetRequestNo = *o.ModifyBudgetRequestNo
- }
- return &ret
- }
- // ModifyBudgetResponse
- type ModifyBudgetResponse struct {
- // 批次最大发放个数
- MaxCoupons *int64 `json:"max_coupons"`
- // 当前单天发放上限个数
- MaxCouponsByDay *int64 `json:"max_coupons_by_day,omitempty"`
- }
- func (o ModifyBudgetResponse) MarshalJSON() ([]byte, error) {
- toSerialize := map[string]interface{}{}
- if o.MaxCoupons == nil {
- return nil, fmt.Errorf("field `MaxCoupons` is required and must be specified in ModifyBudgetResponse")
- }
- toSerialize["max_coupons"] = o.MaxCoupons
- if o.MaxCouponsByDay != nil {
- toSerialize["max_coupons_by_day"] = o.MaxCouponsByDay
- }
- return json.Marshal(toSerialize)
- }
- func (o ModifyBudgetResponse) String() string {
- var ret string
- if o.MaxCoupons == nil {
- ret += "MaxCoupons:<nil>, "
- } else {
- ret += fmt.Sprintf("MaxCoupons:%v, ", *o.MaxCoupons)
- }
- if o.MaxCouponsByDay == nil {
- ret += "MaxCouponsByDay:<nil>"
- } else {
- ret += fmt.Sprintf("MaxCouponsByDay:%v", *o.MaxCouponsByDay)
- }
- return fmt.Sprintf("ModifyBudgetResponse{%s}", ret)
- }
- func (o ModifyBudgetResponse) Clone() *ModifyBudgetResponse {
- ret := ModifyBudgetResponse{}
- if o.MaxCoupons != nil {
- ret.MaxCoupons = new(int64)
- *ret.MaxCoupons = *o.MaxCoupons
- }
- if o.MaxCouponsByDay != nil {
- ret.MaxCouponsByDay = new(int64)
- *ret.MaxCouponsByDay = *o.MaxCouponsByDay
- }
- return &ret
- }
- // ModifyCouponUseRule
- type ModifyCouponUseRule struct {
- // 核销方式
- UseMethod *CouponUseMethod `json:"use_method,omitempty"`
- // 核销方式为线上小程序核销才有效
- MiniProgramsAppid *string `json:"mini_programs_appid,omitempty"`
- // 核销方式为线上小程序核销才有效
- MiniProgramsPath *string `json:"mini_programs_path,omitempty"`
- }
- func (o ModifyCouponUseRule) MarshalJSON() ([]byte, error) {
- toSerialize := map[string]interface{}{}
- if o.UseMethod != nil {
- toSerialize["use_method"] = o.UseMethod
- }
- if o.MiniProgramsAppid != nil {
- toSerialize["mini_programs_appid"] = o.MiniProgramsAppid
- }
- if o.MiniProgramsPath != nil {
- toSerialize["mini_programs_path"] = o.MiniProgramsPath
- }
- return json.Marshal(toSerialize)
- }
- func (o ModifyCouponUseRule) String() string {
- var ret string
- if o.UseMethod == nil {
- ret += "UseMethod:<nil>, "
- } else {
- ret += fmt.Sprintf("UseMethod:%v, ", *o.UseMethod)
- }
- if o.MiniProgramsAppid == nil {
- ret += "MiniProgramsAppid:<nil>, "
- } else {
- ret += fmt.Sprintf("MiniProgramsAppid:%v, ", *o.MiniProgramsAppid)
- }
- if o.MiniProgramsPath == nil {
- ret += "MiniProgramsPath:<nil>"
- } else {
- ret += fmt.Sprintf("MiniProgramsPath:%v", *o.MiniProgramsPath)
- }
- return fmt.Sprintf("ModifyCouponUseRule{%s}", ret)
- }
- func (o ModifyCouponUseRule) Clone() *ModifyCouponUseRule {
- ret := ModifyCouponUseRule{}
- if o.UseMethod != nil {
- ret.UseMethod = new(CouponUseMethod)
- *ret.UseMethod = *o.UseMethod
- }
- if o.MiniProgramsAppid != nil {
- ret.MiniProgramsAppid = new(string)
- *ret.MiniProgramsAppid = *o.MiniProgramsAppid
- }
- if o.MiniProgramsPath != nil {
- ret.MiniProgramsPath = new(string)
- *ret.MiniProgramsPath = *o.MiniProgramsPath
- }
- return &ret
- }
- // ModifyCustomEntrance
- type ModifyCustomEntrance struct {
- // 需要小程序APPID、path、入口文案、引导文案。如果需要跳转小程序,APPID、path、入口文案为必填,引导文案非必填。AppID要与归属商户号有绑定关系
- MiniProgramsInfo *ModifyMiniAppInfo `json:"mini_programs_info,omitempty"`
- // 可配置商户公众号,从券详情可跳转至公众号
- Appid *string `json:"appid,omitempty"`
- // 填写微信支付营销馆的馆id,用户自定义字段。[营销馆](https://pay.weixin.qq.com/index.php/xphp/cfav_market/hall#/pages/list/list)需在商户平台创建。
- HallId *string `json:"hall_id,omitempty"`
- // code展示模式
- CodeDisplayMode *CodeDisplayMode `json:"code_display_mode,omitempty"`
- }
- func (o ModifyCustomEntrance) MarshalJSON() ([]byte, error) {
- toSerialize := map[string]interface{}{}
- if o.MiniProgramsInfo != nil {
- toSerialize["mini_programs_info"] = o.MiniProgramsInfo
- }
- if o.Appid != nil {
- toSerialize["appid"] = o.Appid
- }
- if o.HallId != nil {
- toSerialize["hall_id"] = o.HallId
- }
- if o.CodeDisplayMode != nil {
- toSerialize["code_display_mode"] = o.CodeDisplayMode
- }
- return json.Marshal(toSerialize)
- }
- func (o ModifyCustomEntrance) String() string {
- var ret string
- ret += fmt.Sprintf("MiniProgramsInfo:%v, ", o.MiniProgramsInfo)
- if o.Appid == nil {
- ret += "Appid:<nil>, "
- } else {
- ret += fmt.Sprintf("Appid:%v, ", *o.Appid)
- }
- if o.HallId == nil {
- ret += "HallId:<nil>, "
- } else {
- ret += fmt.Sprintf("HallId:%v, ", *o.HallId)
- }
- if o.CodeDisplayMode == nil {
- ret += "CodeDisplayMode:<nil>"
- } else {
- ret += fmt.Sprintf("CodeDisplayMode:%v", *o.CodeDisplayMode)
- }
- return fmt.Sprintf("ModifyCustomEntrance{%s}", ret)
- }
- func (o ModifyCustomEntrance) Clone() *ModifyCustomEntrance {
- ret := ModifyCustomEntrance{}
- if o.MiniProgramsInfo != nil {
- ret.MiniProgramsInfo = o.MiniProgramsInfo.Clone()
- }
- if o.Appid != nil {
- ret.Appid = new(string)
- *ret.Appid = *o.Appid
- }
- if o.HallId != nil {
- ret.HallId = new(string)
- *ret.HallId = *o.HallId
- }
- if o.CodeDisplayMode != nil {
- ret.CodeDisplayMode = new(CodeDisplayMode)
- *ret.CodeDisplayMode = *o.CodeDisplayMode
- }
- return &ret
- }
- // ModifyMiniAppInfo
- type ModifyMiniAppInfo struct {
- // 需要小程序AppID与归属商户号有绑定关系
- MiniProgramsAppid *string `json:"mini_programs_appid,omitempty"`
- // 商家小程序path
- MiniProgramsPath *string `json:"mini_programs_path,omitempty"`
- // 入口文案,字数上限为5个,一个中文汉字/英文字母/数字均占用一个字数。
- EntranceWords *string `json:"entrance_words,omitempty"`
- // 小程序入口引导文案,字数上限为6个,一个中文汉字/英文字母/数字均占用一个字数。
- GuidingWords *string `json:"guiding_words,omitempty"`
- }
- func (o ModifyMiniAppInfo) MarshalJSON() ([]byte, error) {
- toSerialize := map[string]interface{}{}
- if o.MiniProgramsAppid != nil {
- toSerialize["mini_programs_appid"] = o.MiniProgramsAppid
- }
- if o.MiniProgramsPath != nil {
- toSerialize["mini_programs_path"] = o.MiniProgramsPath
- }
- if o.EntranceWords != nil {
- toSerialize["entrance_words"] = o.EntranceWords
- }
- if o.GuidingWords != nil {
- toSerialize["guiding_words"] = o.GuidingWords
- }
- return json.Marshal(toSerialize)
- }
- func (o ModifyMiniAppInfo) String() string {
- var ret string
- if o.MiniProgramsAppid == nil {
- ret += "MiniProgramsAppid:<nil>, "
- } else {
- ret += fmt.Sprintf("MiniProgramsAppid:%v, ", *o.MiniProgramsAppid)
- }
- if o.MiniProgramsPath == nil {
- ret += "MiniProgramsPath:<nil>, "
- } else {
- ret += fmt.Sprintf("MiniProgramsPath:%v, ", *o.MiniProgramsPath)
- }
- if o.EntranceWords == nil {
- ret += "EntranceWords:<nil>, "
- } else {
- ret += fmt.Sprintf("EntranceWords:%v, ", *o.EntranceWords)
- }
- if o.GuidingWords == nil {
- ret += "GuidingWords:<nil>"
- } else {
- ret += fmt.Sprintf("GuidingWords:%v", *o.GuidingWords)
- }
- return fmt.Sprintf("ModifyMiniAppInfo{%s}", ret)
- }
- func (o ModifyMiniAppInfo) Clone() *ModifyMiniAppInfo {
- ret := ModifyMiniAppInfo{}
- if o.MiniProgramsAppid != nil {
- ret.MiniProgramsAppid = new(string)
- *ret.MiniProgramsAppid = *o.MiniProgramsAppid
- }
- if o.MiniProgramsPath != nil {
- ret.MiniProgramsPath = new(string)
- *ret.MiniProgramsPath = *o.MiniProgramsPath
- }
- if o.EntranceWords != nil {
- ret.EntranceWords = new(string)
- *ret.EntranceWords = *o.EntranceWords
- }
- if o.GuidingWords != nil {
- ret.GuidingWords = new(string)
- *ret.GuidingWords = *o.GuidingWords
- }
- return &ret
- }
- // ModifyStockInfoBody
- type ModifyStockInfoBody struct {
- // 卡详情页面,可选择多种入口引导用户
- CustomEntrance *ModifyCustomEntrance `json:"custom_entrance,omitempty"`
- // 批次名称,字数上限为21个,一个中文汉字/英文字母/数字均占用一个字数。 注:该字段暂不支持修改
- StockName *string `json:"stock_name,omitempty"`
- // 仅配置商户可见,用于自定义信息。字数上限为20个,一个中文汉字/英文字母/数字均占用一个字数。
- Comment *string `json:"comment,omitempty"`
- // 用来描述批次在哪些商品可用,会显示在微信卡包中。字数上限为15个,一个中文汉字/英文字母/数字均占用一个字数。
- GoodsName *string `json:"goods_name,omitempty"`
- // 商户修改批次凭据号(格式:商户ID+日期+流水号),商户侧需保持唯一性。
- OutRequestNo *string `json:"out_request_no"`
- //
- DisplayPatternInfo *DisplayPatternInfo `json:"display_pattern_info,omitempty"`
- // 券核销相关规则
- CouponUseRule *ModifyCouponUseRule `json:"coupon_use_rule,omitempty"`
- // 券发放相关规则
- StockSendRule *ModifyStockSendRule `json:"stock_send_rule,omitempty"`
- // 事件回调通知商户的配置
- NotifyConfig *NotifyConfig `json:"notify_config,omitempty"`
- // 该批次发放的券是否允许进行补差。只允许从false改为true,不支持从true改为false 注:该字段暂未开放
- Subsidy *bool `json:"subsidy,omitempty"`
- }
- func (o ModifyStockInfoBody) MarshalJSON() ([]byte, error) {
- toSerialize := map[string]interface{}{}
- if o.CustomEntrance != nil {
- toSerialize["custom_entrance"] = o.CustomEntrance
- }
- if o.StockName != nil {
- toSerialize["stock_name"] = o.StockName
- }
- if o.Comment != nil {
- toSerialize["comment"] = o.Comment
- }
- if o.GoodsName != nil {
- toSerialize["goods_name"] = o.GoodsName
- }
- if o.OutRequestNo == nil {
- return nil, fmt.Errorf("field `OutRequestNo` is required and must be specified in ModifyStockInfoBody")
- }
- toSerialize["out_request_no"] = o.OutRequestNo
- if o.DisplayPatternInfo != nil {
- toSerialize["display_pattern_info"] = o.DisplayPatternInfo
- }
- if o.CouponUseRule != nil {
- toSerialize["coupon_use_rule"] = o.CouponUseRule
- }
- if o.StockSendRule != nil {
- toSerialize["stock_send_rule"] = o.StockSendRule
- }
- if o.NotifyConfig != nil {
- toSerialize["notify_config"] = o.NotifyConfig
- }
- if o.Subsidy != nil {
- toSerialize["subsidy"] = o.Subsidy
- }
- return json.Marshal(toSerialize)
- }
- func (o ModifyStockInfoBody) String() string {
- var ret string
- ret += fmt.Sprintf("CustomEntrance:%v, ", o.CustomEntrance)
- if o.StockName == nil {
- ret += "StockName:<nil>, "
- } else {
- ret += fmt.Sprintf("StockName:%v, ", *o.StockName)
- }
- if o.Comment == nil {
- ret += "Comment:<nil>, "
- } else {
- ret += fmt.Sprintf("Comment:%v, ", *o.Comment)
- }
- if o.GoodsName == nil {
- ret += "GoodsName:<nil>, "
- } else {
- ret += fmt.Sprintf("GoodsName:%v, ", *o.GoodsName)
- }
- if o.OutRequestNo == nil {
- ret += "OutRequestNo:<nil>, "
- } else {
- ret += fmt.Sprintf("OutRequestNo:%v, ", *o.OutRequestNo)
- }
- ret += fmt.Sprintf("DisplayPatternInfo:%v, ", o.DisplayPatternInfo)
- ret += fmt.Sprintf("CouponUseRule:%v, ", o.CouponUseRule)
- ret += fmt.Sprintf("StockSendRule:%v, ", o.StockSendRule)
- ret += fmt.Sprintf("NotifyConfig:%v, ", o.NotifyConfig)
- if o.Subsidy == nil {
- ret += "Subsidy:<nil>"
- } else {
- ret += fmt.Sprintf("Subsidy:%v", *o.Subsidy)
- }
- return fmt.Sprintf("ModifyStockInfoBody{%s}", ret)
- }
- func (o ModifyStockInfoBody) Clone() *ModifyStockInfoBody {
- ret := ModifyStockInfoBody{}
- if o.CustomEntrance != nil {
- ret.CustomEntrance = o.CustomEntrance.Clone()
- }
- if o.StockName != nil {
- ret.StockName = new(string)
- *ret.StockName = *o.StockName
- }
- if o.Comment != nil {
- ret.Comment = new(string)
- *ret.Comment = *o.Comment
- }
- if o.GoodsName != nil {
- ret.GoodsName = new(string)
- *ret.GoodsName = *o.GoodsName
- }
- if o.OutRequestNo != nil {
- ret.OutRequestNo = new(string)
- *ret.OutRequestNo = *o.OutRequestNo
- }
- if o.DisplayPatternInfo != nil {
- ret.DisplayPatternInfo = o.DisplayPatternInfo.Clone()
- }
- if o.CouponUseRule != nil {
- ret.CouponUseRule = o.CouponUseRule.Clone()
- }
- if o.StockSendRule != nil {
- ret.StockSendRule = o.StockSendRule.Clone()
- }
- if o.NotifyConfig != nil {
- ret.NotifyConfig = o.NotifyConfig.Clone()
- }
- if o.Subsidy != nil {
- ret.Subsidy = new(bool)
- *ret.Subsidy = *o.Subsidy
- }
- return &ret
- }
- // ModifyStockInfoRequest
- type ModifyStockInfoRequest struct {
- // 批次号
- StockId *string `json:"stock_id"`
- // 卡详情页面,可选择多种入口引导用户
- CustomEntrance *ModifyCustomEntrance `json:"custom_entrance,omitempty"`
- // 批次名称,字数上限为21个,一个中文汉字/英文字母/数字均占用一个字数。 注:该字段暂不支持修改
- StockName *string `json:"stock_name,omitempty"`
- // 仅配置商户可见,用于自定义信息。字数上限为20个,一个中文汉字/英文字母/数字均占用一个字数。
- Comment *string `json:"comment,omitempty"`
- // 用来描述批次在哪些商品可用,会显示在微信卡包中。字数上限为15个,一个中文汉字/英文字母/数字均占用一个字数。
- GoodsName *string `json:"goods_name,omitempty"`
- // 商户修改批次凭据号(格式:商户ID+日期+流水号),商户侧需保持唯一性。
- OutRequestNo *string `json:"out_request_no"`
- //
- DisplayPatternInfo *DisplayPatternInfo `json:"display_pattern_info,omitempty"`
- // 券核销相关规则
- CouponUseRule *ModifyCouponUseRule `json:"coupon_use_rule,omitempty"`
- // 券发放相关规则
- StockSendRule *ModifyStockSendRule `json:"stock_send_rule,omitempty"`
- // 事件回调通知商户的配置
- NotifyConfig *NotifyConfig `json:"notify_config,omitempty"`
- // 该批次发放的券是否允许进行补差。只允许从false改为true,不支持从true改为false 注:该字段暂未开放
- Subsidy *bool `json:"subsidy,omitempty"`
- }
- func (o ModifyStockInfoRequest) MarshalJSON() ([]byte, error) {
- toSerialize := map[string]interface{}{}
- if o.StockId == nil {
- return nil, fmt.Errorf("field `StockId` is required and must be specified in ModifyStockInfoRequest")
- }
- toSerialize["stock_id"] = o.StockId
- if o.CustomEntrance != nil {
- toSerialize["custom_entrance"] = o.CustomEntrance
- }
- if o.StockName != nil {
- toSerialize["stock_name"] = o.StockName
- }
- if o.Comment != nil {
- toSerialize["comment"] = o.Comment
- }
- if o.GoodsName != nil {
- toSerialize["goods_name"] = o.GoodsName
- }
- if o.OutRequestNo == nil {
- return nil, fmt.Errorf("field `OutRequestNo` is required and must be specified in ModifyStockInfoRequest")
- }
- toSerialize["out_request_no"] = o.OutRequestNo
- if o.DisplayPatternInfo != nil {
- toSerialize["display_pattern_info"] = o.DisplayPatternInfo
- }
- if o.CouponUseRule != nil {
- toSerialize["coupon_use_rule"] = o.CouponUseRule
- }
- if o.StockSendRule != nil {
- toSerialize["stock_send_rule"] = o.StockSendRule
- }
- if o.NotifyConfig != nil {
- toSerialize["notify_config"] = o.NotifyConfig
- }
- if o.Subsidy != nil {
- toSerialize["subsidy"] = o.Subsidy
- }
- return json.Marshal(toSerialize)
- }
- func (o ModifyStockInfoRequest) String() string {
- var ret string
- if o.StockId == nil {
- ret += "StockId:<nil>, "
- } else {
- ret += fmt.Sprintf("StockId:%v, ", *o.StockId)
- }
- ret += fmt.Sprintf("CustomEntrance:%v, ", o.CustomEntrance)
- if o.StockName == nil {
- ret += "StockName:<nil>, "
- } else {
- ret += fmt.Sprintf("StockName:%v, ", *o.StockName)
- }
- if o.Comment == nil {
- ret += "Comment:<nil>, "
- } else {
- ret += fmt.Sprintf("Comment:%v, ", *o.Comment)
- }
- if o.GoodsName == nil {
- ret += "GoodsName:<nil>, "
- } else {
- ret += fmt.Sprintf("GoodsName:%v, ", *o.GoodsName)
- }
- if o.OutRequestNo == nil {
- ret += "OutRequestNo:<nil>, "
- } else {
- ret += fmt.Sprintf("OutRequestNo:%v, ", *o.OutRequestNo)
- }
- ret += fmt.Sprintf("DisplayPatternInfo:%v, ", o.DisplayPatternInfo)
- ret += fmt.Sprintf("CouponUseRule:%v, ", o.CouponUseRule)
- ret += fmt.Sprintf("StockSendRule:%v, ", o.StockSendRule)
- ret += fmt.Sprintf("NotifyConfig:%v, ", o.NotifyConfig)
- if o.Subsidy == nil {
- ret += "Subsidy:<nil>"
- } else {
- ret += fmt.Sprintf("Subsidy:%v", *o.Subsidy)
- }
- return fmt.Sprintf("ModifyStockInfoRequest{%s}", ret)
- }
- func (o ModifyStockInfoRequest) Clone() *ModifyStockInfoRequest {
- ret := ModifyStockInfoRequest{}
- if o.StockId != nil {
- ret.StockId = new(string)
- *ret.StockId = *o.StockId
- }
- if o.CustomEntrance != nil {
- ret.CustomEntrance = o.CustomEntrance.Clone()
- }
- if o.StockName != nil {
- ret.StockName = new(string)
- *ret.StockName = *o.StockName
- }
- if o.Comment != nil {
- ret.Comment = new(string)
- *ret.Comment = *o.Comment
- }
- if o.GoodsName != nil {
- ret.GoodsName = new(string)
- *ret.GoodsName = *o.GoodsName
- }
- if o.OutRequestNo != nil {
- ret.OutRequestNo = new(string)
- *ret.OutRequestNo = *o.OutRequestNo
- }
- if o.DisplayPatternInfo != nil {
- ret.DisplayPatternInfo = o.DisplayPatternInfo.Clone()
- }
- if o.CouponUseRule != nil {
- ret.CouponUseRule = o.CouponUseRule.Clone()
- }
- if o.StockSendRule != nil {
- ret.StockSendRule = o.StockSendRule.Clone()
- }
- if o.NotifyConfig != nil {
- ret.NotifyConfig = o.NotifyConfig.Clone()
- }
- if o.Subsidy != nil {
- ret.Subsidy = new(bool)
- *ret.Subsidy = *o.Subsidy
- }
- return &ret
- }
- // ModifyStockSendRule
- type ModifyStockSendRule struct {
- // true-是;false-否,不填默认否 注:该字段暂不支持修改
- NaturalPersonLimit *bool `json:"natural_person_limit,omitempty"`
- // true-是;false-否,不填默认否
- PreventApiAbuse *bool `json:"prevent_api_abuse,omitempty"`
- }
- func (o ModifyStockSendRule) MarshalJSON() ([]byte, error) {
- toSerialize := map[string]interface{}{}
- if o.NaturalPersonLimit != nil {
- toSerialize["natural_person_limit"] = o.NaturalPersonLimit
- }
- if o.PreventApiAbuse != nil {
- toSerialize["prevent_api_abuse"] = o.PreventApiAbuse
- }
- return json.Marshal(toSerialize)
- }
- func (o ModifyStockSendRule) String() string {
- var ret string
- if o.NaturalPersonLimit == nil {
- ret += "NaturalPersonLimit:<nil>, "
- } else {
- ret += fmt.Sprintf("NaturalPersonLimit:%v, ", *o.NaturalPersonLimit)
- }
- if o.PreventApiAbuse == nil {
- ret += "PreventApiAbuse:<nil>"
- } else {
- ret += fmt.Sprintf("PreventApiAbuse:%v", *o.PreventApiAbuse)
- }
- return fmt.Sprintf("ModifyStockSendRule{%s}", ret)
- }
- func (o ModifyStockSendRule) Clone() *ModifyStockSendRule {
- ret := ModifyStockSendRule{}
- if o.NaturalPersonLimit != nil {
- ret.NaturalPersonLimit = new(bool)
- *ret.NaturalPersonLimit = *o.NaturalPersonLimit
- }
- if o.PreventApiAbuse != nil {
- ret.PreventApiAbuse = new(bool)
- *ret.PreventApiAbuse = *o.PreventApiAbuse
- }
- return &ret
- }
- // NotifyConfig
- type NotifyConfig struct {
- // 用于回调通知时,计算返回操作用户的OpenID(诸如领券用户),支持小程序or公众号的AppID;如该字段不填写,则回调通知中涉及到用户身份信息的OpenID与UnionID都将为空。
- NotifyAppid *string `json:"notify_appid,omitempty"`
- }
- func (o NotifyConfig) MarshalJSON() ([]byte, error) {
- toSerialize := map[string]interface{}{}
- if o.NotifyAppid != nil {
- toSerialize["notify_appid"] = o.NotifyAppid
- }
- return json.Marshal(toSerialize)
- }
- func (o NotifyConfig) String() string {
- var ret string
- if o.NotifyAppid == nil {
- ret += "NotifyAppid:<nil>"
- } else {
- ret += fmt.Sprintf("NotifyAppid:%v", *o.NotifyAppid)
- }
- return fmt.Sprintf("NotifyConfig{%s}", ret)
- }
- func (o NotifyConfig) Clone() *NotifyConfig {
- ret := NotifyConfig{}
- if o.NotifyAppid != nil {
- ret.NotifyAppid = new(string)
- *ret.NotifyAppid = *o.NotifyAppid
- }
- return &ret
- }
- // PayReceiptInfoRequest
- type PayReceiptInfoRequest struct {
- // 补差付款唯一单号,由微信支付生成,仅在补差付款成功后有返回
- SubsidyReceiptId *string `json:"subsidy_receipt_id"`
- }
- func (o PayReceiptInfoRequest) MarshalJSON() ([]byte, error) {
- toSerialize := map[string]interface{}{}
- if o.SubsidyReceiptId == nil {
- return nil, fmt.Errorf("field `SubsidyReceiptId` is required and must be specified in PayReceiptInfoRequest")
- }
- toSerialize["subsidy_receipt_id"] = o.SubsidyReceiptId
- return json.Marshal(toSerialize)
- }
- func (o PayReceiptInfoRequest) String() string {
- var ret string
- if o.SubsidyReceiptId == nil {
- ret += "SubsidyReceiptId:<nil>"
- } else {
- ret += fmt.Sprintf("SubsidyReceiptId:%v", *o.SubsidyReceiptId)
- }
- return fmt.Sprintf("PayReceiptInfoRequest{%s}", ret)
- }
- func (o PayReceiptInfoRequest) Clone() *PayReceiptInfoRequest {
- ret := PayReceiptInfoRequest{}
- if o.SubsidyReceiptId != nil {
- ret.SubsidyReceiptId = new(string)
- *ret.SubsidyReceiptId = *o.SubsidyReceiptId
- }
- return &ret
- }
- // PayReceiptListRequest
- type PayReceiptListRequest struct {
- // 由微信支付生成,调用创建商家券API成功时返回的唯一批次ID
- StockId *string `json:"stock_id"`
- // 券的唯一标识。 在WECHATPAY\\_MODE的券code模式下,商家券code是由微信支付生成的唯一ID; 在MERCHANT\\_UPLOAD、MERCHANT\\_API的券code模式下,商家券code是由商户上传或指定,在批次下保证唯一;
- CouponCode *string `json:"coupon_code"`
- // 商户调用补差付款API时填写的“业务请求唯一单号”
- OutSubsidyNo *string `json:"out_subsidy_no,omitempty"`
- }
- func (o PayReceiptListRequest) MarshalJSON() ([]byte, error) {
- toSerialize := map[string]interface{}{}
- if o.StockId == nil {
- return nil, fmt.Errorf("field `StockId` is required and must be specified in PayReceiptListRequest")
- }
- toSerialize["stock_id"] = o.StockId
- if o.CouponCode == nil {
- return nil, fmt.Errorf("field `CouponCode` is required and must be specified in PayReceiptListRequest")
- }
- toSerialize["coupon_code"] = o.CouponCode
- if o.OutSubsidyNo != nil {
- toSerialize["out_subsidy_no"] = o.OutSubsidyNo
- }
- return json.Marshal(toSerialize)
- }
- func (o PayReceiptListRequest) String() string {
- var ret string
- if o.StockId == nil {
- ret += "StockId:<nil>, "
- } else {
- ret += fmt.Sprintf("StockId:%v, ", *o.StockId)
- }
- if o.CouponCode == nil {
- ret += "CouponCode:<nil>, "
- } else {
- ret += fmt.Sprintf("CouponCode:%v, ", *o.CouponCode)
- }
- if o.OutSubsidyNo == nil {
- ret += "OutSubsidyNo:<nil>"
- } else {
- ret += fmt.Sprintf("OutSubsidyNo:%v", *o.OutSubsidyNo)
- }
- return fmt.Sprintf("PayReceiptListRequest{%s}", ret)
- }
- func (o PayReceiptListRequest) Clone() *PayReceiptListRequest {
- ret := PayReceiptListRequest{}
- if o.StockId != nil {
- ret.StockId = new(string)
- *ret.StockId = *o.StockId
- }
- if o.CouponCode != nil {
- ret.CouponCode = new(string)
- *ret.CouponCode = *o.CouponCode
- }
- if o.OutSubsidyNo != nil {
- ret.OutSubsidyNo = new(string)
- *ret.OutSubsidyNo = *o.OutSubsidyNo
- }
- return &ret
- }
- // QueryCouponCodeListRequest
- type QueryCouponCodeListRequest struct {
- // 商家券批次号
- StockId *string `json:"stock_id"`
- // 分页查询的最大size
- Limit *int64 `json:"limit,omitempty"`
- // 分页查询的起始位置
- Offset *int64 `json:"offset,omitempty"`
- // 公众账号ID
- Appid *string `json:"appid,omitempty"`
- // 券code状态,当不填写时为查询所有状态的code列表
- Status *CouponCodeStatus `json:"status,omitempty"`
- }
- func (o QueryCouponCodeListRequest) MarshalJSON() ([]byte, error) {
- toSerialize := map[string]interface{}{}
- if o.StockId == nil {
- return nil, fmt.Errorf("field `StockId` is required and must be specified in QueryCouponCodeListRequest")
- }
- toSerialize["stock_id"] = o.StockId
- if o.Limit != nil {
- toSerialize["limit"] = o.Limit
- }
- if o.Offset != nil {
- toSerialize["offset"] = o.Offset
- }
- if o.Appid != nil {
- toSerialize["appid"] = o.Appid
- }
- if o.Status != nil {
- toSerialize["status"] = o.Status
- }
- return json.Marshal(toSerialize)
- }
- func (o QueryCouponCodeListRequest) String() string {
- var ret string
- if o.StockId == nil {
- ret += "StockId:<nil>, "
- } else {
- ret += fmt.Sprintf("StockId:%v, ", *o.StockId)
- }
- if o.Limit == nil {
- ret += "Limit:<nil>, "
- } else {
- ret += fmt.Sprintf("Limit:%v, ", *o.Limit)
- }
- if o.Offset == nil {
- ret += "Offset:<nil>, "
- } else {
- ret += fmt.Sprintf("Offset:%v, ", *o.Offset)
- }
- if o.Appid == nil {
- ret += "Appid:<nil>, "
- } else {
- ret += fmt.Sprintf("Appid:%v, ", *o.Appid)
- }
- if o.Status == nil {
- ret += "Status:<nil>"
- } else {
- ret += fmt.Sprintf("Status:%v", *o.Status)
- }
- return fmt.Sprintf("QueryCouponCodeListRequest{%s}", ret)
- }
- func (o QueryCouponCodeListRequest) Clone() *QueryCouponCodeListRequest {
- ret := QueryCouponCodeListRequest{}
- if o.StockId != nil {
- ret.StockId = new(string)
- *ret.StockId = *o.StockId
- }
- if o.Limit != nil {
- ret.Limit = new(int64)
- *ret.Limit = *o.Limit
- }
- if o.Offset != nil {
- ret.Offset = new(int64)
- *ret.Offset = *o.Offset
- }
- if o.Appid != nil {
- ret.Appid = new(string)
- *ret.Appid = *o.Appid
- }
- if o.Status != nil {
- ret.Status = new(CouponCodeStatus)
- *ret.Status = *o.Status
- }
- return &ret
- }
- // QueryCouponRequest
- type QueryCouponRequest struct {
- // 券的唯一标识
- CouponCode *string `json:"coupon_code"`
- // 支持传入与当前调用接口商户号有绑定关系的AppID。支持小程序AppID与公众号AppID。 校验规则:传入的AppID得是与调用方商户号(即请求头里面的商户号)有绑定关系的AppID或传入的AppID得是归属商户号有绑定关系的AppID
- Appid *string `json:"appid"`
- // OpenID信息,用户在AppID下的唯一标识。 校验规则:传入的OpenID得是调用方商户号(即请求头里面的商户号)有绑定关系的AppID获取的OpenID或传入的OpenID得是归属商户号有绑定关系的AppID获取的OpenID。[获取OpenID文档](https://pay.weixin.qq.com/wiki/doc/apiv3/terms_definition/chapter1_1_3.shtml#part-3)
- Openid *string `json:"openid"`
- }
- func (o QueryCouponRequest) MarshalJSON() ([]byte, error) {
- toSerialize := map[string]interface{}{}
- if o.CouponCode == nil {
- return nil, fmt.Errorf("field `CouponCode` is required and must be specified in QueryCouponRequest")
- }
- toSerialize["coupon_code"] = o.CouponCode
- if o.Appid == nil {
- return nil, fmt.Errorf("field `Appid` is required and must be specified in QueryCouponRequest")
- }
- toSerialize["appid"] = o.Appid
- if o.Openid == nil {
- return nil, fmt.Errorf("field `Openid` is required and must be specified in QueryCouponRequest")
- }
- toSerialize["openid"] = o.Openid
- return json.Marshal(toSerialize)
- }
- func (o QueryCouponRequest) String() string {
- var ret string
- if o.CouponCode == nil {
- ret += "CouponCode:<nil>, "
- } else {
- ret += fmt.Sprintf("CouponCode:%v, ", *o.CouponCode)
- }
- if o.Appid == nil {
- ret += "Appid:<nil>, "
- } else {
- ret += fmt.Sprintf("Appid:%v, ", *o.Appid)
- }
- if o.Openid == nil {
- ret += "Openid:<nil>"
- } else {
- ret += fmt.Sprintf("Openid:%v", *o.Openid)
- }
- return fmt.Sprintf("QueryCouponRequest{%s}", ret)
- }
- func (o QueryCouponRequest) Clone() *QueryCouponRequest {
- ret := QueryCouponRequest{}
- if o.CouponCode != nil {
- ret.CouponCode = new(string)
- *ret.CouponCode = *o.CouponCode
- }
- if o.Appid != nil {
- ret.Appid = new(string)
- *ret.Appid = *o.Appid
- }
- if o.Openid != nil {
- ret.Openid = new(string)
- *ret.Openid = *o.Openid
- }
- return &ret
- }
- // QueryStockRequest
- type QueryStockRequest struct {
- // 微信为每个商家券批次分配的唯一ID
- StockId *string `json:"stock_id"`
- }
- func (o QueryStockRequest) MarshalJSON() ([]byte, error) {
- toSerialize := map[string]interface{}{}
- if o.StockId == nil {
- return nil, fmt.Errorf("field `StockId` is required and must be specified in QueryStockRequest")
- }
- toSerialize["stock_id"] = o.StockId
- return json.Marshal(toSerialize)
- }
- func (o QueryStockRequest) String() string {
- var ret string
- if o.StockId == nil {
- ret += "StockId:<nil>"
- } else {
- ret += fmt.Sprintf("StockId:%v", *o.StockId)
- }
- return fmt.Sprintf("QueryStockRequest{%s}", ret)
- }
- func (o QueryStockRequest) Clone() *QueryStockRequest {
- ret := QueryStockRequest{}
- if o.StockId != nil {
- ret.StockId = new(string)
- *ret.StockId = *o.StockId
- }
- return &ret
- }
- // ReturnCouponRequest
- type ReturnCouponRequest struct {
- // 券的唯一标识
- CouponCode *string `json:"coupon_code"`
- // 券的所属批次号
- StockId *string `json:"stock_id"`
- // 每次退券请求的唯一标识,商户需保证唯一
- ReturnRequestNo *string `json:"return_request_no"`
- }
- func (o ReturnCouponRequest) MarshalJSON() ([]byte, error) {
- toSerialize := map[string]interface{}{}
- if o.CouponCode == nil {
- return nil, fmt.Errorf("field `CouponCode` is required and must be specified in ReturnCouponRequest")
- }
- toSerialize["coupon_code"] = o.CouponCode
- if o.StockId == nil {
- return nil, fmt.Errorf("field `StockId` is required and must be specified in ReturnCouponRequest")
- }
- toSerialize["stock_id"] = o.StockId
- if o.ReturnRequestNo == nil {
- return nil, fmt.Errorf("field `ReturnRequestNo` is required and must be specified in ReturnCouponRequest")
- }
- toSerialize["return_request_no"] = o.ReturnRequestNo
- return json.Marshal(toSerialize)
- }
- func (o ReturnCouponRequest) String() string {
- var ret string
- if o.CouponCode == nil {
- ret += "CouponCode:<nil>, "
- } else {
- ret += fmt.Sprintf("CouponCode:%v, ", *o.CouponCode)
- }
- if o.StockId == nil {
- ret += "StockId:<nil>, "
- } else {
- ret += fmt.Sprintf("StockId:%v, ", *o.StockId)
- }
- if o.ReturnRequestNo == nil {
- ret += "ReturnRequestNo:<nil>"
- } else {
- ret += fmt.Sprintf("ReturnRequestNo:%v", *o.ReturnRequestNo)
- }
- return fmt.Sprintf("ReturnCouponRequest{%s}", ret)
- }
- func (o ReturnCouponRequest) Clone() *ReturnCouponRequest {
- ret := ReturnCouponRequest{}
- if o.CouponCode != nil {
- ret.CouponCode = new(string)
- *ret.CouponCode = *o.CouponCode
- }
- if o.StockId != nil {
- ret.StockId = new(string)
- *ret.StockId = *o.StockId
- }
- if o.ReturnRequestNo != nil {
- ret.ReturnRequestNo = new(string)
- *ret.ReturnRequestNo = *o.ReturnRequestNo
- }
- return &ret
- }
- // ReturnCouponResponse
- type ReturnCouponResponse struct {
- // 微信退券成功的时间,遵循[rfc3339](https://datatracker.ietf.org/doc/html/rfc3339)标准格式,格式为yyyy-MM-DDTHH:mm:ss+TIMEZONE,yyyy-MM-DD表示年月日,T出现在字符串中,表示time元素的开头,HH:mm:ss表示时分秒,TIMEZONE表示时区(+08:00表示东八区时间,领先UTC 8小时,即北京时间)。例如:2015-05-20T13:29:35+08:00表示,北京时间2015年5月20日 13点29分35秒。
- WechatpayReturnTime *time.Time `json:"wechatpay_return_time"`
- }
- func (o ReturnCouponResponse) MarshalJSON() ([]byte, error) {
- toSerialize := map[string]interface{}{}
- if o.WechatpayReturnTime == nil {
- return nil, fmt.Errorf("field `WechatpayReturnTime` is required and must be specified in ReturnCouponResponse")
- }
- toSerialize["wechatpay_return_time"] = o.WechatpayReturnTime.Format(time.RFC3339)
- return json.Marshal(toSerialize)
- }
- func (o ReturnCouponResponse) String() string {
- var ret string
- if o.WechatpayReturnTime == nil {
- ret += "WechatpayReturnTime:<nil>"
- } else {
- ret += fmt.Sprintf("WechatpayReturnTime:%v", *o.WechatpayReturnTime)
- }
- return fmt.Sprintf("ReturnCouponResponse{%s}", ret)
- }
- func (o ReturnCouponResponse) Clone() *ReturnCouponResponse {
- ret := ReturnCouponResponse{}
- if o.WechatpayReturnTime != nil {
- ret.WechatpayReturnTime = new(time.Time)
- *ret.WechatpayReturnTime = *o.WechatpayReturnTime
- }
- return &ret
- }
- // ReturnReceiptInfoRequest
- type ReturnReceiptInfoRequest struct {
- // 补差回退唯一单号,由微信支付生成,仅在补差回退成功后有返回
- SubsidyReturnReceiptId *string `json:"subsidy_return_receipt_id"`
- }
- func (o ReturnReceiptInfoRequest) MarshalJSON() ([]byte, error) {
- toSerialize := map[string]interface{}{}
- if o.SubsidyReturnReceiptId == nil {
- return nil, fmt.Errorf("field `SubsidyReturnReceiptId` is required and must be specified in ReturnReceiptInfoRequest")
- }
- toSerialize["subsidy_return_receipt_id"] = o.SubsidyReturnReceiptId
- return json.Marshal(toSerialize)
- }
- func (o ReturnReceiptInfoRequest) String() string {
- var ret string
- if o.SubsidyReturnReceiptId == nil {
- ret += "SubsidyReturnReceiptId:<nil>"
- } else {
- ret += fmt.Sprintf("SubsidyReturnReceiptId:%v", *o.SubsidyReturnReceiptId)
- }
- return fmt.Sprintf("ReturnReceiptInfoRequest{%s}", ret)
- }
- func (o ReturnReceiptInfoRequest) Clone() *ReturnReceiptInfoRequest {
- ret := ReturnReceiptInfoRequest{}
- if o.SubsidyReturnReceiptId != nil {
- ret.SubsidyReturnReceiptId = new(string)
- *ret.SubsidyReturnReceiptId = *o.SubsidyReturnReceiptId
- }
- return &ret
- }
- // SendCount
- type SendCount struct {
- // 批次已发放的券数量,满减、折扣、换购类型会返回该字段
- TotalSendNum *int64 `json:"total_send_num,omitempty"`
- // 批次已发放的预算金额,满减券类型会返回该字段
- TotalSendAmount *int64 `json:"total_send_amount,omitempty"`
- // 批次当天已发放的券数量,设置了单天发放上限的满减、折扣、换购类型返回该字段
- TodaySendNum *int64 `json:"today_send_num,omitempty"`
- // 批次当天已发放的预算金额,设置了当天发放上限的满减券类型返回该字段
- TodaySendAmount *int64 `json:"today_send_amount,omitempty"`
- }
- func (o SendCount) MarshalJSON() ([]byte, error) {
- toSerialize := map[string]interface{}{}
- if o.TotalSendNum != nil {
- toSerialize["total_send_num"] = o.TotalSendNum
- }
- if o.TotalSendAmount != nil {
- toSerialize["total_send_amount"] = o.TotalSendAmount
- }
- if o.TodaySendNum != nil {
- toSerialize["today_send_num"] = o.TodaySendNum
- }
- if o.TodaySendAmount != nil {
- toSerialize["today_send_amount"] = o.TodaySendAmount
- }
- return json.Marshal(toSerialize)
- }
- func (o SendCount) String() string {
- var ret string
- if o.TotalSendNum == nil {
- ret += "TotalSendNum:<nil>, "
- } else {
- ret += fmt.Sprintf("TotalSendNum:%v, ", *o.TotalSendNum)
- }
- if o.TotalSendAmount == nil {
- ret += "TotalSendAmount:<nil>, "
- } else {
- ret += fmt.Sprintf("TotalSendAmount:%v, ", *o.TotalSendAmount)
- }
- if o.TodaySendNum == nil {
- ret += "TodaySendNum:<nil>, "
- } else {
- ret += fmt.Sprintf("TodaySendNum:%v, ", *o.TodaySendNum)
- }
- if o.TodaySendAmount == nil {
- ret += "TodaySendAmount:<nil>"
- } else {
- ret += fmt.Sprintf("TodaySendAmount:%v", *o.TodaySendAmount)
- }
- return fmt.Sprintf("SendCount{%s}", ret)
- }
- func (o SendCount) Clone() *SendCount {
- ret := SendCount{}
- if o.TotalSendNum != nil {
- ret.TotalSendNum = new(int64)
- *ret.TotalSendNum = *o.TotalSendNum
- }
- if o.TotalSendAmount != nil {
- ret.TotalSendAmount = new(int64)
- *ret.TotalSendAmount = *o.TotalSendAmount
- }
- if o.TodaySendNum != nil {
- ret.TodaySendNum = new(int64)
- *ret.TodaySendNum = *o.TodaySendNum
- }
- if o.TodaySendAmount != nil {
- ret.TodaySendAmount = new(int64)
- *ret.TodaySendAmount = *o.TodaySendAmount
- }
- return &ret
- }
- // SendCouponRequest
- type SendCouponRequest struct {
- // 用户的唯一标识,必填
- Openid *string `json:"openid"`
- // 发券方AppID
- Appid *string `json:"appid"`
- // 批次号
- StockId *string `json:"stock_id"`
- // 发券凭证,可包含英文字母,数字,|,_,*,-等内容,不允许出现其他不合法符号,需在单个批次单个用户下确保唯一性
- OutRequestNo *string `json:"out_request_no"`
- // 要求接口指定code发券的批次必传
- CouponCode *string `json:"coupon_code,omitempty"`
- }
- func (o SendCouponRequest) MarshalJSON() ([]byte, error) {
- toSerialize := map[string]interface{}{}
- if o.Openid == nil {
- return nil, fmt.Errorf("field `Openid` is required and must be specified in SendCouponRequest")
- }
- toSerialize["openid"] = o.Openid
- if o.Appid == nil {
- return nil, fmt.Errorf("field `Appid` is required and must be specified in SendCouponRequest")
- }
- toSerialize["appid"] = o.Appid
- if o.StockId == nil {
- return nil, fmt.Errorf("field `StockId` is required and must be specified in SendCouponRequest")
- }
- toSerialize["stock_id"] = o.StockId
- if o.OutRequestNo == nil {
- return nil, fmt.Errorf("field `OutRequestNo` is required and must be specified in SendCouponRequest")
- }
- toSerialize["out_request_no"] = o.OutRequestNo
- if o.CouponCode != nil {
- toSerialize["coupon_code"] = o.CouponCode
- }
- return json.Marshal(toSerialize)
- }
- func (o SendCouponRequest) String() string {
- var ret string
- if o.Openid == nil {
- ret += "Openid:<nil>, "
- } else {
- ret += fmt.Sprintf("Openid:%v, ", *o.Openid)
- }
- if o.Appid == nil {
- ret += "Appid:<nil>, "
- } else {
- ret += fmt.Sprintf("Appid:%v, ", *o.Appid)
- }
- if o.StockId == nil {
- ret += "StockId:<nil>, "
- } else {
- ret += fmt.Sprintf("StockId:%v, ", *o.StockId)
- }
- if o.OutRequestNo == nil {
- ret += "OutRequestNo:<nil>, "
- } else {
- ret += fmt.Sprintf("OutRequestNo:%v, ", *o.OutRequestNo)
- }
- if o.CouponCode == nil {
- ret += "CouponCode:<nil>"
- } else {
- ret += fmt.Sprintf("CouponCode:%v", *o.CouponCode)
- }
- return fmt.Sprintf("SendCouponRequest{%s}", ret)
- }
- func (o SendCouponRequest) Clone() *SendCouponRequest {
- ret := SendCouponRequest{}
- if o.Openid != nil {
- ret.Openid = new(string)
- *ret.Openid = *o.Openid
- }
- if o.Appid != nil {
- ret.Appid = new(string)
- *ret.Appid = *o.Appid
- }
- if o.StockId != nil {
- ret.StockId = new(string)
- *ret.StockId = *o.StockId
- }
- if o.OutRequestNo != nil {
- ret.OutRequestNo = new(string)
- *ret.OutRequestNo = *o.OutRequestNo
- }
- if o.CouponCode != nil {
- ret.CouponCode = new(string)
- *ret.CouponCode = *o.CouponCode
- }
- return &ret
- }
- // SendCouponResponse
- type SendCouponResponse struct {
- // 发券结果
- SendCouponResult *SendCouponResult `json:"send_coupon_result,omitempty"`
- }
- func (o SendCouponResponse) MarshalJSON() ([]byte, error) {
- toSerialize := map[string]interface{}{}
- if o.SendCouponResult != nil {
- toSerialize["send_coupon_result"] = o.SendCouponResult
- }
- return json.Marshal(toSerialize)
- }
- func (o SendCouponResponse) String() string {
- var ret string
- ret += fmt.Sprintf("SendCouponResult:%v", o.SendCouponResult)
- return fmt.Sprintf("SendCouponResponse{%s}", ret)
- }
- func (o SendCouponResponse) Clone() *SendCouponResponse {
- ret := SendCouponResponse{}
- if o.SendCouponResult != nil {
- ret.SendCouponResult = o.SendCouponResult.Clone()
- }
- return &ret
- }
- // SendCouponResult
- type SendCouponResult struct {
- // 微信支付券批次ID
- StockId *string `json:"stock_id,omitempty"`
- // 发券凭证,可包含英文字母,数字,|,_,*,-等内容,不允许出现其他不合法符号,需在单个批次单个用户下确保唯一性
- OutRequestNo *string `json:"out_request_no,omitempty"`
- // 券的唯一标识
- CouponCode *string `json:"coupon_code,omitempty"`
- }
- func (o SendCouponResult) MarshalJSON() ([]byte, error) {
- toSerialize := map[string]interface{}{}
- if o.StockId != nil {
- toSerialize["stock_id"] = o.StockId
- }
- if o.OutRequestNo != nil {
- toSerialize["out_request_no"] = o.OutRequestNo
- }
- if o.CouponCode != nil {
- toSerialize["coupon_code"] = o.CouponCode
- }
- return json.Marshal(toSerialize)
- }
- func (o SendCouponResult) String() string {
- var ret string
- if o.StockId == nil {
- ret += "StockId:<nil>, "
- } else {
- ret += fmt.Sprintf("StockId:%v, ", *o.StockId)
- }
- if o.OutRequestNo == nil {
- ret += "OutRequestNo:<nil>, "
- } else {
- ret += fmt.Sprintf("OutRequestNo:%v, ", *o.OutRequestNo)
- }
- if o.CouponCode == nil {
- ret += "CouponCode:<nil>"
- } else {
- ret += fmt.Sprintf("CouponCode:%v", *o.CouponCode)
- }
- return fmt.Sprintf("SendCouponResult{%s}", ret)
- }
- func (o SendCouponResult) Clone() *SendCouponResult {
- ret := SendCouponResult{}
- if o.StockId != nil {
- ret.StockId = new(string)
- *ret.StockId = *o.StockId
- }
- if o.OutRequestNo != nil {
- ret.OutRequestNo = new(string)
- *ret.OutRequestNo = *o.OutRequestNo
- }
- if o.CouponCode != nil {
- ret.CouponCode = new(string)
- *ret.CouponCode = *o.CouponCode
- }
- return &ret
- }
- // SendGovCardRequest
- type SendGovCardRequest struct {
- // 消费券通用卡卡包card_id
- CardId *string `json:"card_id"`
- // 消费卡cardi\\_d创建方的AppID,需与API调用方商户号有绑定关系,入参中的用户OpenID也需用此AppID生成
- Appid *string `json:"appid"`
- // 待发券用户的OpenID,需为消费卡创建方AppID生成的OpenID
- Openid *string `json:"openid"`
- // 商户此次发放凭据号。推荐使用大小写字母和数字,不同添加请求发放凭据号不同,商户侧需保证同一发券请求的out_request_no+send_time唯一性
- OutRequestNo *string `json:"out_request_no"`
- // 单次请求发卡时间,消费卡在商户系统的实际发放时间,为东八区标准时间(UTC+8)。商户需保证同一次请求的out_request_no+send_time唯一。由于系统限制,暂不支持传入早于当前时间24小时以上的时间进行发券请求。
- SendTime *string `json:"send_time"`
- }
- func (o SendGovCardRequest) MarshalJSON() ([]byte, error) {
- toSerialize := map[string]interface{}{}
- if o.CardId == nil {
- return nil, fmt.Errorf("field `CardId` is required and must be specified in SendGovCardRequest")
- }
- toSerialize["card_id"] = o.CardId
- if o.Appid == nil {
- return nil, fmt.Errorf("field `Appid` is required and must be specified in SendGovCardRequest")
- }
- toSerialize["appid"] = o.Appid
- if o.Openid == nil {
- return nil, fmt.Errorf("field `Openid` is required and must be specified in SendGovCardRequest")
- }
- toSerialize["openid"] = o.Openid
- if o.OutRequestNo == nil {
- return nil, fmt.Errorf("field `OutRequestNo` is required and must be specified in SendGovCardRequest")
- }
- toSerialize["out_request_no"] = o.OutRequestNo
- if o.SendTime == nil {
- return nil, fmt.Errorf("field `SendTime` is required and must be specified in SendGovCardRequest")
- }
- toSerialize["send_time"] = o.SendTime
- return json.Marshal(toSerialize)
- }
- func (o SendGovCardRequest) String() string {
- var ret string
- if o.CardId == nil {
- ret += "CardId:<nil>, "
- } else {
- ret += fmt.Sprintf("CardId:%v, ", *o.CardId)
- }
- if o.Appid == nil {
- ret += "Appid:<nil>, "
- } else {
- ret += fmt.Sprintf("Appid:%v, ", *o.Appid)
- }
- if o.Openid == nil {
- ret += "Openid:<nil>, "
- } else {
- ret += fmt.Sprintf("Openid:%v, ", *o.Openid)
- }
- if o.OutRequestNo == nil {
- ret += "OutRequestNo:<nil>, "
- } else {
- ret += fmt.Sprintf("OutRequestNo:%v, ", *o.OutRequestNo)
- }
- if o.SendTime == nil {
- ret += "SendTime:<nil>"
- } else {
- ret += fmt.Sprintf("SendTime:%v", *o.SendTime)
- }
- return fmt.Sprintf("SendGovCardRequest{%s}", ret)
- }
- func (o SendGovCardRequest) Clone() *SendGovCardRequest {
- ret := SendGovCardRequest{}
- if o.CardId != nil {
- ret.CardId = new(string)
- *ret.CardId = *o.CardId
- }
- if o.Appid != nil {
- ret.Appid = new(string)
- *ret.Appid = *o.Appid
- }
- if o.Openid != nil {
- ret.Openid = new(string)
- *ret.Openid = *o.Openid
- }
- if o.OutRequestNo != nil {
- ret.OutRequestNo = new(string)
- *ret.OutRequestNo = *o.OutRequestNo
- }
- if o.SendTime != nil {
- ret.SendTime = new(string)
- *ret.SendTime = *o.SendTime
- }
- return &ret
- }
- // SetCouponNotifyRequest
- type SetCouponNotifyRequest struct {
- // 商户号,不填默认查询调用方商户号
- Mchid *string `json:"mchid,omitempty"`
- // 商户提供的用于接收商家券事件通知的URL地址,必须支持HTTPS。
- NotifyUrl *string `json:"notify_url"`
- }
- func (o SetCouponNotifyRequest) MarshalJSON() ([]byte, error) {
- toSerialize := map[string]interface{}{}
- if o.Mchid != nil {
- toSerialize["mchid"] = o.Mchid
- }
- if o.NotifyUrl == nil {
- return nil, fmt.Errorf("field `NotifyUrl` is required and must be specified in SetCouponNotifyRequest")
- }
- toSerialize["notify_url"] = o.NotifyUrl
- return json.Marshal(toSerialize)
- }
- func (o SetCouponNotifyRequest) String() string {
- var ret string
- if o.Mchid == nil {
- ret += "Mchid:<nil>, "
- } else {
- ret += fmt.Sprintf("Mchid:%v, ", *o.Mchid)
- }
- if o.NotifyUrl == nil {
- ret += "NotifyUrl:<nil>"
- } else {
- ret += fmt.Sprintf("NotifyUrl:%v", *o.NotifyUrl)
- }
- return fmt.Sprintf("SetCouponNotifyRequest{%s}", ret)
- }
- func (o SetCouponNotifyRequest) Clone() *SetCouponNotifyRequest {
- ret := SetCouponNotifyRequest{}
- if o.Mchid != nil {
- ret.Mchid = new(string)
- *ret.Mchid = *o.Mchid
- }
- if o.NotifyUrl != nil {
- ret.NotifyUrl = new(string)
- *ret.NotifyUrl = *o.NotifyUrl
- }
- return &ret
- }
- // SetCouponNotifyResponse
- type SetCouponNotifyResponse struct {
- // 修改时间,遵循[rfc3339](https://datatracker.ietf.org/doc/html/rfc3339)标准格式,格式为yyyy-MM-DDTHH:mm:ss+TIMEZONE,yyyy-MM-DD表示年月日,T出现在字符串中,表示time元素的开头,HH:mm:ss表示时分秒,TIMEZONE表示时区(+08:00表示东八区时间,领先UTC 8小时,即北京时间)。例如:2015-05-20T13:29:35+08:00表示,北京时间2015年5月20日 13点29分35秒。
- UpdateTime *string `json:"update_time"`
- // 商户提供的用于接收商家券事件通知的URL地址,必须支持HTTPS。
- NotifyUrl *string `json:"notify_url"`
- // 商户号
- Mchid *string `json:"mchid"`
- }
- func (o SetCouponNotifyResponse) MarshalJSON() ([]byte, error) {
- toSerialize := map[string]interface{}{}
- if o.UpdateTime == nil {
- return nil, fmt.Errorf("field `UpdateTime` is required and must be specified in SetCouponNotifyResponse")
- }
- toSerialize["update_time"] = o.UpdateTime
- if o.NotifyUrl == nil {
- return nil, fmt.Errorf("field `NotifyUrl` is required and must be specified in SetCouponNotifyResponse")
- }
- toSerialize["notify_url"] = o.NotifyUrl
- if o.Mchid == nil {
- return nil, fmt.Errorf("field `Mchid` is required and must be specified in SetCouponNotifyResponse")
- }
- toSerialize["mchid"] = o.Mchid
- return json.Marshal(toSerialize)
- }
- func (o SetCouponNotifyResponse) String() string {
- var ret string
- if o.UpdateTime == nil {
- ret += "UpdateTime:<nil>, "
- } else {
- ret += fmt.Sprintf("UpdateTime:%v, ", *o.UpdateTime)
- }
- if o.NotifyUrl == nil {
- ret += "NotifyUrl:<nil>, "
- } else {
- ret += fmt.Sprintf("NotifyUrl:%v, ", *o.NotifyUrl)
- }
- if o.Mchid == nil {
- ret += "Mchid:<nil>"
- } else {
- ret += fmt.Sprintf("Mchid:%v", *o.Mchid)
- }
- return fmt.Sprintf("SetCouponNotifyResponse{%s}", ret)
- }
- func (o SetCouponNotifyResponse) Clone() *SetCouponNotifyResponse {
- ret := SetCouponNotifyResponse{}
- if o.UpdateTime != nil {
- ret.UpdateTime = new(string)
- *ret.UpdateTime = *o.UpdateTime
- }
- if o.NotifyUrl != nil {
- ret.NotifyUrl = new(string)
- *ret.NotifyUrl = *o.NotifyUrl
- }
- if o.Mchid != nil {
- ret.Mchid = new(string)
- *ret.Mchid = *o.Mchid
- }
- return &ret
- }
- // StockGetResponse
- type StockGetResponse struct {
- // 批次名称,字数上限为21个,一个中文汉字/英文字母/数字均占用一个字数。
- StockName *string `json:"stock_name"`
- // 批次是归属于哪个商户 注: 普通直连模式,该参数为直连商户号; 服务商模式,该参数为子商户号; 间连模式,该参数为子商户号。
- BelongMerchant *string `json:"belong_merchant"`
- // 仅配置商户可见,用于自定义信息。字数上限为20个,一个中文汉字/英文字母/数字均占用一个字数。
- Comment *string `json:"comment,omitempty"`
- // 用来描述批次在哪些商品可用,会显示在微信卡包中。字数上限为15个,一个中文汉字/英文字母/数字均占用一个字数。
- GoodsName *string `json:"goods_name"`
- // 批次类型
- StockType *BusiFavorStockType `json:"stock_type"`
- // 核销规则
- CouponUseRule *CouponUseRule `json:"coupon_use_rule"`
- // 发放规则
- StockSendRule *StockSendRule `json:"stock_send_rule"`
- // 卡详情页面,可选择多种入口引导用户
- CustomEntrance *CustomEntrance `json:"custom_entrance,omitempty"`
- // 创建批次时的样式信息
- DisplayPatternInfo *DisplayPatternInfo `json:"display_pattern_info,omitempty"`
- // 批次状态
- StockState *StockStatus `json:"stock_state"`
- // 券code模式
- CouponCodeMode *CouponCodeMode `json:"coupon_code_mode"`
- // 批次唯一标识
- StockId *string `json:"stock_id"`
- // 当且仅当coupon_code_mode(券code模式)为MERCHANT_UPLOAD(商户上传自定义code)模式时,返回该字段;返回内容为商户上传code的数量信息
- CouponCodeCount *CouponCodeCount `json:"coupon_code_count,omitempty"`
- // 事件回调通知商户的配置
- NotifyConfig *NotifyConfig `json:"notify_config,omitempty"`
- // 批次发放情况
- SendCountInformation *SendCount `json:"send_count_information,omitempty"`
- // 该批次发放的券是否允许进行补差 注:该字段暂未开放
- Subsidy *bool `json:"subsidy,omitempty"`
- }
- func (o StockGetResponse) MarshalJSON() ([]byte, error) {
- toSerialize := map[string]interface{}{}
- if o.StockName == nil {
- return nil, fmt.Errorf("field `StockName` is required and must be specified in StockGetResponse")
- }
- toSerialize["stock_name"] = o.StockName
- if o.BelongMerchant == nil {
- return nil, fmt.Errorf("field `BelongMerchant` is required and must be specified in StockGetResponse")
- }
- toSerialize["belong_merchant"] = o.BelongMerchant
- if o.Comment != nil {
- toSerialize["comment"] = o.Comment
- }
- if o.GoodsName == nil {
- return nil, fmt.Errorf("field `GoodsName` is required and must be specified in StockGetResponse")
- }
- toSerialize["goods_name"] = o.GoodsName
- if o.StockType == nil {
- return nil, fmt.Errorf("field `StockType` is required and must be specified in StockGetResponse")
- }
- toSerialize["stock_type"] = o.StockType
- if o.CouponUseRule == nil {
- return nil, fmt.Errorf("field `CouponUseRule` is required and must be specified in StockGetResponse")
- }
- toSerialize["coupon_use_rule"] = o.CouponUseRule
- if o.StockSendRule == nil {
- return nil, fmt.Errorf("field `StockSendRule` is required and must be specified in StockGetResponse")
- }
- toSerialize["stock_send_rule"] = o.StockSendRule
- if o.CustomEntrance != nil {
- toSerialize["custom_entrance"] = o.CustomEntrance
- }
- if o.DisplayPatternInfo != nil {
- toSerialize["display_pattern_info"] = o.DisplayPatternInfo
- }
- if o.StockState == nil {
- return nil, fmt.Errorf("field `StockState` is required and must be specified in StockGetResponse")
- }
- toSerialize["stock_state"] = o.StockState
- if o.CouponCodeMode == nil {
- return nil, fmt.Errorf("field `CouponCodeMode` is required and must be specified in StockGetResponse")
- }
- toSerialize["coupon_code_mode"] = o.CouponCodeMode
- if o.StockId == nil {
- return nil, fmt.Errorf("field `StockId` is required and must be specified in StockGetResponse")
- }
- toSerialize["stock_id"] = o.StockId
- if o.CouponCodeCount != nil {
- toSerialize["coupon_code_count"] = o.CouponCodeCount
- }
- if o.NotifyConfig != nil {
- toSerialize["notify_config"] = o.NotifyConfig
- }
- if o.SendCountInformation != nil {
- toSerialize["send_count_information"] = o.SendCountInformation
- }
- if o.Subsidy != nil {
- toSerialize["subsidy"] = o.Subsidy
- }
- return json.Marshal(toSerialize)
- }
- func (o StockGetResponse) String() string {
- var ret string
- if o.StockName == nil {
- ret += "StockName:<nil>, "
- } else {
- ret += fmt.Sprintf("StockName:%v, ", *o.StockName)
- }
- if o.BelongMerchant == nil {
- ret += "BelongMerchant:<nil>, "
- } else {
- ret += fmt.Sprintf("BelongMerchant:%v, ", *o.BelongMerchant)
- }
- if o.Comment == nil {
- ret += "Comment:<nil>, "
- } else {
- ret += fmt.Sprintf("Comment:%v, ", *o.Comment)
- }
- if o.GoodsName == nil {
- ret += "GoodsName:<nil>, "
- } else {
- ret += fmt.Sprintf("GoodsName:%v, ", *o.GoodsName)
- }
- if o.StockType == nil {
- ret += "StockType:<nil>, "
- } else {
- ret += fmt.Sprintf("StockType:%v, ", *o.StockType)
- }
- ret += fmt.Sprintf("CouponUseRule:%v, ", o.CouponUseRule)
- ret += fmt.Sprintf("StockSendRule:%v, ", o.StockSendRule)
- ret += fmt.Sprintf("CustomEntrance:%v, ", o.CustomEntrance)
- ret += fmt.Sprintf("DisplayPatternInfo:%v, ", o.DisplayPatternInfo)
- if o.StockState == nil {
- ret += "StockState:<nil>, "
- } else {
- ret += fmt.Sprintf("StockState:%v, ", *o.StockState)
- }
- if o.CouponCodeMode == nil {
- ret += "CouponCodeMode:<nil>, "
- } else {
- ret += fmt.Sprintf("CouponCodeMode:%v, ", *o.CouponCodeMode)
- }
- if o.StockId == nil {
- ret += "StockId:<nil>, "
- } else {
- ret += fmt.Sprintf("StockId:%v, ", *o.StockId)
- }
- ret += fmt.Sprintf("CouponCodeCount:%v, ", o.CouponCodeCount)
- ret += fmt.Sprintf("NotifyConfig:%v, ", o.NotifyConfig)
- ret += fmt.Sprintf("SendCountInformation:%v, ", o.SendCountInformation)
- if o.Subsidy == nil {
- ret += "Subsidy:<nil>"
- } else {
- ret += fmt.Sprintf("Subsidy:%v", *o.Subsidy)
- }
- return fmt.Sprintf("StockGetResponse{%s}", ret)
- }
- func (o StockGetResponse) Clone() *StockGetResponse {
- ret := StockGetResponse{}
- if o.StockName != nil {
- ret.StockName = new(string)
- *ret.StockName = *o.StockName
- }
- if o.BelongMerchant != nil {
- ret.BelongMerchant = new(string)
- *ret.BelongMerchant = *o.BelongMerchant
- }
- if o.Comment != nil {
- ret.Comment = new(string)
- *ret.Comment = *o.Comment
- }
- if o.GoodsName != nil {
- ret.GoodsName = new(string)
- *ret.GoodsName = *o.GoodsName
- }
- if o.StockType != nil {
- ret.StockType = new(BusiFavorStockType)
- *ret.StockType = *o.StockType
- }
- if o.CouponUseRule != nil {
- ret.CouponUseRule = o.CouponUseRule.Clone()
- }
- if o.StockSendRule != nil {
- ret.StockSendRule = o.StockSendRule.Clone()
- }
- if o.CustomEntrance != nil {
- ret.CustomEntrance = o.CustomEntrance.Clone()
- }
- if o.DisplayPatternInfo != nil {
- ret.DisplayPatternInfo = o.DisplayPatternInfo.Clone()
- }
- if o.StockState != nil {
- ret.StockState = new(StockStatus)
- *ret.StockState = *o.StockState
- }
- if o.CouponCodeMode != nil {
- ret.CouponCodeMode = new(CouponCodeMode)
- *ret.CouponCodeMode = *o.CouponCodeMode
- }
- if o.StockId != nil {
- ret.StockId = new(string)
- *ret.StockId = *o.StockId
- }
- if o.CouponCodeCount != nil {
- ret.CouponCodeCount = o.CouponCodeCount.Clone()
- }
- if o.NotifyConfig != nil {
- ret.NotifyConfig = o.NotifyConfig.Clone()
- }
- if o.SendCountInformation != nil {
- ret.SendCountInformation = o.SendCountInformation.Clone()
- }
- if o.Subsidy != nil {
- ret.Subsidy = new(bool)
- *ret.Subsidy = *o.Subsidy
- }
- return &ret
- }
- // StockSendRule
- type StockSendRule struct {
- // 总预算金额,单位分 注:该字段暂未开放
- MaxAmount *int64 `json:"max_amount,omitempty"`
- // 批次最大可发放个数限制 特殊规则:取值范围 1 ≤ value ≤ 1000000000
- MaxCoupons *int64 `json:"max_coupons,omitempty"`
- // 用户可领个数,每个用户最多100张券。
- MaxCouponsPerUser *int64 `json:"max_coupons_per_user"`
- // 单天发放上限金额 注:该字段暂未开放
- MaxAmountByDay *int64 `json:"max_amount_by_day,omitempty"`
- // 单天发放上限个数(stock\\_type为DISCOUNT或EXCHANGE时可传入此字段控制单天发放上限)。 特殊规则:取值范围 1 ≤ value ≤ 1000000000
- MaxCouponsByDay *int64 `json:"max_coupons_by_day,omitempty"`
- // 不填默认否,枚举值: true:是 false:否 注:自然人防刷即同证件号下的所有账户合并计算的限领次数(限领次数指的是参数字段“用户最大领取个数”填写的值)
- NaturalPersonLimit *bool `json:"natural_person_limit,omitempty"`
- // true-是;false-否,不填默认否
- PreventApiAbuse *bool `json:"prevent_api_abuse,omitempty"`
- // 不填默认否,枚举值: true:是 false:否 该字段暂未开放
- Transferable *bool `json:"transferable,omitempty"`
- // 不填默认否,枚举值: true:是 false:否 该字段暂未开放
- Shareable *bool `json:"shareable,omitempty"`
- }
- func (o StockSendRule) MarshalJSON() ([]byte, error) {
- toSerialize := map[string]interface{}{}
- if o.MaxAmount != nil {
- toSerialize["max_amount"] = o.MaxAmount
- }
- if o.MaxCoupons != nil {
- toSerialize["max_coupons"] = o.MaxCoupons
- }
- if o.MaxCouponsPerUser == nil {
- return nil, fmt.Errorf("field `MaxCouponsPerUser` is required and must be specified in StockSendRule")
- }
- toSerialize["max_coupons_per_user"] = o.MaxCouponsPerUser
- if o.MaxAmountByDay != nil {
- toSerialize["max_amount_by_day"] = o.MaxAmountByDay
- }
- if o.MaxCouponsByDay != nil {
- toSerialize["max_coupons_by_day"] = o.MaxCouponsByDay
- }
- if o.NaturalPersonLimit != nil {
- toSerialize["natural_person_limit"] = o.NaturalPersonLimit
- }
- if o.PreventApiAbuse != nil {
- toSerialize["prevent_api_abuse"] = o.PreventApiAbuse
- }
- if o.Transferable != nil {
- toSerialize["transferable"] = o.Transferable
- }
- if o.Shareable != nil {
- toSerialize["shareable"] = o.Shareable
- }
- return json.Marshal(toSerialize)
- }
- func (o StockSendRule) String() string {
- var ret string
- if o.MaxAmount == nil {
- ret += "MaxAmount:<nil>, "
- } else {
- ret += fmt.Sprintf("MaxAmount:%v, ", *o.MaxAmount)
- }
- if o.MaxCoupons == nil {
- ret += "MaxCoupons:<nil>, "
- } else {
- ret += fmt.Sprintf("MaxCoupons:%v, ", *o.MaxCoupons)
- }
- if o.MaxCouponsPerUser == nil {
- ret += "MaxCouponsPerUser:<nil>, "
- } else {
- ret += fmt.Sprintf("MaxCouponsPerUser:%v, ", *o.MaxCouponsPerUser)
- }
- if o.MaxAmountByDay == nil {
- ret += "MaxAmountByDay:<nil>, "
- } else {
- ret += fmt.Sprintf("MaxAmountByDay:%v, ", *o.MaxAmountByDay)
- }
- if o.MaxCouponsByDay == nil {
- ret += "MaxCouponsByDay:<nil>, "
- } else {
- ret += fmt.Sprintf("MaxCouponsByDay:%v, ", *o.MaxCouponsByDay)
- }
- if o.NaturalPersonLimit == nil {
- ret += "NaturalPersonLimit:<nil>, "
- } else {
- ret += fmt.Sprintf("NaturalPersonLimit:%v, ", *o.NaturalPersonLimit)
- }
- if o.PreventApiAbuse == nil {
- ret += "PreventApiAbuse:<nil>, "
- } else {
- ret += fmt.Sprintf("PreventApiAbuse:%v, ", *o.PreventApiAbuse)
- }
- if o.Transferable == nil {
- ret += "Transferable:<nil>, "
- } else {
- ret += fmt.Sprintf("Transferable:%v, ", *o.Transferable)
- }
- if o.Shareable == nil {
- ret += "Shareable:<nil>"
- } else {
- ret += fmt.Sprintf("Shareable:%v", *o.Shareable)
- }
- return fmt.Sprintf("StockSendRule{%s}", ret)
- }
- func (o StockSendRule) Clone() *StockSendRule {
- ret := StockSendRule{}
- if o.MaxAmount != nil {
- ret.MaxAmount = new(int64)
- *ret.MaxAmount = *o.MaxAmount
- }
- if o.MaxCoupons != nil {
- ret.MaxCoupons = new(int64)
- *ret.MaxCoupons = *o.MaxCoupons
- }
- if o.MaxCouponsPerUser != nil {
- ret.MaxCouponsPerUser = new(int64)
- *ret.MaxCouponsPerUser = *o.MaxCouponsPerUser
- }
- if o.MaxAmountByDay != nil {
- ret.MaxAmountByDay = new(int64)
- *ret.MaxAmountByDay = *o.MaxAmountByDay
- }
- if o.MaxCouponsByDay != nil {
- ret.MaxCouponsByDay = new(int64)
- *ret.MaxCouponsByDay = *o.MaxCouponsByDay
- }
- if o.NaturalPersonLimit != nil {
- ret.NaturalPersonLimit = new(bool)
- *ret.NaturalPersonLimit = *o.NaturalPersonLimit
- }
- if o.PreventApiAbuse != nil {
- ret.PreventApiAbuse = new(bool)
- *ret.PreventApiAbuse = *o.PreventApiAbuse
- }
- if o.Transferable != nil {
- ret.Transferable = new(bool)
- *ret.Transferable = *o.Transferable
- }
- if o.Shareable != nil {
- ret.Shareable = new(bool)
- *ret.Shareable = *o.Shareable
- }
- return &ret
- }
- // StockStatus
- type StockStatus string
- func (e StockStatus) Ptr() *StockStatus {
- return &e
- }
- // Enums of StockStatus
- const (
- STOCKSTATUS_UNAUDIT StockStatus = "UNAUDIT"
- STOCKSTATUS_RUNNING StockStatus = "RUNNING"
- STOCKSTATUS_STOPED StockStatus = "STOPED"
- STOCKSTATUS_PAUSED StockStatus = "PAUSED"
- )
- // SubsidyPayReceipt
- type SubsidyPayReceipt struct {
- // 补差付款唯一单号,由微信支付生成,仅在补差付款成功后有返回
- SubsidyReceiptId *string `json:"subsidy_receipt_id"`
- // 由微信支付生成,调用创建商家券API成功时返回的唯一批次ID
- StockId *string `json:"stock_id"`
- // 券的唯一标识
- CouponCode *string `json:"coupon_code"`
- // 微信支付下单支付成功返回的订单号
- TransactionId *string `json:"transaction_id"`
- // 营销补差扣款商户号
- PayerMerchant *string `json:"payer_merchant"`
- // 营销补差入账商户号
- PayeeMerchant *string `json:"payee_merchant"`
- // 单位为分,单笔订单补差金额不得超过券的优惠金额,最高补差金额为5000元 > 券的优惠金额定义: 满减券:满减金额即为优惠金额 折扣券:优惠金额 = 微信支付订单金额 ÷ 折扣比例 × (1 - 折扣比例) 换购券:不支持
- Amount *int64 `json:"amount"`
- // 付款备注描述,查询的时候原样带回
- Description *string `json:"description"`
- // 补差付款单据状态
- Status *SubsidyPayReceiptStatus `json:"status"`
- // 仅在补差付款失败时,返回告知对应失败的原因
- FailReason *SubsidyPayReceiptFailReason `json:"fail_reason,omitempty"`
- // 仅在补差付款成功时,返回完成时间。遵循[rfc3339](https://datatracker.ietf.org/doc/html/rfc3339)标准格式,格式为yyyy-MM-DDTHH:mm:ss+TIMEZONE,yyyy-MM-DD表示年月日,T出现在字符串中,表示time元素的开头,HH:mm:ss表示时分秒,TIMEZONE表示时区(+08:00表示东八区时间,领先UTC 8小时,即北京时间)。例如:2015-05-20T13:29:35+08:00表示,北京时间2015年5月20日 13点29分35秒。
- SuccessTime *time.Time `json:"success_time,omitempty"`
- // 商户侧需保证唯一性。可包含英文字母,数字,|,_,*,-等内容,不允许出现其他不合法符号
- OutSubsidyNo *string `json:"out_subsidy_no"`
- // 补差付款单据创建时间。遵循rfc3339标准格式,格式为yyyy-MM-DDTHH:mm:ss+TIMEZONE,yyyy-MM-DD表示年月日,T出现在字符串中,表示time元素的开头,HH:mm:ss表示时分秒,TIMEZONE表示时区(+08:00表示东八区时间,领先UTC 8小时,即北京时间)。例如:2015-05-20T13:29:35+08:00表示,北京时间2015年5月20日 13点29分35秒。
- CreateTime *time.Time `json:"create_time,omitempty"`
- }
- func (o SubsidyPayReceipt) MarshalJSON() ([]byte, error) {
- toSerialize := map[string]interface{}{}
- if o.SubsidyReceiptId == nil {
- return nil, fmt.Errorf("field `SubsidyReceiptId` is required and must be specified in SubsidyPayReceipt")
- }
- toSerialize["subsidy_receipt_id"] = o.SubsidyReceiptId
- if o.StockId == nil {
- return nil, fmt.Errorf("field `StockId` is required and must be specified in SubsidyPayReceipt")
- }
- toSerialize["stock_id"] = o.StockId
- if o.CouponCode == nil {
- return nil, fmt.Errorf("field `CouponCode` is required and must be specified in SubsidyPayReceipt")
- }
- toSerialize["coupon_code"] = o.CouponCode
- if o.TransactionId == nil {
- return nil, fmt.Errorf("field `TransactionId` is required and must be specified in SubsidyPayReceipt")
- }
- toSerialize["transaction_id"] = o.TransactionId
- if o.PayerMerchant == nil {
- return nil, fmt.Errorf("field `PayerMerchant` is required and must be specified in SubsidyPayReceipt")
- }
- toSerialize["payer_merchant"] = o.PayerMerchant
- if o.PayeeMerchant == nil {
- return nil, fmt.Errorf("field `PayeeMerchant` is required and must be specified in SubsidyPayReceipt")
- }
- toSerialize["payee_merchant"] = o.PayeeMerchant
- if o.Amount == nil {
- return nil, fmt.Errorf("field `Amount` is required and must be specified in SubsidyPayReceipt")
- }
- toSerialize["amount"] = o.Amount
- if o.Description == nil {
- return nil, fmt.Errorf("field `Description` is required and must be specified in SubsidyPayReceipt")
- }
- toSerialize["description"] = o.Description
- if o.Status == nil {
- return nil, fmt.Errorf("field `Status` is required and must be specified in SubsidyPayReceipt")
- }
- toSerialize["status"] = o.Status
- if o.FailReason != nil {
- toSerialize["fail_reason"] = o.FailReason
- }
- if o.SuccessTime != nil {
- toSerialize["success_time"] = o.SuccessTime.Format(time.RFC3339)
- }
- if o.OutSubsidyNo == nil {
- return nil, fmt.Errorf("field `OutSubsidyNo` is required and must be specified in SubsidyPayReceipt")
- }
- toSerialize["out_subsidy_no"] = o.OutSubsidyNo
- if o.CreateTime != nil {
- toSerialize["create_time"] = o.CreateTime.Format(time.RFC3339)
- }
- return json.Marshal(toSerialize)
- }
- func (o SubsidyPayReceipt) String() string {
- var ret string
- if o.SubsidyReceiptId == nil {
- ret += "SubsidyReceiptId:<nil>, "
- } else {
- ret += fmt.Sprintf("SubsidyReceiptId:%v, ", *o.SubsidyReceiptId)
- }
- if o.StockId == nil {
- ret += "StockId:<nil>, "
- } else {
- ret += fmt.Sprintf("StockId:%v, ", *o.StockId)
- }
- if o.CouponCode == nil {
- ret += "CouponCode:<nil>, "
- } else {
- ret += fmt.Sprintf("CouponCode:%v, ", *o.CouponCode)
- }
- if o.TransactionId == nil {
- ret += "TransactionId:<nil>, "
- } else {
- ret += fmt.Sprintf("TransactionId:%v, ", *o.TransactionId)
- }
- if o.PayerMerchant == nil {
- ret += "PayerMerchant:<nil>, "
- } else {
- ret += fmt.Sprintf("PayerMerchant:%v, ", *o.PayerMerchant)
- }
- if o.PayeeMerchant == nil {
- ret += "PayeeMerchant:<nil>, "
- } else {
- ret += fmt.Sprintf("PayeeMerchant:%v, ", *o.PayeeMerchant)
- }
- if o.Amount == nil {
- ret += "Amount:<nil>, "
- } else {
- ret += fmt.Sprintf("Amount:%v, ", *o.Amount)
- }
- if o.Description == nil {
- ret += "Description:<nil>, "
- } else {
- ret += fmt.Sprintf("Description:%v, ", *o.Description)
- }
- if o.Status == nil {
- ret += "Status:<nil>, "
- } else {
- ret += fmt.Sprintf("Status:%v, ", *o.Status)
- }
- if o.FailReason == nil {
- ret += "FailReason:<nil>, "
- } else {
- ret += fmt.Sprintf("FailReason:%v, ", *o.FailReason)
- }
- if o.SuccessTime == nil {
- ret += "SuccessTime:<nil>, "
- } else {
- ret += fmt.Sprintf("SuccessTime:%v, ", *o.SuccessTime)
- }
- if o.OutSubsidyNo == nil {
- ret += "OutSubsidyNo:<nil>, "
- } else {
- ret += fmt.Sprintf("OutSubsidyNo:%v, ", *o.OutSubsidyNo)
- }
- if o.CreateTime == nil {
- ret += "CreateTime:<nil>"
- } else {
- ret += fmt.Sprintf("CreateTime:%v", *o.CreateTime)
- }
- return fmt.Sprintf("SubsidyPayReceipt{%s}", ret)
- }
- func (o SubsidyPayReceipt) Clone() *SubsidyPayReceipt {
- ret := SubsidyPayReceipt{}
- if o.SubsidyReceiptId != nil {
- ret.SubsidyReceiptId = new(string)
- *ret.SubsidyReceiptId = *o.SubsidyReceiptId
- }
- if o.StockId != nil {
- ret.StockId = new(string)
- *ret.StockId = *o.StockId
- }
- if o.CouponCode != nil {
- ret.CouponCode = new(string)
- *ret.CouponCode = *o.CouponCode
- }
- if o.TransactionId != nil {
- ret.TransactionId = new(string)
- *ret.TransactionId = *o.TransactionId
- }
- if o.PayerMerchant != nil {
- ret.PayerMerchant = new(string)
- *ret.PayerMerchant = *o.PayerMerchant
- }
- if o.PayeeMerchant != nil {
- ret.PayeeMerchant = new(string)
- *ret.PayeeMerchant = *o.PayeeMerchant
- }
- if o.Amount != nil {
- ret.Amount = new(int64)
- *ret.Amount = *o.Amount
- }
- if o.Description != nil {
- ret.Description = new(string)
- *ret.Description = *o.Description
- }
- if o.Status != nil {
- ret.Status = new(SubsidyPayReceiptStatus)
- *ret.Status = *o.Status
- }
- if o.FailReason != nil {
- ret.FailReason = new(SubsidyPayReceiptFailReason)
- *ret.FailReason = *o.FailReason
- }
- if o.SuccessTime != nil {
- ret.SuccessTime = new(time.Time)
- *ret.SuccessTime = *o.SuccessTime
- }
- if o.OutSubsidyNo != nil {
- ret.OutSubsidyNo = new(string)
- *ret.OutSubsidyNo = *o.OutSubsidyNo
- }
- if o.CreateTime != nil {
- ret.CreateTime = new(time.Time)
- *ret.CreateTime = *o.CreateTime
- }
- return &ret
- }
- // SubsidyPayReceiptFailReason
- type SubsidyPayReceiptFailReason string
- func (e SubsidyPayReceiptFailReason) Ptr() *SubsidyPayReceiptFailReason {
- return &e
- }
- // Enums of SubsidyPayReceiptFailReason
- const (
- SUBSIDYPAYRECEIPTFAILREASON_PAY_RECEIPT_INSUFFICIENT_BALANCE SubsidyPayReceiptFailReason = "PAY_RECEIPT_INSUFFICIENT_BALANCE"
- SUBSIDYPAYRECEIPTFAILREASON_PAY_RECEIPT_NOT_INCOMESPLIT_ORDER SubsidyPayReceiptFailReason = "PAY_RECEIPT_NOT_INCOMESPLIT_ORDER"
- SUBSIDYPAYRECEIPTFAILREASON_PAY_RECEIPT_EXCEED_SUBSIDY_AMOUNT_QUOTA SubsidyPayReceiptFailReason = "PAY_RECEIPT_EXCEED_SUBSIDY_AMOUNT_QUOTA"
- SUBSIDYPAYRECEIPTFAILREASON_PAY_RECEIPT_EXCEED_SUBSIDY_COUNT_QUOTA SubsidyPayReceiptFailReason = "PAY_RECEIPT_EXCEED_SUBSIDY_COUNT_QUOTA"
- SUBSIDYPAYRECEIPTFAILREASON_PAY_RECEIPT_OTHER SubsidyPayReceiptFailReason = "PAY_RECEIPT_OTHER"
- )
- // SubsidyPayReceiptListResponse
- type SubsidyPayReceiptListResponse struct {
- // 如果这张券发生过补差付款,会有补差单据信息返回
- PayReceiptList []SubsidyPayReceipt `json:"pay_receipt_list,omitempty"`
- }
- func (o SubsidyPayReceiptListResponse) MarshalJSON() ([]byte, error) {
- toSerialize := map[string]interface{}{}
- if o.PayReceiptList != nil {
- toSerialize["pay_receipt_list"] = o.PayReceiptList
- }
- return json.Marshal(toSerialize)
- }
- func (o SubsidyPayReceiptListResponse) String() string {
- var ret string
- ret += fmt.Sprintf("PayReceiptList:%v", o.PayReceiptList)
- return fmt.Sprintf("SubsidyPayReceiptListResponse{%s}", ret)
- }
- func (o SubsidyPayReceiptListResponse) Clone() *SubsidyPayReceiptListResponse {
- ret := SubsidyPayReceiptListResponse{}
- if o.PayReceiptList != nil {
- ret.PayReceiptList = make([]SubsidyPayReceipt, len(o.PayReceiptList))
- for i, item := range o.PayReceiptList {
- ret.PayReceiptList[i] = *item.Clone()
- }
- }
- return &ret
- }
- // SubsidyPayReceiptStatus
- type SubsidyPayReceiptStatus string
- func (e SubsidyPayReceiptStatus) Ptr() *SubsidyPayReceiptStatus {
- return &e
- }
- // Enums of SubsidyPayReceiptStatus
- const (
- SUBSIDYPAYRECEIPTSTATUS_PAY_RECEIPT_UNKNOWN SubsidyPayReceiptStatus = "PAY_RECEIPT_UNKNOWN"
- SUBSIDYPAYRECEIPTSTATUS_PAY_RECEIPT_ACCEPTED SubsidyPayReceiptStatus = "PAY_RECEIPT_ACCEPTED"
- SUBSIDYPAYRECEIPTSTATUS_PAY_RECEIPT_SUCCESS SubsidyPayReceiptStatus = "PAY_RECEIPT_SUCCESS"
- SUBSIDYPAYRECEIPTSTATUS_PAY_RECEIPT_FAIL SubsidyPayReceiptStatus = "PAY_RECEIPT_FAIL"
- SUBSIDYPAYRECEIPTSTATUS_PAY_RECEIPT_RETURNING SubsidyPayReceiptStatus = "PAY_RECEIPT_RETURNING"
- SUBSIDYPAYRECEIPTSTATUS_PAY_RECEIPT_PARTIAL_RETURN SubsidyPayReceiptStatus = "PAY_RECEIPT_PARTIAL_RETURN"
- SUBSIDYPAYRECEIPTSTATUS_PAY_RECEIPT_FULL_RETURN SubsidyPayReceiptStatus = "PAY_RECEIPT_FULL_RETURN"
- )
- // SubsidyPayRequest
- type SubsidyPayRequest struct {
- // 由微信支付生成,调用创建商家券API成功时返回的唯一批次ID 仅支持“满减券”和“折扣券”的批次,“换购券”批次不支持
- StockId *string `json:"stock_id"`
- // 券的唯一标识。 在WECHATPAY\\_MODE的券code模式下,商家券code是由微信支付生成的唯一ID; 在MERCHANT\\_UPLOAD、MERCHANT\\_API的券code模式下,商家券code是由商户上传或指定,在批次下保证唯一;
- CouponCode *string `json:"coupon_code"`
- // 微信支付下单支付成功返回的订单号
- TransactionId *string `json:"transaction_id"`
- // 营销补差扣款商户号 注:补差扣款商户号 = 制券商户号 或 补差扣款商户号 = 归属商户号
- PayerMerchant *string `json:"payer_merchant"`
- // 营销补差入账商户号 注:补差入账商户号 = 券归属商户号 或者和 券归属商户号有连锁品牌关系
- PayeeMerchant *string `json:"payee_merchant"`
- // 单位为分,单笔订单补差金额不得超过券的优惠金额,最高补差金额为5000元 > 券的优惠金额定义: 满减券:满减金额即为优惠金额 折扣券:优惠金额 = 微信支付订单金额 ÷ 折扣比例 × (1 - 折扣比例) 换购券:不支持
- Amount *int64 `json:"amount"`
- // 付款备注描述,查询的时候原样带回
- Description *string `json:"description"`
- // 商户侧需保证唯一性,可包含英文字母,数字,|,_,*,-等内容,不允许出现其他不合法符号
- OutSubsidyNo *string `json:"out_subsidy_no"`
- }
- func (o SubsidyPayRequest) MarshalJSON() ([]byte, error) {
- toSerialize := map[string]interface{}{}
- if o.StockId == nil {
- return nil, fmt.Errorf("field `StockId` is required and must be specified in SubsidyPayRequest")
- }
- toSerialize["stock_id"] = o.StockId
- if o.CouponCode == nil {
- return nil, fmt.Errorf("field `CouponCode` is required and must be specified in SubsidyPayRequest")
- }
- toSerialize["coupon_code"] = o.CouponCode
- if o.TransactionId == nil {
- return nil, fmt.Errorf("field `TransactionId` is required and must be specified in SubsidyPayRequest")
- }
- toSerialize["transaction_id"] = o.TransactionId
- if o.PayerMerchant == nil {
- return nil, fmt.Errorf("field `PayerMerchant` is required and must be specified in SubsidyPayRequest")
- }
- toSerialize["payer_merchant"] = o.PayerMerchant
- if o.PayeeMerchant == nil {
- return nil, fmt.Errorf("field `PayeeMerchant` is required and must be specified in SubsidyPayRequest")
- }
- toSerialize["payee_merchant"] = o.PayeeMerchant
- if o.Amount == nil {
- return nil, fmt.Errorf("field `Amount` is required and must be specified in SubsidyPayRequest")
- }
- toSerialize["amount"] = o.Amount
- if o.Description == nil {
- return nil, fmt.Errorf("field `Description` is required and must be specified in SubsidyPayRequest")
- }
- toSerialize["description"] = o.Description
- if o.OutSubsidyNo == nil {
- return nil, fmt.Errorf("field `OutSubsidyNo` is required and must be specified in SubsidyPayRequest")
- }
- toSerialize["out_subsidy_no"] = o.OutSubsidyNo
- return json.Marshal(toSerialize)
- }
- func (o SubsidyPayRequest) String() string {
- var ret string
- if o.StockId == nil {
- ret += "StockId:<nil>, "
- } else {
- ret += fmt.Sprintf("StockId:%v, ", *o.StockId)
- }
- if o.CouponCode == nil {
- ret += "CouponCode:<nil>, "
- } else {
- ret += fmt.Sprintf("CouponCode:%v, ", *o.CouponCode)
- }
- if o.TransactionId == nil {
- ret += "TransactionId:<nil>, "
- } else {
- ret += fmt.Sprintf("TransactionId:%v, ", *o.TransactionId)
- }
- if o.PayerMerchant == nil {
- ret += "PayerMerchant:<nil>, "
- } else {
- ret += fmt.Sprintf("PayerMerchant:%v, ", *o.PayerMerchant)
- }
- if o.PayeeMerchant == nil {
- ret += "PayeeMerchant:<nil>, "
- } else {
- ret += fmt.Sprintf("PayeeMerchant:%v, ", *o.PayeeMerchant)
- }
- if o.Amount == nil {
- ret += "Amount:<nil>, "
- } else {
- ret += fmt.Sprintf("Amount:%v, ", *o.Amount)
- }
- if o.Description == nil {
- ret += "Description:<nil>, "
- } else {
- ret += fmt.Sprintf("Description:%v, ", *o.Description)
- }
- if o.OutSubsidyNo == nil {
- ret += "OutSubsidyNo:<nil>"
- } else {
- ret += fmt.Sprintf("OutSubsidyNo:%v", *o.OutSubsidyNo)
- }
- return fmt.Sprintf("SubsidyPayRequest{%s}", ret)
- }
- func (o SubsidyPayRequest) Clone() *SubsidyPayRequest {
- ret := SubsidyPayRequest{}
- if o.StockId != nil {
- ret.StockId = new(string)
- *ret.StockId = *o.StockId
- }
- if o.CouponCode != nil {
- ret.CouponCode = new(string)
- *ret.CouponCode = *o.CouponCode
- }
- if o.TransactionId != nil {
- ret.TransactionId = new(string)
- *ret.TransactionId = *o.TransactionId
- }
- if o.PayerMerchant != nil {
- ret.PayerMerchant = new(string)
- *ret.PayerMerchant = *o.PayerMerchant
- }
- if o.PayeeMerchant != nil {
- ret.PayeeMerchant = new(string)
- *ret.PayeeMerchant = *o.PayeeMerchant
- }
- if o.Amount != nil {
- ret.Amount = new(int64)
- *ret.Amount = *o.Amount
- }
- if o.Description != nil {
- ret.Description = new(string)
- *ret.Description = *o.Description
- }
- if o.OutSubsidyNo != nil {
- ret.OutSubsidyNo = new(string)
- *ret.OutSubsidyNo = *o.OutSubsidyNo
- }
- return &ret
- }
- // SubsidyReturnReceipt
- type SubsidyReturnReceipt struct {
- // 补差回退唯一单号,由微信支付生成,仅在补差回退成功后有返回
- SubsidyReturnReceiptId *string `json:"subsidy_return_receipt_id,omitempty"`
- // 由微信支付生成,调用创建商家券API成功时返回的唯一批次ID
- StockId *string `json:"stock_id"`
- // 券的唯一标识
- CouponCode *string `json:"coupon_code"`
- // 微信支付下单支付成功返回的订单号
- TransactionId *string `json:"transaction_id"`
- // 微信支付退款单号
- RefundId *string `json:"refund_id"`
- // 原营销补差扣款商户号,即回退资金收款商户号
- PayerMerchant *string `json:"payer_merchant"`
- // 原营销补差入账商户号,即回退资金扣款商户号
- PayeeMerchant *string `json:"payee_merchant"`
- // 本次补差回退金额,单位为分。单个券code回退总金额不能超过补差金额
- Amount *int64 `json:"amount"`
- // 回退备注描述,查询的时候原样带回
- Description *string `json:"description"`
- // 补差付款单据状态
- Status *SubsidyReturnReceiptStatus `json:"status"`
- // 仅在补差回退失败时,返回告知对应失败的原因
- FailReason *SubsidyReturnReceiptFailReason `json:"fail_reason,omitempty"`
- // 仅在补差回退成功时,返回完成时间
- ReturnDoneTime *time.Time `json:"return_done_time,omitempty"`
- // 此次补差回退操作对应的补差付款单号
- SubsidyReceiptId *string `json:"subsidy_receipt_id"`
- // 商户侧需保证唯一性。可包含英文字母,数字,|,_,*,-等内容,不允许出现其他不合法符号
- OutSubsidyReturnNo *string `json:"out_subsidy_return_no"`
- // 补差回退单据创建时间
- ReturnCreateTime *time.Time `json:"return_create_time,omitempty"`
- }
- func (o SubsidyReturnReceipt) MarshalJSON() ([]byte, error) {
- toSerialize := map[string]interface{}{}
- if o.SubsidyReturnReceiptId != nil {
- toSerialize["subsidy_return_receipt_id"] = o.SubsidyReturnReceiptId
- }
- if o.StockId == nil {
- return nil, fmt.Errorf("field `StockId` is required and must be specified in SubsidyReturnReceipt")
- }
- toSerialize["stock_id"] = o.StockId
- if o.CouponCode == nil {
- return nil, fmt.Errorf("field `CouponCode` is required and must be specified in SubsidyReturnReceipt")
- }
- toSerialize["coupon_code"] = o.CouponCode
- if o.TransactionId == nil {
- return nil, fmt.Errorf("field `TransactionId` is required and must be specified in SubsidyReturnReceipt")
- }
- toSerialize["transaction_id"] = o.TransactionId
- if o.RefundId == nil {
- return nil, fmt.Errorf("field `RefundId` is required and must be specified in SubsidyReturnReceipt")
- }
- toSerialize["refund_id"] = o.RefundId
- if o.PayerMerchant == nil {
- return nil, fmt.Errorf("field `PayerMerchant` is required and must be specified in SubsidyReturnReceipt")
- }
- toSerialize["payer_merchant"] = o.PayerMerchant
- if o.PayeeMerchant == nil {
- return nil, fmt.Errorf("field `PayeeMerchant` is required and must be specified in SubsidyReturnReceipt")
- }
- toSerialize["payee_merchant"] = o.PayeeMerchant
- if o.Amount == nil {
- return nil, fmt.Errorf("field `Amount` is required and must be specified in SubsidyReturnReceipt")
- }
- toSerialize["amount"] = o.Amount
- if o.Description == nil {
- return nil, fmt.Errorf("field `Description` is required and must be specified in SubsidyReturnReceipt")
- }
- toSerialize["description"] = o.Description
- if o.Status == nil {
- return nil, fmt.Errorf("field `Status` is required and must be specified in SubsidyReturnReceipt")
- }
- toSerialize["status"] = o.Status
- if o.FailReason != nil {
- toSerialize["fail_reason"] = o.FailReason
- }
- if o.ReturnDoneTime != nil {
- toSerialize["return_done_time"] = o.ReturnDoneTime.Format(time.RFC3339)
- }
- if o.SubsidyReceiptId == nil {
- return nil, fmt.Errorf("field `SubsidyReceiptId` is required and must be specified in SubsidyReturnReceipt")
- }
- toSerialize["subsidy_receipt_id"] = o.SubsidyReceiptId
- if o.OutSubsidyReturnNo == nil {
- return nil, fmt.Errorf("field `OutSubsidyReturnNo` is required and must be specified in SubsidyReturnReceipt")
- }
- toSerialize["out_subsidy_return_no"] = o.OutSubsidyReturnNo
- if o.ReturnCreateTime != nil {
- toSerialize["return_create_time"] = o.ReturnCreateTime.Format(time.RFC3339)
- }
- return json.Marshal(toSerialize)
- }
- func (o SubsidyReturnReceipt) String() string {
- var ret string
- if o.SubsidyReturnReceiptId == nil {
- ret += "SubsidyReturnReceiptId:<nil>, "
- } else {
- ret += fmt.Sprintf("SubsidyReturnReceiptId:%v, ", *o.SubsidyReturnReceiptId)
- }
- if o.StockId == nil {
- ret += "StockId:<nil>, "
- } else {
- ret += fmt.Sprintf("StockId:%v, ", *o.StockId)
- }
- if o.CouponCode == nil {
- ret += "CouponCode:<nil>, "
- } else {
- ret += fmt.Sprintf("CouponCode:%v, ", *o.CouponCode)
- }
- if o.TransactionId == nil {
- ret += "TransactionId:<nil>, "
- } else {
- ret += fmt.Sprintf("TransactionId:%v, ", *o.TransactionId)
- }
- if o.RefundId == nil {
- ret += "RefundId:<nil>, "
- } else {
- ret += fmt.Sprintf("RefundId:%v, ", *o.RefundId)
- }
- if o.PayerMerchant == nil {
- ret += "PayerMerchant:<nil>, "
- } else {
- ret += fmt.Sprintf("PayerMerchant:%v, ", *o.PayerMerchant)
- }
- if o.PayeeMerchant == nil {
- ret += "PayeeMerchant:<nil>, "
- } else {
- ret += fmt.Sprintf("PayeeMerchant:%v, ", *o.PayeeMerchant)
- }
- if o.Amount == nil {
- ret += "Amount:<nil>, "
- } else {
- ret += fmt.Sprintf("Amount:%v, ", *o.Amount)
- }
- if o.Description == nil {
- ret += "Description:<nil>, "
- } else {
- ret += fmt.Sprintf("Description:%v, ", *o.Description)
- }
- if o.Status == nil {
- ret += "Status:<nil>, "
- } else {
- ret += fmt.Sprintf("Status:%v, ", *o.Status)
- }
- if o.FailReason == nil {
- ret += "FailReason:<nil>, "
- } else {
- ret += fmt.Sprintf("FailReason:%v, ", *o.FailReason)
- }
- if o.ReturnDoneTime == nil {
- ret += "ReturnDoneTime:<nil>, "
- } else {
- ret += fmt.Sprintf("ReturnDoneTime:%v, ", *o.ReturnDoneTime)
- }
- if o.SubsidyReceiptId == nil {
- ret += "SubsidyReceiptId:<nil>, "
- } else {
- ret += fmt.Sprintf("SubsidyReceiptId:%v, ", *o.SubsidyReceiptId)
- }
- if o.OutSubsidyReturnNo == nil {
- ret += "OutSubsidyReturnNo:<nil>, "
- } else {
- ret += fmt.Sprintf("OutSubsidyReturnNo:%v, ", *o.OutSubsidyReturnNo)
- }
- if o.ReturnCreateTime == nil {
- ret += "ReturnCreateTime:<nil>"
- } else {
- ret += fmt.Sprintf("ReturnCreateTime:%v", *o.ReturnCreateTime)
- }
- return fmt.Sprintf("SubsidyReturnReceipt{%s}", ret)
- }
- func (o SubsidyReturnReceipt) Clone() *SubsidyReturnReceipt {
- ret := SubsidyReturnReceipt{}
- if o.SubsidyReturnReceiptId != nil {
- ret.SubsidyReturnReceiptId = new(string)
- *ret.SubsidyReturnReceiptId = *o.SubsidyReturnReceiptId
- }
- if o.StockId != nil {
- ret.StockId = new(string)
- *ret.StockId = *o.StockId
- }
- if o.CouponCode != nil {
- ret.CouponCode = new(string)
- *ret.CouponCode = *o.CouponCode
- }
- if o.TransactionId != nil {
- ret.TransactionId = new(string)
- *ret.TransactionId = *o.TransactionId
- }
- if o.RefundId != nil {
- ret.RefundId = new(string)
- *ret.RefundId = *o.RefundId
- }
- if o.PayerMerchant != nil {
- ret.PayerMerchant = new(string)
- *ret.PayerMerchant = *o.PayerMerchant
- }
- if o.PayeeMerchant != nil {
- ret.PayeeMerchant = new(string)
- *ret.PayeeMerchant = *o.PayeeMerchant
- }
- if o.Amount != nil {
- ret.Amount = new(int64)
- *ret.Amount = *o.Amount
- }
- if o.Description != nil {
- ret.Description = new(string)
- *ret.Description = *o.Description
- }
- if o.Status != nil {
- ret.Status = new(SubsidyReturnReceiptStatus)
- *ret.Status = *o.Status
- }
- if o.FailReason != nil {
- ret.FailReason = new(SubsidyReturnReceiptFailReason)
- *ret.FailReason = *o.FailReason
- }
- if o.ReturnDoneTime != nil {
- ret.ReturnDoneTime = new(time.Time)
- *ret.ReturnDoneTime = *o.ReturnDoneTime
- }
- if o.SubsidyReceiptId != nil {
- ret.SubsidyReceiptId = new(string)
- *ret.SubsidyReceiptId = *o.SubsidyReceiptId
- }
- if o.OutSubsidyReturnNo != nil {
- ret.OutSubsidyReturnNo = new(string)
- *ret.OutSubsidyReturnNo = *o.OutSubsidyReturnNo
- }
- if o.ReturnCreateTime != nil {
- ret.ReturnCreateTime = new(time.Time)
- *ret.ReturnCreateTime = *o.ReturnCreateTime
- }
- return &ret
- }
- // SubsidyReturnReceiptFailReason
- type SubsidyReturnReceiptFailReason string
- func (e SubsidyReturnReceiptFailReason) Ptr() *SubsidyReturnReceiptFailReason {
- return &e
- }
- // Enums of SubsidyReturnReceiptFailReason
- const (
- SUBSIDYRETURNRECEIPTFAILREASON_RETURN_RECEIPT_INSUFFICIENT_BALANCE SubsidyReturnReceiptFailReason = "RETURN_RECEIPT_INSUFFICIENT_BALANCE"
- SUBSIDYRETURNRECEIPTFAILREASON_RETURN_RECEIPT_OTHER SubsidyReturnReceiptFailReason = "RETURN_RECEIPT_OTHER"
- )
- // SubsidyReturnReceiptStatus
- type SubsidyReturnReceiptStatus string
- func (e SubsidyReturnReceiptStatus) Ptr() *SubsidyReturnReceiptStatus {
- return &e
- }
- // Enums of SubsidyReturnReceiptStatus
- const (
- SUBSIDYRETURNRECEIPTSTATUS_RETURN_RECEIPT_UNKNOWN SubsidyReturnReceiptStatus = "RETURN_RECEIPT_UNKNOWN"
- SUBSIDYRETURNRECEIPTSTATUS_RETURN_RECEIPT_ACCEPTED SubsidyReturnReceiptStatus = "RETURN_RECEIPT_ACCEPTED"
- SUBSIDYRETURNRECEIPTSTATUS_RETURN_RECEIPT_SUCCESS SubsidyReturnReceiptStatus = "RETURN_RECEIPT_SUCCESS"
- SUBSIDYRETURNRECEIPTSTATUS_RETURN_RECEIPT_FAIL SubsidyReturnReceiptStatus = "RETURN_RECEIPT_FAIL"
- )
- // SubsidyReturnRequest
- type SubsidyReturnRequest struct {
- // 由微信支付生成,调用创建商家券API成功时返回的唯一批次ID 仅支持“满减券”和“折扣券”的批次,“换购券”批次不支持
- StockId *string `json:"stock_id"`
- // 券的唯一标识。 在WECHATPAY\\_MODE的券code模式下,商家券code是由微信支付生成的唯一ID; 在MERCHANT\\_UPLOAD、MERCHANT\\_API的券code模式下,商家券code是由商户上传或指定,在批次下保证唯一;
- CouponCode *string `json:"coupon_code"`
- // 微信支付下单支付成功返回的订单号
- TransactionId *string `json:"transaction_id"`
- // 微信支付退款单号
- RefundId *string `json:"refund_id"`
- // 原营销补差扣款商户号,即回退资金收款商户号
- PayerMerchant *string `json:"payer_merchant"`
- // 原营销补差入账商户号,即回退资金扣款商户号
- PayeeMerchant *string `json:"payee_merchant"`
- // 本次补差回退金额,单位为分。单个券Code回退总金额不能超过补差金额
- Amount *int64 `json:"amount"`
- // 回退备注描述,查询的时候原样带回
- Description *string `json:"description"`
- // 商户侧需保证唯一性,可包含英文字母,数字,|,_,*,-等内容,不允许出现其他不合法符号
- OutSubsidyReturnNo *string `json:"out_subsidy_return_no"`
- }
- func (o SubsidyReturnRequest) MarshalJSON() ([]byte, error) {
- toSerialize := map[string]interface{}{}
- if o.StockId == nil {
- return nil, fmt.Errorf("field `StockId` is required and must be specified in SubsidyReturnRequest")
- }
- toSerialize["stock_id"] = o.StockId
- if o.CouponCode == nil {
- return nil, fmt.Errorf("field `CouponCode` is required and must be specified in SubsidyReturnRequest")
- }
- toSerialize["coupon_code"] = o.CouponCode
- if o.TransactionId == nil {
- return nil, fmt.Errorf("field `TransactionId` is required and must be specified in SubsidyReturnRequest")
- }
- toSerialize["transaction_id"] = o.TransactionId
- if o.RefundId == nil {
- return nil, fmt.Errorf("field `RefundId` is required and must be specified in SubsidyReturnRequest")
- }
- toSerialize["refund_id"] = o.RefundId
- if o.PayerMerchant == nil {
- return nil, fmt.Errorf("field `PayerMerchant` is required and must be specified in SubsidyReturnRequest")
- }
- toSerialize["payer_merchant"] = o.PayerMerchant
- if o.PayeeMerchant == nil {
- return nil, fmt.Errorf("field `PayeeMerchant` is required and must be specified in SubsidyReturnRequest")
- }
- toSerialize["payee_merchant"] = o.PayeeMerchant
- if o.Amount == nil {
- return nil, fmt.Errorf("field `Amount` is required and must be specified in SubsidyReturnRequest")
- }
- toSerialize["amount"] = o.Amount
- if o.Description == nil {
- return nil, fmt.Errorf("field `Description` is required and must be specified in SubsidyReturnRequest")
- }
- toSerialize["description"] = o.Description
- if o.OutSubsidyReturnNo == nil {
- return nil, fmt.Errorf("field `OutSubsidyReturnNo` is required and must be specified in SubsidyReturnRequest")
- }
- toSerialize["out_subsidy_return_no"] = o.OutSubsidyReturnNo
- return json.Marshal(toSerialize)
- }
- func (o SubsidyReturnRequest) String() string {
- var ret string
- if o.StockId == nil {
- ret += "StockId:<nil>, "
- } else {
- ret += fmt.Sprintf("StockId:%v, ", *o.StockId)
- }
- if o.CouponCode == nil {
- ret += "CouponCode:<nil>, "
- } else {
- ret += fmt.Sprintf("CouponCode:%v, ", *o.CouponCode)
- }
- if o.TransactionId == nil {
- ret += "TransactionId:<nil>, "
- } else {
- ret += fmt.Sprintf("TransactionId:%v, ", *o.TransactionId)
- }
- if o.RefundId == nil {
- ret += "RefundId:<nil>, "
- } else {
- ret += fmt.Sprintf("RefundId:%v, ", *o.RefundId)
- }
- if o.PayerMerchant == nil {
- ret += "PayerMerchant:<nil>, "
- } else {
- ret += fmt.Sprintf("PayerMerchant:%v, ", *o.PayerMerchant)
- }
- if o.PayeeMerchant == nil {
- ret += "PayeeMerchant:<nil>, "
- } else {
- ret += fmt.Sprintf("PayeeMerchant:%v, ", *o.PayeeMerchant)
- }
- if o.Amount == nil {
- ret += "Amount:<nil>, "
- } else {
- ret += fmt.Sprintf("Amount:%v, ", *o.Amount)
- }
- if o.Description == nil {
- ret += "Description:<nil>, "
- } else {
- ret += fmt.Sprintf("Description:%v, ", *o.Description)
- }
- if o.OutSubsidyReturnNo == nil {
- ret += "OutSubsidyReturnNo:<nil>"
- } else {
- ret += fmt.Sprintf("OutSubsidyReturnNo:%v", *o.OutSubsidyReturnNo)
- }
- return fmt.Sprintf("SubsidyReturnRequest{%s}", ret)
- }
- func (o SubsidyReturnRequest) Clone() *SubsidyReturnRequest {
- ret := SubsidyReturnRequest{}
- if o.StockId != nil {
- ret.StockId = new(string)
- *ret.StockId = *o.StockId
- }
- if o.CouponCode != nil {
- ret.CouponCode = new(string)
- *ret.CouponCode = *o.CouponCode
- }
- if o.TransactionId != nil {
- ret.TransactionId = new(string)
- *ret.TransactionId = *o.TransactionId
- }
- if o.RefundId != nil {
- ret.RefundId = new(string)
- *ret.RefundId = *o.RefundId
- }
- if o.PayerMerchant != nil {
- ret.PayerMerchant = new(string)
- *ret.PayerMerchant = *o.PayerMerchant
- }
- if o.PayeeMerchant != nil {
- ret.PayeeMerchant = new(string)
- *ret.PayeeMerchant = *o.PayeeMerchant
- }
- if o.Amount != nil {
- ret.Amount = new(int64)
- *ret.Amount = *o.Amount
- }
- if o.Description != nil {
- ret.Description = new(string)
- *ret.Description = *o.Description
- }
- if o.OutSubsidyReturnNo != nil {
- ret.OutSubsidyReturnNo = new(string)
- *ret.OutSubsidyReturnNo = *o.OutSubsidyReturnNo
- }
- return &ret
- }
- // UploadCouponCodeBody
- type UploadCouponCodeBody struct {
- // 商户上传的券code列表;code允许包含的字符有 0-9 a-z A-Z 空格(仅含空格,不含制表符、换行符、换页符等) 中划线- 下划线_ 反斜线\\ 斜线/ 等号= 竖线|
- CouponCodeList []string `json:"coupon_code_list"`
- // 商户上传code的凭据号,商户侧需保持唯一性
- UploadRequestNo *string `json:"upload_request_no"`
- }
- func (o UploadCouponCodeBody) MarshalJSON() ([]byte, error) {
- toSerialize := map[string]interface{}{}
- if o.CouponCodeList == nil {
- return nil, fmt.Errorf("field `CouponCodeList` is required and must be specified in UploadCouponCodeBody")
- }
- toSerialize["coupon_code_list"] = o.CouponCodeList
- if o.UploadRequestNo == nil {
- return nil, fmt.Errorf("field `UploadRequestNo` is required and must be specified in UploadCouponCodeBody")
- }
- toSerialize["upload_request_no"] = o.UploadRequestNo
- return json.Marshal(toSerialize)
- }
- func (o UploadCouponCodeBody) String() string {
- var ret string
- ret += fmt.Sprintf("CouponCodeList:%v, ", o.CouponCodeList)
- if o.UploadRequestNo == nil {
- ret += "UploadRequestNo:<nil>"
- } else {
- ret += fmt.Sprintf("UploadRequestNo:%v", *o.UploadRequestNo)
- }
- return fmt.Sprintf("UploadCouponCodeBody{%s}", ret)
- }
- func (o UploadCouponCodeBody) Clone() *UploadCouponCodeBody {
- ret := UploadCouponCodeBody{}
- if o.CouponCodeList != nil {
- ret.CouponCodeList = make([]string, len(o.CouponCodeList))
- for i, item := range o.CouponCodeList {
- ret.CouponCodeList[i] = item
- }
- }
- if o.UploadRequestNo != nil {
- ret.UploadRequestNo = new(string)
- *ret.UploadRequestNo = *o.UploadRequestNo
- }
- return &ret
- }
- // UploadCouponCodeFailReason
- type UploadCouponCodeFailReason struct {
- // 商户通过API上传的券code
- CouponCode *string `json:"coupon_code"`
- // 对应券code上传失败的错误码
- Code *string `json:"code"`
- // 上传失败的错误信息描述
- Message *string `json:"message"`
- }
- func (o UploadCouponCodeFailReason) MarshalJSON() ([]byte, error) {
- toSerialize := map[string]interface{}{}
- if o.CouponCode == nil {
- return nil, fmt.Errorf("field `CouponCode` is required and must be specified in UploadCouponCodeFailReason")
- }
- toSerialize["coupon_code"] = o.CouponCode
- if o.Code == nil {
- return nil, fmt.Errorf("field `Code` is required and must be specified in UploadCouponCodeFailReason")
- }
- toSerialize["code"] = o.Code
- if o.Message == nil {
- return nil, fmt.Errorf("field `Message` is required and must be specified in UploadCouponCodeFailReason")
- }
- toSerialize["message"] = o.Message
- return json.Marshal(toSerialize)
- }
- func (o UploadCouponCodeFailReason) String() string {
- var ret string
- if o.CouponCode == nil {
- ret += "CouponCode:<nil>, "
- } else {
- ret += fmt.Sprintf("CouponCode:%v, ", *o.CouponCode)
- }
- if o.Code == nil {
- ret += "Code:<nil>, "
- } else {
- ret += fmt.Sprintf("Code:%v, ", *o.Code)
- }
- if o.Message == nil {
- ret += "Message:<nil>"
- } else {
- ret += fmt.Sprintf("Message:%v", *o.Message)
- }
- return fmt.Sprintf("UploadCouponCodeFailReason{%s}", ret)
- }
- func (o UploadCouponCodeFailReason) Clone() *UploadCouponCodeFailReason {
- ret := UploadCouponCodeFailReason{}
- if o.CouponCode != nil {
- ret.CouponCode = new(string)
- *ret.CouponCode = *o.CouponCode
- }
- if o.Code != nil {
- ret.Code = new(string)
- *ret.Code = *o.Code
- }
- if o.Message != nil {
- ret.Message = new(string)
- *ret.Message = *o.Message
- }
- return &ret
- }
- // UploadCouponCodeRequest
- type UploadCouponCodeRequest struct {
- // 商家券批次号
- StockId *string `json:"stock_id"`
- // 商户上传的券code列表;code允许包含的字符有 0-9 a-z A-Z 空格(仅含空格,不含制表符、换行符、换页符等) 中划线- 下划线_ 反斜线\\ 斜线/ 等号= 竖线|
- CouponCodeList []string `json:"coupon_code_list"`
- // 商户上传code的凭据号,商户侧需保持唯一性
- UploadRequestNo *string `json:"upload_request_no"`
- }
- func (o UploadCouponCodeRequest) MarshalJSON() ([]byte, error) {
- toSerialize := map[string]interface{}{}
- if o.StockId == nil {
- return nil, fmt.Errorf("field `StockId` is required and must be specified in UploadCouponCodeRequest")
- }
- toSerialize["stock_id"] = o.StockId
- if o.CouponCodeList == nil {
- return nil, fmt.Errorf("field `CouponCodeList` is required and must be specified in UploadCouponCodeRequest")
- }
- toSerialize["coupon_code_list"] = o.CouponCodeList
- if o.UploadRequestNo == nil {
- return nil, fmt.Errorf("field `UploadRequestNo` is required and must be specified in UploadCouponCodeRequest")
- }
- toSerialize["upload_request_no"] = o.UploadRequestNo
- return json.Marshal(toSerialize)
- }
- func (o UploadCouponCodeRequest) String() string {
- var ret string
- if o.StockId == nil {
- ret += "StockId:<nil>, "
- } else {
- ret += fmt.Sprintf("StockId:%v, ", *o.StockId)
- }
- ret += fmt.Sprintf("CouponCodeList:%v, ", o.CouponCodeList)
- if o.UploadRequestNo == nil {
- ret += "UploadRequestNo:<nil>"
- } else {
- ret += fmt.Sprintf("UploadRequestNo:%v", *o.UploadRequestNo)
- }
- return fmt.Sprintf("UploadCouponCodeRequest{%s}", ret)
- }
- func (o UploadCouponCodeRequest) Clone() *UploadCouponCodeRequest {
- ret := UploadCouponCodeRequest{}
- if o.StockId != nil {
- ret.StockId = new(string)
- *ret.StockId = *o.StockId
- }
- if o.CouponCodeList != nil {
- ret.CouponCodeList = make([]string, len(o.CouponCodeList))
- for i, item := range o.CouponCodeList {
- ret.CouponCodeList[i] = item
- }
- }
- if o.UploadRequestNo != nil {
- ret.UploadRequestNo = new(string)
- *ret.UploadRequestNo = *o.UploadRequestNo
- }
- return &ret
- }
- // UploadCouponCodeResponse
- type UploadCouponCodeResponse struct {
- // 商家券批次号
- StockId *string `json:"stock_id"`
- // 本次上传操作,去重后实际上传的code数目
- TotalCount *int64 `json:"total_count"`
- // 本次上传操作上传成功个数
- SuccessCount *int64 `json:"success_count"`
- // 本次新增上传成功的code信息。 特殊规则:单个券code长度为【1,32】,条目个数限制为【1,200】。
- SuccessCodes []string `json:"success_codes,omitempty"`
- // 上传操作完成时间,遵循[rfc3339](https://datatracker.ietf.org/doc/html/rfc3339)标准格式,格式为yyyy-MM-DDTHH:mm:ss+TIMEZONE,yyyy-MM-DD表示年月日,T出现在字符串中,表示time元素的开头,HH:mm:ss表示时分秒,TIMEZONE表示时区(+08:00表示东八区时间,领先UTC 8小时,即北京时间)。例如:2015-05-20T13:29:35+08:00表示,北京时间2015年5月20日 13点29分35秒。
- SuccessTime *string `json:"success_time"`
- // 本次上传操作上传失败的code数
- FailCount *int64 `json:"fail_count,omitempty"`
- // 本次导入失败的code信息,请参照错误信息,修改后重试
- FailCodes []UploadCouponCodeFailReason `json:"fail_codes,omitempty"`
- // 历史已存在的code列表,本次不会重复导入。 特殊规则:单个券code长度为【1,32】,条目个数限制为【1,200】。
- ExistCodes []string `json:"exist_codes,omitempty"`
- // 本次重复导入的code会被自动过滤,仅保留一个做导入,如满足要求则成功;如不满足要求,则失败;请参照报错提示修改重试。 特殊规则:单个券code长度为【1,32】,条目个数限制为【1,200】。
- DuplicateCodes []string `json:"duplicate_codes,omitempty"`
- }
- func (o UploadCouponCodeResponse) MarshalJSON() ([]byte, error) {
- toSerialize := map[string]interface{}{}
- if o.StockId == nil {
- return nil, fmt.Errorf("field `StockId` is required and must be specified in UploadCouponCodeResponse")
- }
- toSerialize["stock_id"] = o.StockId
- if o.TotalCount == nil {
- return nil, fmt.Errorf("field `TotalCount` is required and must be specified in UploadCouponCodeResponse")
- }
- toSerialize["total_count"] = o.TotalCount
- if o.SuccessCount == nil {
- return nil, fmt.Errorf("field `SuccessCount` is required and must be specified in UploadCouponCodeResponse")
- }
- toSerialize["success_count"] = o.SuccessCount
- if o.SuccessCodes != nil {
- toSerialize["success_codes"] = o.SuccessCodes
- }
- if o.SuccessTime == nil {
- return nil, fmt.Errorf("field `SuccessTime` is required and must be specified in UploadCouponCodeResponse")
- }
- toSerialize["success_time"] = o.SuccessTime
- if o.FailCount != nil {
- toSerialize["fail_count"] = o.FailCount
- }
- if o.FailCodes != nil {
- toSerialize["fail_codes"] = o.FailCodes
- }
- if o.ExistCodes != nil {
- toSerialize["exist_codes"] = o.ExistCodes
- }
- if o.DuplicateCodes != nil {
- toSerialize["duplicate_codes"] = o.DuplicateCodes
- }
- return json.Marshal(toSerialize)
- }
- func (o UploadCouponCodeResponse) String() string {
- var ret string
- if o.StockId == nil {
- ret += "StockId:<nil>, "
- } else {
- ret += fmt.Sprintf("StockId:%v, ", *o.StockId)
- }
- if o.TotalCount == nil {
- ret += "TotalCount:<nil>, "
- } else {
- ret += fmt.Sprintf("TotalCount:%v, ", *o.TotalCount)
- }
- if o.SuccessCount == nil {
- ret += "SuccessCount:<nil>, "
- } else {
- ret += fmt.Sprintf("SuccessCount:%v, ", *o.SuccessCount)
- }
- ret += fmt.Sprintf("SuccessCodes:%v, ", o.SuccessCodes)
- if o.SuccessTime == nil {
- ret += "SuccessTime:<nil>, "
- } else {
- ret += fmt.Sprintf("SuccessTime:%v, ", *o.SuccessTime)
- }
- if o.FailCount == nil {
- ret += "FailCount:<nil>, "
- } else {
- ret += fmt.Sprintf("FailCount:%v, ", *o.FailCount)
- }
- ret += fmt.Sprintf("FailCodes:%v, ", o.FailCodes)
- ret += fmt.Sprintf("ExistCodes:%v, ", o.ExistCodes)
- ret += fmt.Sprintf("DuplicateCodes:%v", o.DuplicateCodes)
- return fmt.Sprintf("UploadCouponCodeResponse{%s}", ret)
- }
- func (o UploadCouponCodeResponse) Clone() *UploadCouponCodeResponse {
- ret := UploadCouponCodeResponse{}
- if o.StockId != nil {
- ret.StockId = new(string)
- *ret.StockId = *o.StockId
- }
- if o.TotalCount != nil {
- ret.TotalCount = new(int64)
- *ret.TotalCount = *o.TotalCount
- }
- if o.SuccessCount != nil {
- ret.SuccessCount = new(int64)
- *ret.SuccessCount = *o.SuccessCount
- }
- if o.SuccessCodes != nil {
- ret.SuccessCodes = make([]string, len(o.SuccessCodes))
- for i, item := range o.SuccessCodes {
- ret.SuccessCodes[i] = item
- }
- }
- if o.SuccessTime != nil {
- ret.SuccessTime = new(string)
- *ret.SuccessTime = *o.SuccessTime
- }
- if o.FailCount != nil {
- ret.FailCount = new(int64)
- *ret.FailCount = *o.FailCount
- }
- if o.FailCodes != nil {
- ret.FailCodes = make([]UploadCouponCodeFailReason, len(o.FailCodes))
- for i, item := range o.FailCodes {
- ret.FailCodes[i] = *item.Clone()
- }
- }
- if o.ExistCodes != nil {
- ret.ExistCodes = make([]string, len(o.ExistCodes))
- for i, item := range o.ExistCodes {
- ret.ExistCodes[i] = item
- }
- }
- if o.DuplicateCodes != nil {
- ret.DuplicateCodes = make([]string, len(o.DuplicateCodes))
- for i, item := range o.DuplicateCodes {
- ret.DuplicateCodes[i] = item
- }
- }
- return &ret
- }
- // UseCouponRequest
- type UseCouponRequest struct {
- // 券的唯一标识
- CouponCode *string `json:"coupon_code"`
- // 微信为每个商家券批次分配的唯一ID,当你在创建商家券接口中的coupon\\_code\\_mode参数传值为MERCHANT\\_API或者MERCHANT\\_UPLOAD时,则核销接口中该字段必传,否则该字段可不传
- StockId *string `json:"stock_id,omitempty"`
- // 支持传入与当前调用接口商户号有绑定关系的AppID。支持小程序AppID与公众号AppID。核销接口返回的OpenID会在该传入AppID下进行计算获得。 校验规则:传入的AppID得是与调用方商户号(即请求头里面的商户号)有绑定关系的AppID或传入的AppID得是归属商户号有绑定关系的AppID
- Appid *string `json:"appid"`
- // 商户请求核销用户券的时间。 遵循[rfc3339](https://datatracker.ietf.org/doc/html/rfc3339)标准格式,格式为yyyy-MM-DDTHH:mm:ss+TIMEZONE,yyyy-MM-DD表示年月日,T出现在字符串中,表示time元素的开头,HH:mm:ss表示时分秒,TIMEZONE表示时区(+08:00表示东八区时间,领先UTC 8小时,即北京时间)。例如:2015-05-20T13:29:35+08:00表示,北京时间2015年5月20日 13点29分35秒。
- UseTime *string `json:"use_time"`
- // 每次核销请求的唯一标识,商户需保证唯一
- UseRequestNo *string `json:"use_request_no"`
- // 用户的唯一标识,做安全校验使用,非必填。 校验规则:传入的OpenID得是调用方商户号(即请求头里面的商户号)有绑定关系的AppID获取的OpenID或传入的OpenID得是归属商户号有绑定关系的AppID获取的OpenID。[获取OpenID文档](https://pay.weixin.qq.com/wiki/doc/apiv3/terms_definition/chapter1_1_3.shtml#part-3)
- Openid *string `json:"openid,omitempty"`
- }
- func (o UseCouponRequest) MarshalJSON() ([]byte, error) {
- toSerialize := map[string]interface{}{}
- if o.CouponCode == nil {
- return nil, fmt.Errorf("field `CouponCode` is required and must be specified in UseCouponRequest")
- }
- toSerialize["coupon_code"] = o.CouponCode
- if o.StockId != nil {
- toSerialize["stock_id"] = o.StockId
- }
- if o.Appid == nil {
- return nil, fmt.Errorf("field `Appid` is required and must be specified in UseCouponRequest")
- }
- toSerialize["appid"] = o.Appid
- if o.UseTime == nil {
- return nil, fmt.Errorf("field `UseTime` is required and must be specified in UseCouponRequest")
- }
- toSerialize["use_time"] = o.UseTime
- if o.UseRequestNo == nil {
- return nil, fmt.Errorf("field `UseRequestNo` is required and must be specified in UseCouponRequest")
- }
- toSerialize["use_request_no"] = o.UseRequestNo
- if o.Openid != nil {
- toSerialize["openid"] = o.Openid
- }
- return json.Marshal(toSerialize)
- }
- func (o UseCouponRequest) String() string {
- var ret string
- if o.CouponCode == nil {
- ret += "CouponCode:<nil>, "
- } else {
- ret += fmt.Sprintf("CouponCode:%v, ", *o.CouponCode)
- }
- if o.StockId == nil {
- ret += "StockId:<nil>, "
- } else {
- ret += fmt.Sprintf("StockId:%v, ", *o.StockId)
- }
- if o.Appid == nil {
- ret += "Appid:<nil>, "
- } else {
- ret += fmt.Sprintf("Appid:%v, ", *o.Appid)
- }
- if o.UseTime == nil {
- ret += "UseTime:<nil>, "
- } else {
- ret += fmt.Sprintf("UseTime:%v, ", *o.UseTime)
- }
- if o.UseRequestNo == nil {
- ret += "UseRequestNo:<nil>, "
- } else {
- ret += fmt.Sprintf("UseRequestNo:%v, ", *o.UseRequestNo)
- }
- if o.Openid == nil {
- ret += "Openid:<nil>"
- } else {
- ret += fmt.Sprintf("Openid:%v", *o.Openid)
- }
- return fmt.Sprintf("UseCouponRequest{%s}", ret)
- }
- func (o UseCouponRequest) Clone() *UseCouponRequest {
- ret := UseCouponRequest{}
- if o.CouponCode != nil {
- ret.CouponCode = new(string)
- *ret.CouponCode = *o.CouponCode
- }
- if o.StockId != nil {
- ret.StockId = new(string)
- *ret.StockId = *o.StockId
- }
- if o.Appid != nil {
- ret.Appid = new(string)
- *ret.Appid = *o.Appid
- }
- if o.UseTime != nil {
- ret.UseTime = new(string)
- *ret.UseTime = *o.UseTime
- }
- if o.UseRequestNo != nil {
- ret.UseRequestNo = new(string)
- *ret.UseRequestNo = *o.UseRequestNo
- }
- if o.Openid != nil {
- ret.Openid = new(string)
- *ret.Openid = *o.Openid
- }
- return &ret
- }
- // UseCouponResponse
- type UseCouponResponse struct {
- // 批次ID
- StockId *string `json:"stock_id"`
- // 用户在该公众号内的唯一身份标识。
- Openid *string `json:"openid"`
- // 系统成功核销券的时间,遵循[rfc3339](https://datatracker.ietf.org/doc/html/rfc3339)标准格式,格式为yyyy-MM-DDTHH:mm:ss+TIMEZONE,yyyy-MM-DD表示年月日,T出现在字符串中,表示time元素的开头,HH:mm:ss表示时分秒,TIMEZONE表示时区(+08:00表示东八区时间,领先UTC 8小时,即北京时间)。例如:2015-05-20T13:29:35+08:00表示,北京时间2015年5月20日 13点29分35秒。
- WechatpayUseTime *string `json:"wechatpay_use_time"`
- }
- func (o UseCouponResponse) MarshalJSON() ([]byte, error) {
- toSerialize := map[string]interface{}{}
- if o.StockId == nil {
- return nil, fmt.Errorf("field `StockId` is required and must be specified in UseCouponResponse")
- }
- toSerialize["stock_id"] = o.StockId
- if o.Openid == nil {
- return nil, fmt.Errorf("field `Openid` is required and must be specified in UseCouponResponse")
- }
- toSerialize["openid"] = o.Openid
- if o.WechatpayUseTime == nil {
- return nil, fmt.Errorf("field `WechatpayUseTime` is required and must be specified in UseCouponResponse")
- }
- toSerialize["wechatpay_use_time"] = o.WechatpayUseTime
- return json.Marshal(toSerialize)
- }
- func (o UseCouponResponse) String() string {
- var ret string
- if o.StockId == nil {
- ret += "StockId:<nil>, "
- } else {
- ret += fmt.Sprintf("StockId:%v, ", *o.StockId)
- }
- if o.Openid == nil {
- ret += "Openid:<nil>, "
- } else {
- ret += fmt.Sprintf("Openid:%v, ", *o.Openid)
- }
- if o.WechatpayUseTime == nil {
- ret += "WechatpayUseTime:<nil>"
- } else {
- ret += fmt.Sprintf("WechatpayUseTime:%v", *o.WechatpayUseTime)
- }
- return fmt.Sprintf("UseCouponResponse{%s}", ret)
- }
- func (o UseCouponResponse) Clone() *UseCouponResponse {
- ret := UseCouponResponse{}
- if o.StockId != nil {
- ret.StockId = new(string)
- *ret.StockId = *o.StockId
- }
- if o.Openid != nil {
- ret.Openid = new(string)
- *ret.Openid = *o.Openid
- }
- if o.WechatpayUseTime != nil {
- ret.WechatpayUseTime = new(string)
- *ret.WechatpayUseTime = *o.WechatpayUseTime
- }
- return &ret
- }
|