UNPKG

@m-nasser-m/paymob-sdk-eg

Version:

Paymob typescript SDK

1 lines 23.5 kB
var e=Object.create,t=Object.defineProperty,n=Object.getOwnPropertyDescriptor,r=Object.getOwnPropertyNames,i=Object.getPrototypeOf,a=Object.prototype.hasOwnProperty,o=(e,i,o,s)=>{if(i&&typeof i==`object`||typeof i==`function`)for(var c=r(i),l=0,u=c.length,d;l<u;l++)d=c[l],!a.call(e,d)&&d!==o&&t(e,d,{get:(e=>i[e]).bind(null,d),enumerable:!(s=n(i,d))||s.enumerable});return e},s=(n,r,a)=>(a=n==null?{}:e(i(n)),o(r||!n||!n.__esModule?t(a,`default`,{value:n,enumerable:!0}):a,n));const c=s(require(`zod`)),l=s(require(`ky`)),u=s(require(`node:crypto`)),d=1e4,ee=3,f=`https://accept.paymob.com`,te=`${f}/unifiedcheckout/?publicKey=PUBLIC_KEY_PLACEHOLDER&clientSecret=CLIENT_SECRET_PLACEHOLDER`,p={INTENTION:`v1/intention`,AUTH:`api/auth/tokens`,CREATE_PAYMENT_LINK:`api/ecommerce/payment-links`,PAYMENT_ACTIONS:{REFUND:`api/acceptance/void_refund/refund`,VOID:`api/acceptance/void_refund/void`,CAPTURE:`api/acceptance/capture`,MOTO:`api/acceptance/payments/pay`},TRANSACTION_INQUIRY:{ORDER_ID:`api/ecommerce/orders/transaction_inquiry`,TRANSACTION_ID:`api/acceptance/transactions/TRANSACTION_ID_PLACEHOLDER`,MERCHANT_ORDER_ID:`api/ecommerce/orders/transaction_inquiry`},SUBSCRIPTIONS:{CREATE_SUBSCRIPTIONS:`v1/intention`,SUSPEND:`api/acceptance/subscription-plans/SUBSCRIPTION_ID_PLACEHOLDER/suspend`,RESUME:`api/acceptance/subscriptions/SUBSCRIPTION_ID_PLACEHOLDER/resume`,CANCEL:`api/acceptance/subscriptions/SUBSCRIPTION_ID_PLACEHOLDER/cancel`,UPDATE:`api/acceptance/subscriptions/SUBSCRIPTION_ID_PLACEHOLDER`,LIST_CARDS:`api/acceptance/subscriptions/SUBSCRIPTION_ID_PLACEHOLDER/card-tokens`,CHANGE_PRIMARY_CARD:`api/acceptance/subscriptions/SUBSCRIPTION_ID_PLACEHOLDER/change-primary-card`,DELETE_SECONDARY_CARD:`api/acceptance/subscriptions/SUBSCRIPTION_ID_PLACEHOLDER/delete-card`,LIST_SUBSCRIPTION_DETAILS:`api/acceptance/subscriptions/SUBSCRIPTION_ID_PLACEHOLDER`,LIST_SUBSCRIPTIONS_RELATEDTO_TRANSACTION:`api/acceptance/subscriptions?transaction=TRANSACTION_ID_PLACEHOLDER`,LIST_LAST_TRANSACTION:`api/acceptance/subscriptions/SUBSCRIPTION_ID_PLACEHOLDER/last-transaction`,LIST_ALL_TRANSACTIONS:`api/acceptance/subscriptions/SUBSCRIPTION_ID_PLACEHOLDER/transactions`,REGISTER_WEBHOOK:`api/acceptance/subscriptions/SUBSCRIPTION_ID_PLACEHOLDER/webhooks`,PLANS:{CREATE:`api/acceptance/subscription-plans`,SUSPEND:`api/acceptance/subscription-plans/SUBSCRIPTION_PLAN_ID_PLACEHOLDER/suspend`,RESUME:`api/acceptance/subscription-plans/SUBSCRIPTION_PLAN_ID_PLACEHOLDER/resume`,UPDATE:`api/acceptance/subscription-plans/SUBSCRIPTION_PLAN_ID_PLACEHOLDER`,LIST:`api/acceptance/subscription-plans`}}};var m=class extends Error{constructor(e){super(e),this.name=`PaymobAPIError`}},ne=class extends Error{constructor(e){super(e),this.name=`ConfigurationError`}},h=class extends Error{constructor(e){super(e),this.name=`ValidationError`}};const g=e=>{let t=c.number().int();return e===void 0?t:t.min(e)},_=()=>c.number().int().positive(),v=()=>c.number().int().nonnegative(),y=()=>c.number().int().nonnegative(),b=()=>c.string().url(),x=()=>c.string().email(),S=()=>c.string().datetime(),C=c.object({apartment:c.string().optional(),first_name:c.string(),last_name:c.string(),street:c.string().optional(),building:c.string().optional(),phone_number:c.string(),city:c.string().optional(),country:c.string().optional(),email:x().optional(),floor:c.string().optional(),state:c.string().optional()}),w=c.object({name:c.string(),amount:y(),description:c.string(),quantity:_()}),T=c.array(c.union([c.number(),c.string()])).refine(e=>e.length>0,{message:`At least one payment method ID is required.`}),E=c.object({id:c.union([c.string(),g()]),created_at:S(),updated_at:S().optional()}),D=c.object({first_name:c.string().optional(),last_name:c.string().optional(),email:x().optional(),phone_number:c.string().optional()}),O=c.object({street:c.string().optional(),building:c.string().optional(),floor:c.string().optional(),apartment:c.string().optional(),city:c.string().optional(),state:c.string().optional(),country:c.string().optional(),postal_code:c.string().optional()}),k=c.record(c.string(),c.unknown()),re=c.object({amount:y(),currency:c.string(),payment_methods:T,items:c.array(w).optional(),billing_data:C,extras:c.record(c.any()).optional(),special_reference:c.string().optional(),expiration:c.number().int().positive().optional(),notification_url:c.string().url().optional(),redirection_url:c.string().url().optional()}),ie=c.object({id:c.string(),client_secret:c.string(),amount:y(),currency:c.string(),status:c.string(),created_at:S()}),ae=c.object({id:c.string(),client_secret:c.string(),amount:y(),currency:c.string(),status:c.string(),payment_method_options:c.object({card:c.object({request_three_d_secure:c.string()})}),created_at:S(),metadata:k.optional()}),oe=(e,t)=>te.replace(`CLIENT_SECRET_PLACEHOLDER`,e).replace(`PUBLIC_KEY_PLACEHOLDER`,t);var A=class{client;paymobConfig;constructor(e,t){this.client=e,this.paymobConfig=t}async createIntention(e){try{let t=re.parse(e);return await this.client.post(p.INTENTION,{body:JSON.stringify(t)}).json()}catch(e){throw e instanceof c.z.ZodError?new h(`Invalid intention request: ${e.message}`):new m(`Failed to create intention: ${e}`)}}async getPaymentUrl(e){if(!e||typeof e!=`string`)throw new h(`client_secret is required and must be a string`);if(!this.paymobConfig.PAYMOB_PUBLIC_KEY)throw new h(`PAYMOB_PUBLIC_KEY is required for payment URL generation`);return oe(e,this.paymobConfig.PAYMOB_PUBLIC_KEY)}async createIntentionAndGetUrl(e){let{client_secret:t}=await this.createIntention(e);return this.getPaymentUrl(t)}async voidTransaction(e){this.validateTransactionID(e);try{return await this.client.post(p.PAYMENT_ACTIONS.VOID,{body:JSON.stringify({transaction_id:e})}).json()}catch(t){throw new m(`Failed to void transaction ${e}: ${t}`)}}async refundTransaction(e,t){this.validateTransactionID(e),this.validateAmount(t);try{return await this.client.post(p.PAYMENT_ACTIONS.REFUND,{body:JSON.stringify({transaction_id:e,amount_cents:t})}).json()}catch(t){throw new m(`Failed to refund transaction ${e}: ${t}`)}}async captureTransaction(e,t){this.validateTransactionID(e),this.validateAmount(t);try{return await this.client.post(p.PAYMENT_ACTIONS.CAPTURE,{body:JSON.stringify({transaction_id:e,amount_cents:t})}).json()}catch(t){throw new m(`Failed to capture transaction ${e}: ${t}`)}}validateTransactionID(e){if(!e||typeof e!=`string`||e.trim()===``)throw new h(`Transaction ID is required and must be a non-empty string`)}validateAmount(e){if(typeof e!=`number`||e<=0||!Number.isInteger(e))throw new h(`Amount must be a positive integer representing cents`)}},j=class{client;paymobConfig;constructor(e,t){this.client=e,this.paymobConfig=t}},se=class{client;paymobConfig;cachedToken=null;tokenExpiryTime=null;constructor(e,t){if(!t?.PAYMOB_API_KEY)throw new ne(`PAYMOB_API_KEY is required`);this.client=e,this.paymobConfig=t}async getAccessToken(){if(this.isTokenValid())return this.cachedToken;try{let e=await this.client.post(p.AUTH,{body:JSON.stringify({api_key:this.paymobConfig.PAYMOB_API_KEY})}).json();if(!e.token)throw new m(`Invalid auth response: missing token`);return this.cachedToken=e.token,this.tokenExpiryTime=Date.now()+55*60*1e3,e.token}catch(e){throw this.cachedToken=null,this.tokenExpiryTime=null,e instanceof m?e:new m(`Authentication failed: ${e}`)}}clearCache(){this.cachedToken=null,this.tokenExpiryTime=null}isTokenValid(){return!!(this.cachedToken&&this.tokenExpiryTime&&Date.now()<this.tokenExpiryTime)}},M=class{client;paymobConfig;auth;constructor(e,t){this.client=e,this.paymobConfig=t,this.auth=new se(e,t)}async getTransactionUsingOrderID(e){this.validateOrderID(e);try{let t=await this.auth.getAccessToken();return await this.client.post(p.TRANSACTION_INQUIRY.ORDER_ID,{headers:{Authorization:`Bearer ${t}`},body:JSON.stringify({order_id:e})}).json()}catch(t){throw new m(`Failed to retrieve transaction using order ID ${e}: ${t}`)}}async getTransactionUsingTransactionID(e){this.validateTransactionID(e);try{let t=await this.auth.getAccessToken();return await this.client.get(p.TRANSACTION_INQUIRY.TRANSACTION_ID.replace(`TRANSACTION_ID_PLACEHOLDER`,e),{headers:{Authorization:`Bearer ${t}`}}).json()}catch(t){throw new m(`Failed to retrieve transaction using transaction ID ${e}: ${t}`)}}async getTransactionUsingMerchantOrderID(e){this.validateMerchantOrderID(e);try{let t=await this.auth.getAccessToken();return await this.client.post(p.TRANSACTION_INQUIRY.MERCHANT_ORDER_ID,{headers:{Authorization:`Bearer ${t}`},body:JSON.stringify({merchant_order_id:e})}).json()}catch(t){throw new m(`Failed to retrieve transaction using merchant order ID ${e}: ${t}`)}}getAuthInstance(){return this.auth}validateOrderID(e){if(!e||typeof e!=`string`&&typeof e!=`number`||typeof e==`string`&&e.trim()===``)throw new h(`Order ID is required and must be a non-empty string or number`)}validateTransactionID(e){if(!e||typeof e!=`string`||e.trim()===``)throw new h(`Transaction ID is required and must be a non-empty string`)}validateMerchantOrderID(e){if(!e||typeof e!=`string`||e.trim()===``)throw new h(`Merchant Order ID is required and must be a non-empty string`)}};const ce=(e,t={})=>l.default.create({prefixUrl:f,headers:{"Content-Type":`application/json`,Authorization:`Token ${e}`},retry:ee,timeout:d,...t}),N=c.object({id:c.number(),pending:c.boolean(),amount_cents:c.number(),success:c.boolean(),is_auth:c.boolean(),is_capture:c.boolean(),is_standalone_payment:c.boolean(),is_voided:c.boolean(),is_refunded:c.boolean(),is_3d_secure:c.boolean(),integration_id:c.number(),has_parent_transaction:c.boolean(),created_at:c.string(),currency:c.string(),error_occured:c.boolean(),order:c.object({id:c.number()}),owner:c.number(),source_data:c.object({pan:c.string(),type:c.string(),sub_type:c.string()})}),P=c.object({id:c.number(),token:c.string(),masked_pan:c.string(),merchant_id:c.number(),card_subtype:c.string(),created_at:c.string(),email:c.string(),order_id:c.string(),user_added:c.boolean(),next_payment_intention:c.string()}),le=c.object({type:c.literal(`TRANSACTION`),obj:N}),ue=c.object({type:c.literal(`TOKEN`),obj:P}),F=c.discriminatedUnion(`type`,[c.object({type:c.literal(`TRANSACTION`),obj:N}),c.object({type:c.literal(`TOKEN`),obj:P})]),I=c.object({id:c.number(),pending:c.boolean(),amount_cents:c.number(),success:c.boolean(),is_auth:c.boolean(),is_capture:c.boolean(),is_standalone_payment:c.boolean(),is_voided:c.boolean(),is_refunded:c.boolean(),is_3d_secure:c.boolean(),integration_id:c.number(),has_parent_transaction:c.boolean(),order:c.number(),created_at:c.string(),currency:c.string(),error_occured:c.boolean(),owner:c.number(),"source_data.pan":c.string(),"source_data.type":c.string(),"source_data.sub_type":c.string(),txn_response_code:c.number(),hmac:c.string()}),L=(e,t,n)=>{let r=F.parse(e),i=(0,u.createHmac)(`sha512`,n);if(r.type===`TRANSACTION`){let e=`${r.obj.amount_cents}${r.obj.created_at}${r.obj.currency}${r.obj.error_occured}${r.obj.has_parent_transaction}${r.obj.id}${r.obj.integration_id}${r.obj.is_3d_secure}${r.obj.is_auth}${r.obj.is_capture}${r.obj.is_refunded}${r.obj.is_standalone_payment}${r.obj.is_voided}${r.obj.order.id}${r.obj.owner}${r.obj.pending}${r.obj.source_data.pan}${r.obj.source_data.sub_type}${r.obj.source_data.type}${r.obj.success}`,n=i.update(e).digest(`hex`);return n===t}if(r.type===`TOKEN`){let e=`${r.obj.card_subtype}${r.obj.created_at}${r.obj.email}${r.obj.id}${r.obj.masked_pan}${r.obj.merchant_id}${r.obj.order_id}${r.obj.token}`,n=i.update(e).digest(`hex`);return n===t}return!1},R=(e,t,n)=>{let r=I.parse(e),i=(0,u.createHmac)(`sha512`,n),a=`${r.amount_cents}${r.created_at}${r.currency}${r.error_occured}${r.has_parent_transaction}${r.id}${r.integration_id}${r.is_3d_secure}${r.is_auth}${r.is_capture}${r.is_refunded}${r.is_standalone_payment}${r.is_voided}${r.order}${r.owner}${r.pending}${r[`source_data.pan`]}${r[`source_data.sub_type`]}${r[`source_data.type`]}${r.success}`,o=i.update(a).digest(`hex`);return o===t};var de=class{client;paymobConfig;constructor(e,t){this.client=e,this.paymobConfig=t}comareHMACWebhook(e,t){return L(e,t,this.paymobConfig.PAYMOB_HMAC_SECRET)}comareHMACRedirect(e,t){return R(e,t,this.paymobConfig.PAYMOB_HMAC_SECRET)}},fe=class{client;payment;transaction;subscriptions;hmac;constructor(e,t={}){this.client=ce(e.PAYMOB_SECRET_KEY,t),this.payment=new A(this.client,e),this.transaction=new M(this.client,e),this.subscriptions=new j(this.client,e),this.hmac=new de(this.client,e)}};const pe=c.object({PAYMOB_API_KEY:c.string().min(1,`API key is required`),PAYMOB_PUBLIC_KEY:c.string().min(1,`Public key is required`),PAYMOB_SECRET_KEY:c.string().min(1,`Secret key is required`),PAYMOB_NOTIFICATION_URL:c.string().min(1,`notification URL is required`).url({message:`notification URL is not a valid URL`}),PAYMOB_REDIRECTION_URL:c.string().min(1,`redirection URL is required`).url({message:`redirection URL is not a valid URL`}),PAYMOB_PAYMENT_INTEGRATION_IDS:c.string().transform(e=>e.split(`,`).map(e=>Number(e))),PAYMOB_HMAC_SECRET:c.string().min(1,`HMAC secret is required`)}),me=c.object({api_key:c.string()}),he=c.object({username:c.string(),password:c.string(),expiration:g(0).optional()}),z=c.object({id:g(),user:c.object({id:g(),username:c.string(),first_name:c.string(),last_name:c.string(),email:x()})}),ge=c.object({token:c.string(),profile:z}),_e=c.object({amount_cents:y(),payment_methods:T,email:x(),full_name:c.string(),phone_number:c.string(),description:c.string(),is_live:c.boolean().optional(),expires_at:S().optional(),reference_id:c.string().optional(),notification_url:b().optional(),redirection_url:b().optional()}),ve=c.object({client_url:b()}),B=c.enum([`7`,`15`,`30`,`90`,`180`,`365`]).transform(Number),ye=c.object({frequency:B,name:c.string(),reminder_days:v().nullable(),retrial_days:v().nullable(),plan_type:c.string(),number_of_deductions:_().nullable(),amount_cents:y(),use_transaction_amount:c.boolean(),is_active:c.boolean().optional(),integration:g(),webhook_url:b().nullable().optional()}),V=c.object({...E.shape,frequency:B,name:c.string(),reminder_days:v().nullable(),retrial_days:v().nullable(),plan_type:c.string(),number_of_deductions:_().nullable(),amount_cents:y(),use_transaction_amount:c.boolean(),is_active:c.boolean(),integration:g(),fee:c.number().nullable()}),be=c.array(V),xe=c.object({plan_id:g(),payment_token:c.string(),...D.shape,...O.shape,return_url:b().optional(),charge_failure_count:v().optional(),description:c.string().optional(),metadata:k.optional()}),Se=c.object({...E.shape,plan:V,customer_details:c.object({...D.shape}),status:c.string(),created_at:S(),updated_at:S()}),H=c.object({id:g(),created_at:S(),phones:c.array(c.string()),company_emails:c.array(x()),company_name:c.string(),state:c.string(),country:c.string(),city:c.string(),postal_code:c.string(),street:c.string()}),U=c.object({id:g(),first_name:c.string(),last_name:c.string(),street:c.string(),building:c.string(),floor:c.string(),apartment:c.string(),city:c.string(),state:c.string(),country:c.string(),email:x(),phone_number:c.string(),postal_code:c.string(),extra_description:c.string(),shipping_method:c.string(),order_id:g(),order:g()}),W=c.object({id:g(),created_at:S(),delivery_needed:c.boolean(),merchant:c.object({id:g(),created_at:S(),phones:c.array(c.string()),company_emails:c.array(x()),company_name:c.string(),state:c.string(),country:c.string(),city:c.string(),postal_code:c.string(),street:c.string()}),collector:c.unknown().nullable(),amount_cents:y(),shipping_data:U.nullable(),shipping_details:c.unknown().nullable(),currency:c.string(),is_payment_locked:c.boolean(),is_return:c.boolean(),is_cancel:c.boolean(),is_returned:c.boolean(),is_canceled:c.boolean(),merchant_order_id:c.string().nullable(),wallet_notification:c.unknown().nullable(),paid_amount_cents:y(),notify_user_with_email:c.boolean(),items:c.array(c.unknown()),order_url:c.string(),commission_fees:y(),delivery_fees_cents:y(),delivery_vat_cents:y(),payment_method:c.string(),merchant_staff_tag:c.string().nullable(),api_source:c.string(),pickup_data:c.unknown().nullable(),delivery_status:c.array(c.unknown())}),G=c.object({type:c.string(),pan:c.string(),sub_type:c.string()}),K=c.object({amount_cents:y(),currency:c.string(),reason_code:c.string()}),q=c.object({acquirer:c.string(),merchant_id:c.string(),terminal_id:c.string(),merchant_name:c.string(),merchant_city:c.string(),merchant_country:c.string(),settlement_amount:c.string(),settlement_currency:c.string(),transaction_id:c.string(),auth_code:c.string(),reference_number:c.string(),receipt_no:c.string(),batch_no:c.string(),message:c.string(),response_code:c.string(),pos_entry_mode:c.string(),card_data:c.string(),acq_response_code:c.string(),avs_acq_response_code:c.string(),eci:c.string(),cavv:c.string(),xid:c.string(),network:c.string(),card_type:c.string(),authentication_3ds:c.string(),transaction_status:c.string(),transaction_status_reason:c.string(),transaction_status_info:c.string(),transaction_status_details:c.string(),transaction_status_details_reason:c.string(),transaction_status_details_info:c.string()}),J=c.object({id:c.string(),amount:y(),currency:c.string(),merchant:c.string(),terminal:c.string(),type:c.string()}),Y=c.object({amount:y(),chargeback:K,creationTime:c.string(),currency:c.string(),id:c.string(),merchantId:c.string(),merchantOrderId:c.string(),merchantTransactionId:c.string(),status:c.string(),terminalId:c.string(),totalAuthorizedAmount:c.string(),totalCapturedAmount:c.string(),totalRefundedAmount:c.string(),transaction:J}),X=c.object({order:W,created_at:S(),transaction_processed_callback_responses:c.array(c.unknown()),currency:c.string(),source_data:G,api_source:c.string(),is_void:c.boolean(),is_refund:c.boolean(),is_capture:c.boolean(),is_standalone_payment:c.boolean(),payment_key_claims:c.unknown().nullable(),error_occured:c.boolean(),is_live:c.boolean(),other_endpoint_reference:c.unknown().nullable(),refunded_amount_cents:y(),source_id:g(),is_captured:c.boolean(),captured_amount:y(),merchant_staff_tag:c.string().nullable(),updated_at:S(),is_settled:c.boolean(),bill_balanced:c.boolean(),is_bill:c.boolean(),owner:g(),parent_transaction:c.unknown().nullable(),redirect_url:c.string().nullable(),merchant:H,merchant_external_link:c.string().nullable(),acquirer:q,terminal_id:c.unknown().nullable(),installment:c.unknown().nullable(),order_id:g(),hmac:c.string(),use_redirection:c.boolean(),rrn:c.string(),migs_order:Y,integration_id:g(),klass:c.string(),created_by:c.string(),gateway_source_data:c.unknown().nullable(),secure_hash:c.string(),avs_result_code:c.string(),avs_acq_response_code:c.string(),acs_eci:c.string()}),Z=c.object({id:g(),pending:c.boolean(),amount_cents:y(),success:c.boolean(),is_auth:c.boolean(),is_capture:c.boolean(),is_standalone_payment:c.boolean(),is_void:c.boolean(),is_refund:c.boolean(),is_voided:c.boolean(),is_refunded:c.boolean(),is_3d_secure:c.boolean(),integration_id:g(),profile_id:g(),has_parent_transaction:c.boolean(),order:W,created_at:S(),transaction_processed_callback_responses:c.array(c.unknown()),currency:c.string(),source_data:G,api_source:c.string(),terminal_id:c.unknown().nullable(),merchant_commission:g(),installment:c.unknown().nullable(),error_occured:c.boolean(),refunded_amount_cents:y(),captured_amount:y(),updated_at:S(),is_settled:c.boolean(),bill_balanced:c.boolean(),is_bill:c.boolean(),owner:g(),parent_transaction:g()}),Ce=c.object({transaction_id:c.string(),amount_cents:_(),reason:c.string().optional()}),we=c.object({transaction_id:c.string(),amount_cents:_()}),Te=c.object({transaction_id:c.string()}),Ee=c.object({transaction_id:c.string()}),De=c.object({...X.shape,transaction_id:c.string(),parent_id:c.string()}),Oe=c.object({...X.shape,transaction_id:c.string(),parent_id:c.string()}),Q=c.object({...X.shape,transaction_id:c.string(),parent_id:c.string()}),ke=c.object({...Y.shape,acceptPartialAmount:c.boolean(),authenticationStatus:c.string(),status:c.string(),totalAuthorizedAmount:c.union([g(),c.null()]).nullable(),totalCapturedAmount:c.union([g(),c.null()]).nullable()}),Ae=c.object({...J.shape,authenticationStatus:c.string(),authorizationResponse:c.object({stan:c.string(),authorizationCode:c.string(),responseCode:c.string(),responseMessage:c.string()}),receipt:c.string(),type:c.literal(`PAYMENT`),status:c.string()}),je=c.object({...X.shape,transaction_id:c.string(),migs_order:ke,migs_transaction:Ae}),Me=c.object({apartment:c.string(),email:x(),floor:c.string(),first_name:c.string(),street:c.string(),building:c.string(),phone_number:c.string(),shipping_method:c.string(),postal_code:c.string(),city:c.string(),country:c.string(),last_name:c.string(),state:c.string()}),$=c.object({user_id:g(),amount_cents:y(),currency:c.string(),integration_id:g(),order_id:g(),billing_data:Me,lock_order_when_paid:c.boolean(),extra:c.object({}).passthrough(),notification_url:c.string(),redirection_url:c.string(),single_payment_attempt:c.boolean(),exp:g(),pmk_ip:c.string()}),Ne=c.object({...Z.shape,is_refund:c.literal(!0),data:De}),Pe=c.object({...Z.shape,is_capture:c.literal(!0),is_void:c.literal(!1),is_refund:c.literal(!1),data:Oe}),Fe=c.object({...Z.shape,is_void:c.literal(!0),is_refund:c.literal(!1),data:Q}),Ie=c.object({...Z.shape,is_standalone_payment:c.boolean(),has_parent_transaction:c.boolean(),data:je,payment_key_claims:$.optional(),parent_transaction:c.string().optional(),unique_ref:c.string()});exports.AcquirerSchema=q,exports.AddressSchema=O,exports.AuthApiKeyRequestSchema=me,exports.AuthProfileSchema=z,exports.AuthResponseSchema=ge,exports.AuthUsernamePasswordRequestSchema=he,exports.BaseMigsOrderSchema=Y,exports.BaseMigsTransactionSchema=J,exports.BaseResourceSchema=E,exports.BaseTransactionDataSchema=X,exports.BaseTransactionResponseSchema=Z,exports.BillingDataClaimsSchema=Me,exports.BillingDataSchema=C,exports.CaptureRequestSchema=we,exports.CaptureResponseSchema=Pe,exports.CaptureTransactionDataSchema=Oe,exports.ChargebackSchema=K,exports.CreateIntentionRequestSchema=re,exports.CreateIntentionResponseSchema=ie,exports.CreateQuickLinkRequestSchema=_e,exports.CreateQuickLinkResponseSchema=ve,exports.CreateSubscriptionPlanRequestSchema=ye,exports.CreateSubscriptionRequestSchema=xe,exports.CustomerSchema=D,exports.IntentionSchema=ae,exports.ItemSchema=w,exports.ListSubscriptionPlansResponseSchema=be,exports.MerchantSchema=H,exports.MetadataSchema=k,exports.OrderSchema=W,exports.Payment=A,exports.PaymentKeyClaimsSchema=$,exports.PaymentMethodsSchema=T,exports.PaymentTransactionDataSchema=je,exports.PaymobSDK=fe,exports.RefundRequestSchema=Ce,exports.RefundResponseSchema=Ne,exports.RefundTransactionDataSchema=De,exports.ShippingDataSchema=U,exports.SourceDataSchema=G,exports.SubscriptionFrequencySchema=B,exports.SubscriptionPlanSchema=V,exports.SubscriptionSchema=Se,exports.Subscriptions=j,exports.TransactionInquiry=M,exports.TransactionInquiryRequestSchema=Ee,exports.TransactionResponseSchema=Ie,exports.VoidRequestSchema=Te,exports.VoidResponseSchema=Fe,exports.VoidTransactionDataSchema=Q,exports.WebhookResponseSchema=F,exports.amountCents=y,exports.compareHMACPaymentRedirect=R,exports.compareHMACWebhook=L,exports.emailValidation=x,exports.integer=g,exports.nonNegativeInteger=v,exports.paymentRedirectResponseSchema=I,exports.paymobConfigSchema=pe,exports.positiveInteger=_,exports.timestampValidation=S,exports.tokenWebhookResponseSchema=ue,exports.transactionWebhookResponseSchema=le,exports.urlValidation=b;