Issue:
[BUG] Certificate decode failed when creating the session token for `applepay`

### Bug Description

It bugs out when creating session token for `applepay` if the certificate provided is in the wrong format.

### Expected Behavior

If the certificate provided is in the wrong format, then it should error out during creation of the `merchant_connector_account` where the certificate is provided.

### Actual Behavior

It fails when creating the session token for applepay.

### Steps To Reproduce

Provide an unambiguous set of steps to reproduce this bug. Include code or configuration to reproduce, if relevant.
1. Create a mca with wrong applepay certificate ( delete few characters, or do not base64 encode ).
2. Create a payment with confirm = false
3. Create session token
Result -> Applepay session token will not be generated

The log will be 
![Screenshot 2023-06-07 at 11 30 24 AM](https://github.com/juspay/hyperswitch/assets/48803246/5644cc0b-1fbe-49f6-b33f-6e1a09a0dcce)



### Context For The Bug

_No response_

### Environment

Are you using hyperswitch hosted version? Yes/No No
If yes, please provide the value of the `x-request-id` response header for helping us debug your issue.


### Have you spent some time to check if this bug has been raised before?

- [X] I checked and didn't find similar issue

### Have you read the Contributing Guidelines?

- [X] I have read the [Contributing Guidelines](https://github.com/juspay/hyperswitch/blob/main/docs/CONTRIBUTING.md)

### Are you willing to submit a PR?

Yes I am willing to submit a PR!

Resolution:
<think>
PR Context:
- Title: fix: certificate decode failed when creating the session token for applepay
- Merged: 2023-06-09T09:59:31Z
- Files changed: 4 files
- Commits: 3 commits

Implementation approach:
## Type of Change
<!-- Put an `x` in the boxes that apply -->

- [x] Bugfix

## Description
<!-- Describe your changes in detail -->
We used to have a lot of errors when creating applepay session tokens because of invalid certificates being sent when creating the merchant connector account. 

This PR will not allow the merchant connector account to be created if the format of certificates are invalid. To do this, it will decode the certificates and then create the identity ( the same pr
</think>

To implement this, you'll need to modify:


**Detailed Implementation:**


**Commit 1:** fix: certificate decode failed when creating the session token for applepay (#1385)
Files to modify:


**crates/api_models/src/payments.rs**
  Add:
    - struct: pub::ConnectorMetadata

**crates/router/src/core/admin.rs**
  Add:
    - function: private::validate_certificate_in_mca_metadata

**crates/router/src/core/payments/helpers.rs**
  Add:
    - function: pub::create_identity_from_certificate_and_key

**crates/router/src/services/api/client.rs**
  Modify existing code