<?php

namespace PayXpert\Connect2Pay\Tests;

class Connect2PayAPIMock
{

    public static function getPaymentStatusMock()
    {
        return json_decode(trim(self::getPaymentStatusJSONMock()), false);
    }

    public static function getWeChatPaymentStatusMock()
    {
        return json_decode(trim(self::getWeChatPaymentStatusJSONMock()), false);
    }

    public static function getAlipayPaymentStatusMock()
    {
        return json_decode(trim(self::getAlipayPaymentStatusJSONMock()), false);
    }

    public static function getAccountInformationMock()
    {
        return json_decode(trim(self::getAccountInformationJSONMock()), false);
    }

    public static function getPaymentStatusJSONMock()
    {
        return <<<EOS
{"apiVersion":"002.70","status":"Accepted","merchantToken":"JPhorvt8Zj8zH1eIrWNqmw","operation":"submission","errorCode":"000","errorMessage":"Transaction successfully completed","transactions":[{"paymentMerchantToken":"JPhorvt8Zj8zH1eIrWNqmw","paymentMethod":"DirectDebit","date":1517411275633,"amount":1050,"refundedAmount":0,"currency":"EUR","paymentMeanInfo":{"bankAccount":{"holderName":"John Doe","bankName":"RABOBANK NEDERLAND","iban":"NL32RABO019490XXXX","bic":"RABONL2UXXX","countryCode":"NL","sepaMandate":{"description":"Firmado fuera de BeSEPA.","status":"SIGNED","type":"RECURRENT","scheme":"CORE","signatureType":"CHECKBOX","signedAt":1517411294000,"createdAt":1517411277000,"lastUsedAt":1517411275633,"downloadUrl":"https://sandbox.besepa.com/m/man84c8f0078770f0/download"}},"statementDescriptor":"PayXpert Direct Debit Service","collectedAt":1517529600000},"shopper":{"id":"1234567","firstName":"John","lastName":"Doe","address1":"Debit Street, 45","zipcode":"3456TRG","city":"New York","state":"New York","countryCode":"US","homePhone":"+34666666666","email":"jsh@payxpert.com","ipAddress":"172.30.0.1","birthDate":"19700101","idNumber":"ABC-123456","account":{}},"operation":"submission","resultCode":"000","resultMessage":"Transaction successfully completed","status":"Accepted","orderDescription":"Test purchase of fake product.","isTest":true,"paymentID":"1v0masio6c","transactionID":"1v0masio6c-1nrr","providerTransactionID":"txn4470ce66621c89","orderID":"2018-01-31-16.07.34"},{"paymentMerchantToken":"JPhorvt8Zj8zH1eIrWNqmw","paymentMethod":"DirectDebit","date":1517411347734,"amount":9999,"refundedAmount":0,"currency":"EUR","paymentMeanInfo":{"bankAccount":{"holderName":"John Doe","bankName":"RABOBANK NEDERLAND","iban":"NL32RABO019490XXXX","bic":"RABONL2UXXX","countryCode":"NL","sepaMandate":{"description":"Firmado fuera de BeSEPA.","status":"SIGNED","type":"RECURRENT","scheme":"CORE","signatureType":"CHECKBOX","signedAt":1517411294000,"createdAt":1517411277000,"lastUsedAt":1517411275633,"downloadUrl":"https://sandbox.besepa.com/m/man84c8f0078770f0/download"}},"statementDescriptor":"PayXpert Direct Debit Service","collectedAt":1517529600000},"shopper":{"id":"1234567","firstName":"John","lastName":"Doe","address1":"Debit Street, 45","zipcode":"3456TRG","city":"New York","state":"New York","countryCode":"US","homePhone":"+34666666666","email":"jsh@payxpert.com","ipAddress":"172.30.0.1","birthDate":"19700101","idNumber":"ABC-123456","account":{}},"operation":"submission","resultCode":"000","resultMessage":"Transaction successfully completed","status":"Authorized","orderDescription":"Test purchase of fake product.","isTest":true,"paymentID":"1v0masio6c","transactionID":"1v0masio6c-naxo","providerTransactionID":"txn0681c835b10903","refTransactionID":"1v0masio6c-1nrr","orderID":"2018-01-31-16.07.34"},{"paymentMerchantToken":"JPhorvt8Zj8zH1eIrWNqmw","paymentMethod":"DirectDebit","date":1517584580124,"amount":1234,"refundedAmount":0,"currency":"EUR","paymentMeanInfo":{"bankAccount":{"holderName":"John Doe","bankName":"RABOBANK NEDERLAND","iban":"NL32RABO019490XXXX","bic":"RABONL2UXXX","countryCode":"NL","sepaMandate":{"description":"Firmado fuera de BeSEPA.","status":"SIGNED","type":"RECURRENT","scheme":"CORE","signatureType":"CHECKBOX","signedAt":1517411294000,"createdAt":1517411277000,"lastUsedAt":1517411275633,"downloadUrl":"https://sandbox.besepa.com/m/man84c8f0078770f0/download"}},"statementDescriptor":"PayXpert Direct Debit Service","collectedAt":1517875200000},"shopper":{"id":"1234567","firstName":"John","lastName":"Doe","address1":"Debit Street, 45","zipcode":"3456TRG","city":"New York","state":"New York","countryCode":"US","homePhone":"+34666666666","email":"jsh@payxpert.com","ipAddress":"172.30.0.1","birthDate":"19700101","idNumber":"ABC-123456","account":{}},"operation":"collection","resultCode":"000","resultMessage":"Transaction successfully completed","status":"Authorized","orderDescription":"Test purchase of fake product.","isTest":true,"paymentID":"1v0masio6c","transactionID":"1v0masio6c-e1ir","providerTransactionID":"txn0db4d5066e20cb","refTransactionID":"1v0masio6c-naxo","orderID":"2018-01-31-16.07.34"},{"paymentMerchantToken":"JPhorvt8Zj8zH1eIrWNqmw","paymentMethod":"DirectDebit","date":1517584708899,"amount":345,"refundedAmount":0,"currency":"EUR","paymentMeanInfo":{"bankAccount":{"holderName":"John Doe","bankName":"RABOBANK NEDERLAND","iban":"NL32RABO019490XXXX","bic":"RABONL2UXXX","countryCode":"NL","sepaMandate":{"description":"Firmado fuera de BeSEPA.","status":"SIGNED","type":"RECURRENT","scheme":"CORE","signatureType":"CHECKBOX","signedAt":1517411294000,"createdAt":1517411277000,"lastUsedAt":1517411275633,"downloadUrl":"https://sandbox.besepa.com/m/man84c8f0078770f0/download"}},"statementDescriptor":"PayXpert Direct Debit Service","collectedAt":1517875200000},"shopper":{"id":"1234567","firstName":"John","lastName":"Doe","address1":"Debit Street, 45","zipcode":"3456TRG","city":"New York","state":"New York","countryCode":"US","homePhone":"+34666666666","email":"jsh@payxpert.com","ipAddress":"172.30.0.1","birthDate":"19700101","idNumber":"ABC-123456","account":{}},"operation":"submission","resultCode":"000","resultMessage":"Transaction successfully completed","status":"Authorized","orderDescription":"Test purchase of fake product.","isTest":true,"paymentID":"1v0masio6c","transactionID":"1v0masio6c-1deb","providerTransactionID":"txnfe05bd233012e8","refTransactionID":"1v0masio6c-1nrr","orderID":"2018-01-31-16.07.34"},{"paymentMerchantToken":"JPhorvt8Zj8zH1eIrWNqmw","paymentMethod":"DirectDebit","date":1517584730994,"amount":623,"refundedAmount":0,"currency":"EUR","paymentMeanInfo":{"bankAccount":{"holderName":"John Doe","bankName":"RABOBANK NEDERLAND","iban":"NL32RABO019490XXXX","bic":"RABONL2UXXX","countryCode":"NL","sepaMandate":{"description":"Firmado fuera de BeSEPA.","status":"SIGNED","type":"RECURRENT","scheme":"CORE","signatureType":"CHECKBOX","signedAt":1517411294000,"createdAt":1517411277000,"lastUsedAt":1517411275633,"downloadUrl":"https://sandbox.besepa.com/m/man84c8f0078770f0/download"}},"statementDescriptor":"PayXpert Direct Debit Service","collectedAt":1517875200000},"shopper":{"id":"1234567","firstName":"John","lastName":"Doe","address1":"Debit Street, 45","zipcode":"3456TRG","city":"New York","state":"New York","countryCode":"US","homePhone":"+34666666666","email":"jsh@payxpert.com","ipAddress":"172.30.0.1","birthDate":"19700101","idNumber":"ABC-123456","account":{}},"operation":"submission","resultCode":"000","resultMessage":"Transaction successfully completed","status":"Authorized","orderDescription":"Test purchase of fake product.","isTest":true,"paymentID":"1v0masio6c","transactionID":"1v0masio6c-k8y2","providerTransactionID":"txnfa0068dfbc613c","refTransactionID":"1v0masio6c-1nrr","orderID":"2018-01-31-16.07.34"},{"paymentMerchantToken":"JPhorvt8Zj8zH1eIrWNqmw","paymentMethod":"DirectDebit","date":1517584904009,"amount":623,"refundedAmount":0,"currency":"EUR","paymentMeanInfo":{"bankAccount":{"holderName":"John Doe","bankName":"RABOBANK NEDERLAND","iban":"NL32RABO019490XXXX","bic":"RABONL2UXXX","countryCode":"NL","sepaMandate":{"description":"Firmado fuera de BeSEPA.","status":"SIGNED","type":"RECURRENT","scheme":"CORE","signatureType":"CHECKBOX","signedAt":1517411294000,"createdAt":1517411277000,"lastUsedAt":1517411275633,"downloadUrl":"https://sandbox.besepa.com/m/man84c8f0078770f0/download"}},"statementDescriptor":"PayXpert Direct Debit Service","collectedAt":1517875200000},"shopper":{"id":"1234567","firstName":"John","lastName":"Doe","address1":"Debit Street, 45","zipcode":"3456TRG","city":"New York","state":"New York","countryCode":"US","homePhone":"+34666666666","email":"jsh@payxpert.com","ipAddress":"172.30.0.1","birthDate":"19700101","idNumber":"ABC-123456","account":{}},"operation":"cancel","resultCode":"000","resultMessage":"Transaction successfully completed","status":"Authorized","orderDescription":"Test purchase of fake product.","isTest":true,"paymentID":"1v0masio6c","transactionID":"1v0masio6c-iwee","providerTransactionID":"txnfa0068dfbc613c","refTransactionID":"1v0masio6c-1nrr","orderID":"2018-01-31-16.07.34"}],"order":{"id":"2018-01-31-16.07.34","totalWithoutShipping":1000,"description":"Test purchase of fake product.","cartContent":[{"cartProductId":1345,"cartProductName":"Test Product","cartProductUnitPrice":456.0,"cartProductQuantity":1,"cartProductBrand":"Yellow Thumb","cartProductMPN":"NA","cartProductCategoryName":"Led screen","cartProductCategoryID":1234},{"cartProductId":6789,"cartProductName":"Test Product 2","cartProductUnitPrice":123.0,"cartProductQuantity":1,"cartProductBrand":"Yellow Thumb","cartProductMPN":"NA","cartProductCategoryName":"DVD reader","cartProductCategoryID":1235}],"recurrence":{"type":"undefined"}},"shipping":{"name":"Lady Gogo","address1":"125 Main Street","zipcode":"ABC-5678","city":"New York","state":"New York","countryCode":"US","phone":"+47123456789"},"currency":"EUR","amount":1050,"ctrlCustomData":"Give that back to me please !!"}
EOS;
    }

    public static function getWeChatPaymentStatusJSONMock()
    {
        return <<<EOS
{"apiVersion":"002.70","status":"Accepted","merchantToken":"JPhorvt8Zj8zH1eIrWNqmw","operation":"sale","errorCode":"000","errorMessage":"Transaction successfully completed","transactions":[{"paymentMerchantToken":"JPhorvt8Zj8zH1eIrWNqmw","paymentMethod":"WeChat","date":1517411275633,"amount":1050,"refundedAmount":0,"currency":"EUR","paymentMeanInfo":{"totalFee":568.90,"exchangeRate":7.8945},"shopper":{"id":"1234567","firstName":"John","lastName":"Doe","address1":"Debit Street, 45","zipcode":"3456TRG","city":"New York","state":"New York","countryCode":"US","homePhone":"+34666666666","email":"jsh@payxpert.com","ipAddress":"172.30.0.1","birthDate":"19700101","idNumber":"ABC-123456","account":{}},"operation":"sale","resultCode":"000","resultMessage":"Transaction successfully completed","status":"Accepted","orderDescription":"Test purchase of fake product.","isTest":true,"paymentID":"1v0masio6c","transactionID":"1v0masio6c-1nrr","providerTransactionID":"txn4470ce66621c89","orderID":"2018-01-31-16.07.34"}],"order":{"id":"2018-01-31-16.07.34","totalWithoutShipping":1000,"description":"Test purchase of fake product.","cartContent":[{"cartProductId":1345,"cartProductName":"Test Product","cartProductUnitPrice":456.0,"cartProductQuantity":1,"cartProductBrand":"Yellow Thumb","cartProductMPN":"NA","cartProductCategoryName":"Led screen","cartProductCategoryID":1234},{"cartProductId":6789,"cartProductName":"Test Product 2","cartProductUnitPrice":123.0,"cartProductQuantity":1,"cartProductBrand":"Yellow Thumb","cartProductMPN":"NA","cartProductCategoryName":"DVD reader","cartProductCategoryID":1235}],"recurrence":{"type":"undefined"}},"shipping":{"name":"Lady Gogo","address1":"125 Main Street","zipcode":"ABC-5678","city":"New York","state":"New York","countryCode":"US","phone":"+47123456789"},"currency":"EUR","amount":1050,"ctrlCustomData":"Give that back to me please !!"}
EOS;
    }

    public static function getAlipayPaymentStatusJSONMock()
    {
        return <<<EOS
{"apiVersion":"002.70","status":"Accepted","merchantToken":"JPhorvt8Zj8zH1eIrWNqmw","operation":"sale","errorCode":"000","errorMessage":"Transaction successfully completed","transactions":[{"paymentMerchantToken":"JPhorvt8Zj8zH1eIrWNqmw","paymentMethod":"Alipay","date":1517411275633,"amount":1050,"refundedAmount":0,"currency":"EUR","paymentMeanInfo":{"totalFee":568.90,"exchangeRate":7.8945},"shopper":{"id":"1234567","firstName":"John","lastName":"Doe","address1":"Debit Street, 45","zipcode":"3456TRG","city":"New York","state":"New York","countryCode":"US","homePhone":"+34666666666","email":"jsh@payxpert.com","ipAddress":"172.30.0.1","birthDate":"19700101","idNumber":"ABC-123456","account":{}},"operation":"sale","resultCode":"000","resultMessage":"Transaction successfully completed","status":"Accepted","orderDescription":"Test purchase of fake product.","isTest":true,"paymentID":"1v0masio6c","transactionID":"1v0masio6c-1nrr","providerTransactionID":"txn4470ce66621c89","orderID":"2018-01-31-16.07.34"}],"order":{"id":"2018-01-31-16.07.34","totalWithoutShipping":1000,"description":"Test purchase of fake product.","cartContent":[{"cartProductId":1345,"cartProductName":"Test Product","cartProductUnitPrice":456.0,"cartProductQuantity":1,"cartProductBrand":"Yellow Thumb","cartProductMPN":"NA","cartProductCategoryName":"Led screen","cartProductCategoryID":1234},{"cartProductId":6789,"cartProductName":"Test Product 2","cartProductUnitPrice":123.0,"cartProductQuantity":1,"cartProductBrand":"Yellow Thumb","cartProductMPN":"NA","cartProductCategoryName":"DVD reader","cartProductCategoryID":1235}],"recurrence":{"type":"undefined"}},"shipping":{"name":"Lady Gogo","address1":"125 Main Street","zipcode":"ABC-5678","city":"New York","state":"New York","countryCode":"US","phone":"+47123456789"},"currency":"EUR","amount":1050,"ctrlCustomData":"Give that back to me please !!"}
EOS;
    }

    public static function getAccountInformationJSONMock()
    {
        return <<<EOS
{"apiVersion":"002.70","name":"Unit Test Website","displayTerms":false,"termsUrl":"","supportUrl":"","maxAttempts":1,"notificationSenderName":"PayXpert Payment Service","notificationSenderEmail":"support@payxpert.com","notificationOnSuccess":true,"notificationOnFailure":true,"merchantNotification":true,"merchantNotificationTo":"support@payxpert.com","merchantNotificationLang":"fr","paymentMethods":[{"paymentMethod":"UnionPay","currencies":["EUR"],"defaultOperation":"sale"},{"paymentMethod":"DirectDebit","currencies":["EUR"],"defaultOperation":"submission"},{"paymentMethod":"WeChat","currencies":["EUR","USD"],"defaultOperation":"sale"},{"paymentMethod":"BankTransfer","paymentNetwork":"dragonpay","currencies":["EUR"],"defaultOperation":"sale"},{"paymentMethod":"BankTransfer","paymentNetwork":"trustly","currencies":["EUR"],"defaultOperation":"submission"},{"paymentMethod":"CreditCard","currencies":["EUR","USD"],"defaultOperation":"authorize","options":[{"name":"3dsMode","value":"honor"},{"name":"3dsVersion","value":"v2"}]},{"paymentMethod":"BankTransfer","paymentNetwork":"sofort","currencies":["EUR"],"defaultOperation":"sale"},{"paymentMethod":"BankTransfer","paymentNetwork":"eps","currencies":["EUR"],"defaultOperation":"sale"},{"paymentMethod":"Alipay","currencies":["EUR"],"defaultOperation":"sale"},{"paymentMethod":"Line","currencies":["TWD"],"defaultOperation":"sale"},{"paymentMethod":"BankTransfer","paymentNetwork":"ideal","currencies":["EUR"],"defaultOperation":"sale"},{"paymentMethod":"BankTransfer","paymentNetwork":"poli","currencies":["EUR"],"defaultOperation":"sale"},{"paymentMethod":"BankTransfer","paymentNetwork":"przelewy24","currencies":["PLN"],"defaultOperation":"sale"},{"paymentMethod":"ToditoCash","currencies":["EUR","MXN"],"defaultOperation":"sale"},{"paymentMethod":"Bancontact","currencies":["EUR"],"defaultOperation":"sale"},{"paymentMethod":"BankTransfer","paymentNetwork":"giropay","currencies":["EUR"],"defaultOperation":"sale"}]}
EOS;
    }
}