| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504 |
- <?php
- namespace Srmklive\PayPal\Tests\Mocks\Responses;
- use GuzzleHttp\Utils;
- trait PartnerReferrals
- {
- private function mockCreatePartnerReferralsResponse(): array
- {
- return Utils::jsonDecode('{
- "links": [
- {
- "href": "https://uri.paypal.com/v2/customer/partner-referrals/ZjcyODU4ZWYtYTA1OC00ODIwLTk2M2EtOTZkZWQ4NmQwYzI3RU12cE5xa0xMRmk1NWxFSVJIT1JlTFdSbElCbFU1Q3lhdGhESzVQcU9iRT0=",
- "rel": "self",
- "method": "GET"
- },
- {
- "href": "https://www.paypal.com/merchantsignup/partner/onboardingentry?token=ZjcyODU4ZWYtYTA1OC00ODIwLTk2M2EtOTZkZWQ4NmQwYzI3RU12cE5xa0xMRmk1NWxFSVJIT1JlTFdSbElCbFU1Q3lhdGhESzVQcU9iRT0=",
- "rel": "action_url",
- "method": "GET"
- }
- ]
- }', true);
- }
- private function mockShowReferralDataResponse(): array
- {
- return Utils::jsonDecode('{
- "partner_referral_id": "ZjcyODU4ZWYtYTA1OC00ODIwLTk2M2EtOTZkZWQ4NmQwYzI3RU12cE5xa0xMRmk1NWxFSVJIT1JlTFdSbElCbFU1Q3lhdGhESzVQcU9iRT0=",
- "submitter_payer_id": "RFYUH2QQDGUQU",
- "referral_data": {
- "individual_owners": [
- {
- "names": [
- {
- "prefix": "Mr.",
- "given_name": "John",
- "surname": "Doe",
- "middle_name": "Middle",
- "suffix": "Jr.",
- "full_name": "John Middle Doe Jr.",
- "type": "LEGAL"
- }
- ],
- "citizenship": "US",
- "addresses": [
- {
- "address_line_1": "One Washington Square",
- "address_line_2": "Apt 123",
- "admin_area_2": "San Jose",
- "admin_area_1": "CA",
- "postal_code": "95112",
- "country_code": "US",
- "type": "HOME"
- }
- ],
- "phones": [
- {
- "country_code": "1",
- "national_number": "6692468839",
- "extension_number": "1234",
- "type": "MOBILE"
- }
- ],
- "birth_details": {
- "date_of_birth": "1955-12-29"
- },
- "type": "PRIMARY"
- }
- ],
- "business_entity": {
- "business_type": {
- "type": "INDIVIDUAL",
- "subtype": "ASSO_TYPE_INCORPORATED"
- },
- "business_industry": {
- "category": "1004",
- "mcc_code": "2025",
- "subcategory": "8931"
- },
- "business_incorporation": {
- "incorporation_country_code": "US",
- "incorporation_date": "1986-12-29"
- },
- "names": [
- {
- "business_name": "Test Enterprise",
- "type": "LEGAL_NAME"
- }
- ],
- "emails": [
- {
- "type": "CUSTOMER_SERVICE",
- "email": "customerservice@example.com"
- }
- ],
- "website": "https://mystore.testenterprises.com",
- "addresses": [
- {
- "address_line_1": "One Washington Square",
- "address_line_2": "Apt 123",
- "admin_area_2": "San Jose",
- "admin_area_1": "CA",
- "postal_code": "95112",
- "country_code": "US",
- "type": "WORK"
- }
- ],
- "phones": [
- {
- "country_code": "1",
- "national_number": "6692478833",
- "extension_number": "1234",
- "type": "CUSTOMER_SERVICE"
- }
- ],
- "beneficial_owners": {
- "individual_beneficial_owners": [
- {
- "names": [
- {
- "prefix": "Mr.",
- "given_name": "John",
- "surname": "Doe",
- "middle_name": "Middle",
- "suffix": "Jr.",
- "full_name": "John Middle Doe Jr.",
- "type": "LEGAL"
- }
- ],
- "citizenship": "US",
- "addresses": [
- {
- "address_line_1": "One Washington Square",
- "address_line_2": "Apt 123",
- "admin_area_2": "San Jose",
- "admin_area_1": "CA",
- "postal_code": "95112",
- "country_code": "US",
- "type": "HOME"
- }
- ],
- "phones": [
- {
- "country_code": "1",
- "national_number": "6692468839",
- "extension_number": "1234",
- "type": "MOBILE"
- }
- ],
- "birth_details": {
- "date_of_birth": "1955-12-29"
- },
- "percentage_of_ownership": "50"
- }
- ],
- "business_beneficial_owners": [
- {
- "business_type": {
- "type": "INDIVIDUAL",
- "subtype": "ASSO_TYPE_INCORPORATED"
- },
- "business_industry": {
- "category": "1004",
- "mcc_code": "2025",
- "subcategory": "8931"
- },
- "business_incorporation": {
- "incorporation_country_code": "US",
- "incorporation_date": "1986-12-29"
- },
- "names": [
- {
- "business_name": "Test Enterprise",
- "type": "LEGAL_NAME"
- }
- ],
- "emails": [
- {
- "type": "CUSTOMER_SERVICE",
- "email": "customerservice@example.com"
- }
- ],
- "website": "https://mystore.testenterprises.com",
- "addresses": [
- {
- "address_line_1": "One Washington Square",
- "address_line_2": "Apt 123",
- "admin_area_2": "San Jose",
- "admin_area_1": "CA",
- "postal_code": "95112",
- "country_code": "US",
- "type": "WORK"
- }
- ],
- "phones": [
- {
- "country_code": "1",
- "national_number": "6692478833",
- "extension_number": "1234",
- "type": "CUSTOMER_SERVICE"
- }
- ],
- "percentage_of_ownership": "50"
- }
- ]
- },
- "office_bearers": [
- {
- "names": [
- {
- "prefix": "Mr.",
- "given_name": "John",
- "surname": "Doe",
- "middle_name": "Middle",
- "suffix": "Jr.",
- "full_name": "John Middle Doe Jr.",
- "type": "LEGAL"
- }
- ],
- "citizenship": "US",
- "addresses": [
- {
- "address_line_1": "One Washington Square",
- "address_line_2": "Apt 123",
- "admin_area_2": "San Jose",
- "admin_area_1": "CA",
- "postal_code": "95112",
- "country_code": "US",
- "type": "HOME"
- }
- ],
- "phones": [
- {
- "country_code": "1",
- "national_number": "6692468839",
- "extension_number": "1234",
- "type": "MOBILE"
- }
- ],
- "birth_details": {
- "date_of_birth": "1955-12-29"
- },
- "role": "DIRECTOR"
- }
- ],
- "annual_sales_volume_range": {
- "minimum_amount": {
- "currency_code": "USD",
- "value": "10000"
- },
- "maximum_amount": {
- "currency_code": "USD",
- "value": "50000"
- }
- },
- "average_monthly_volume_range": {
- "minimum_amount": {
- "currency_code": "USD",
- "value": "1000"
- },
- "maximum_amount": {
- "currency_code": "USD",
- "value": "50000"
- }
- },
- "purpose_code": "P0104"
- },
- "email": "accountemail@example.com",
- "preferred_language_code": "en-US",
- "tracking_id": "testenterprices123122",
- "partner_config_override": {
- "partner_logo_url": "https://www.paypalobjects.com/webstatic/mktg/logo/pp_cc_mark_111x69.jpg",
- "return_url": "https://testenterprises.com/merchantonboarded",
- "return_url_description": "the url to return the merchant after the paypal onboarding process.",
- "action_renewal_url": "https://testenterprises.com/renew-exprired-url",
- "show_add_credit_card": true
- },
- "operations": [
- {
- "operation": "API_INTEGRATION",
- "api_integration_preference": {
- "classic_api_integration": {
- "integration_type": "THIRD_PARTY",
- "third_party_details": {
- "permissions": [
- "EXPRESS_CHECKOUT",
- "REFUND",
- "DIRECT_PAYMENT",
- "AUTH_CAPTURE",
- "BUTTON_MANAGER",
- "ACCOUNT_BALANCE",
- "TRANSACTION_DETAILS"
- ]
- },
- "first_party_details": "CERTIFICATE"
- },
- "rest_api_integration": {
- "integration_method": "PAYPAL",
- "integration_type": "THIRD_PARTY",
- "third_party_details": {
- "features": [
- "PAYMENT",
- "REFUND",
- "PARTNER_FEE"
- ]
- }
- }
- },
- "billing_agreement": {
- "description": "Billing Agreement Description Field",
- "billing_experience_preference": {
- "experience_id": "string",
- "billing_context_set": true
- },
- "merchant_custom_data": "PatnerMERCHANT23124",
- "approval_url": "wttps://www.paypal.com/agreements/approve?ba_token=BA-67944913LE886121E",
- "ec_token": "EC-1S970363DB536864M"
- }
- }
- ],
- "products": [
- "EXPRESS_CHECKOUT"
- ],
- "legal_consents": [
- {
- "type": "SHARE_DATA_CONSENT",
- "granted": true
- }
- ]
- },
- "links": [
- {
- "href": "https://uri.paypal.com/v2/customer/partner-referrals/ZjcyODU4ZWYtYTA1OC00ODIwLTk2M2EtOTZkZWQ4NmQwYzI3RU12cE5xa0xMRmk1NWxFSVJIT1JlTFdSbElCbFU1Q3lhdGhESzVQcU9iRT0=",
- "rel": "self",
- "method": "GET"
- },
- {
- "href": "https://www.paypal.com/merchantsignup/partner/onboardingentry?token=ZjcyODU4ZWYtYTA1OC00ODIwLTk2M2EtOTZkZWQ4NmQwYzI3RU12cE5xa0xMRmk1NWxFSVJIT1JlTFdSbElCbFU1Q3lhdGhESzVQcU9iRT0=",
- "rel": "action_url",
- "method": "GET"
- }
- ]
- }', true);
- }
- private function mockListSellerTrackingInformationResponse(): array
- {
- return Utils::jsonDecode('{
- "merchant_id": "8LQLM2ML4ZTYU",
- "tracking_id": "merchantref1",
- "links": [
- {
- "href": "v1/customer/partners/6LKMD2ML4NJYU",
- "rel": "read",
- "method": "GET",
- "description": "Main partner resource."
- }
- ]
- }', true);
- }
- private function mockShowSellerStatusResponse(): array
- {
- return Utils::jsonDecode('{
- "merchant_id": "8LQLM2ML4ZTYU",
- "products": [
- {
- "name": "PAYFLOW_PRO",
- "vetting_status": "APPROVED",
- "status": "ACTIVE"
- },
- {
- "name": "EXPRESS_CHECKOUT",
- "status": "ACTIVE"
- },
- {
- "name": "PPCP_STANDARD",
- "vetting_status": "SUBSCRIBED",
- "capabilities": [
- "CUSTOM_CARD_PROCESSING",
- "CARD_PROCESSING_VIRTUAL_TERMINAL",
- "FRAUD_TOOL_ACCESS",
- "AMEX_OPTBLUE",
- "DEBIT_CARD_SWITCH",
- "COMMERCIAL_ENTITY"
- ]
- },
- {
- "name": "PPCP_CUSTOM",
- "vetting_status": "IN_REVIEW",
- "capabilities": []
- }
- ],
- "capabilities": [
- {
- "name": "CUSTOM_CARD_PROCESSING",
- "status": "ACTIVE",
- "limits": [
- {
- "type": "GENERAL"
- }
- ]
- },
- {
- "name": "CARD_PROCESSING_VIRTUAL_TERMINAL",
- "status": "ACTIVE"
- },
- {
- "name": "FRAUD_TOOL_ACCESS",
- "status": "ACTIVE"
- },
- {
- "name": "AMEX_OPTBLUE",
- "status": "ACTIVE"
- },
- {
- "name": "DEBIT_CARD_SWITCH",
- "status": "ACTIVE"
- },
- {
- "name": "COMMERCIAL_ENTITY",
- "status": "ACTIVE"
- }
- ],
- "payments_receivable": true,
- "primary_email": "seller@example.com",
- "primary_email_confirmed": true,
- "granted_permissions": [
- "AIR_TRAVEL",
- "INVOICING",
- "RECURRING_PAYMENT_REPORT"
- ],
- "api_credential": {
- "signature": {
- "api_user_name": "example_api1.gmail.com",
- "api_password": "7QPZJL5PX2TT94RX",
- "signature": "Ak0kqXY-wqI.w.dfyQrwACtkK4HcMNxGdvADyrIE8QLgZWyIDNJSDlQ1e"
- }
- },
- "oauth_integrations": [
- {
- "integration_type": "OAUTH_THIRD_PARTY",
- "oauth_third_party": [
- {
- "partner_client_id": "AafBGhBphJ66SHPtbCMTsH1q2HQC2lnf0ER0KWAVSsOqsAtVfnye5Vc8hAOC",
- "merchant_client_id": "AafBGhBphJ66SHPtbCMTsH1q2HQC2lnf0ER0KWAVSsOqsAtVfnye5Vc8hAOC",
- "scopes": [
- "https://uri.paypal.com/services/payments/realtimepayment",
- "https://uri.paypal.com/services/payments/payment/authcapture",
- "https://uri.paypal.com/services/payments/refund"
- ]
- },
- {
- "partner_client_id": "AafBGhBphJ66SHPtbCMTsH1q2HQC2lnf0ER0KWAVSsOqsAtVfnye5Vc8hAOC",
- "merchant_client_id": "AafBGhBphJ66SHPtbCMTsH1q2HQC2lnf0ER0KWAVSsOqsAtVfnye5Vc8hAOC",
- "scopes": [
- "https://uri.paypal.com/services/payments/realtimepayment",
- "https://uri.paypal.com/services/payments/payment/authcapture"
- ]
- }
- ]
- }
- ],
- "limitations": [
- {
- "name": "MRCHT - Pending User Agreement",
- "restrictions": [
- "ACH IN",
- "Withdraw Money",
- "Remove Bank",
- "Refunds to Buyer",
- "Close Account",
- "Send Money",
- "Remove Card"
- ]
- },
- {
- "name": "Seller-linked merchant",
- "restrictions": [
- "ACH IN",
- "Send Money",
- "Refunds to Buyer",
- "Receive/Request Money",
- "Remove Bank",
- "Remove Card",
- "Withdraw Money",
- "Close Account"
- ]
- }
- ]
- }', true);
- }
- private function mockListMerchantCredentialsResponse(): array
- {
- return Utils::jsonDecode('{
- "client_id": "Ab27r3fkrQezHdcPrn2b2SYzPEldXx2dWgv76btVfI-eYF8KRAd2WxXAZyb0ETygSNeHBthzlxjlQ_qw",
- "client_secret": "EAcTvpnDHZf4icl_2MPnt2gRpOxHVtaQJChWU3PrRbYR4uyvUXV6h4DWQjm7XOfdnk_OrEEWdxY2eUG3",
- "payer_id": "QVG98CUNMS2PY"
- }', true);
- }
- }
|