Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: klarna Checkout SDK added #851

Merged
merged 2 commits into from
Jan 3, 2025
Merged

feat: klarna Checkout SDK added #851

merged 2 commits into from
Jan 3, 2025

Conversation

Sweta-Kumari-Sharma
Copy link
Contributor

@Sweta-Kumari-Sharma Sweta-Kumari-Sharma commented Dec 26, 2024

#850

Type of Change

  • Bugfix
  • New feature
  • Enhancement
  • Refactoring
  • Dependency updates
  • Documentation
  • CI/CD

Description

Added Klarna Checkout flow. This is a redirection flow.

How did you test it?

Payment data used in server.js for create-payment-intent call:

const paymentData = {
  amount: 50000,
  order_tax_amount: 0,
  confirm: false,
  currency: "USD",
  capture_method: "automatic",
  customer_id: "klarna",
  payment_experience: "redirect_to_url",
  capture_on: "2022-09-10T10:11:12Z",
  authentication_type: "no_three_ds",
  billing: {
    address: {
      line1: "1467",
      line2: "Harrison Street",
      line3: "Harrison Street",
      city: "San Francisco",
      state: "California",
      zip: "94122",
      country: "US",
      first_name: "joseph",
      last_name: "Doe"
    },
    phone: {
      number: "8056594427",
      country_code: "+91"
    },
    email: "[email protected]"
  },
  order_details: [
    {
      product_name: "Red T-Shirt",
      quantity: 5,
      amount: 10000,
      account_name: "transaction_processing",
      total_tax_amount: 0,
      tax_rate: 0,
      total_amount: 50000
    }
  ],
  email: "[email protected]",
  name: "John Doe",
  phone: "999999999",
  phone_country_code: "+65",
  description: "Its my first payment request",
  return_url: "https://google.com/"
};

klarna Kustom Checkout connector endpoint doesn't accept return_url without https, that's why I tested by using [https://www.google.com] as the return_url.

Screen.Recording.2024-12-27.at.9.31.53.PM.mov

Checklist

  • I ran npm run re:build
  • I reviewed submitted code
  • I added unit tests for my changes where possible

Copy link

semanticdiff-com bot commented Dec 26, 2024

Review changes with  SemanticDiff

Copy link
Collaborator

@PritishBudhiraja PritishBudhiraja left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I guess loader need to be off full screen that is coming only in the button error. And can you also handle the case when let's say I have Klarna Element and Payment Element both in a page what will happen.

src/WalletElement.res Outdated Show resolved Hide resolved
src/Utilities/PaymentBody.res Outdated Show resolved Hide resolved
src/Payments/PaymentRequestButtonElement.res Outdated Show resolved Hide resolved
src/Payments/KlarnaCheckout.res Outdated Show resolved Hide resolved
src/Payments/KlarnaCheckout.res Outdated Show resolved Hide resolved
src/Payments/KlarnaCheckout.res Outdated Show resolved Hide resolved
@PritishBudhiraja PritishBudhiraja changed the title FEAT: klarna Checkout SDK added feat: klarna Checkout SDK added Dec 26, 2024
@PritishBudhiraja PritishBudhiraja added the Ready for Review PR with label Ready for Review should only be reviewed. label Dec 26, 2024
@Sweta-Kumari-Sharma
Copy link
Contributor Author

Sweta-Kumari-Sharma commented Dec 27, 2024

I guess loader need to be off full screen that is coming only in the button error. And can you also handle the case when let's say I have Klarna Element and Payment Element both in a page what will happen.

I took reference from Paypal's redirection flow, in that also loader was shown above button.
Can you please help me figure out if in Klarna Checkout's redirection case, I need to show loader in full screen or this is okay?

Screen.Recording.2024-12-27.at.9.36.13.PM.mov

And this is how the UI looks when Payment Element is rendered as well
Screenshot 2024-12-27 at 9 37 51 PM

seekshiva
seekshiva previously approved these changes Dec 31, 2024
ImSagnik007
ImSagnik007 previously approved these changes Jan 1, 2025
sakksham7
sakksham7 previously approved these changes Jan 3, 2025
ImSagnik007
ImSagnik007 previously approved these changes Jan 3, 2025
@PritishBudhiraja PritishBudhiraja merged commit 3011a1c into main Jan 3, 2025
4 checks passed
@PritishBudhiraja PritishBudhiraja deleted the klarna-checkout branch January 3, 2025 07:07
@github-actions github-actions bot added Closed Label will be automatically added when the PR will get merged to main and removed Ready for Review PR with label Ready for Review should only be reviewed. labels Jan 3, 2025
sakksham7 pushed a commit that referenced this pull request Jan 3, 2025
# [0.107.0](v0.106.17...v0.107.0) (2025-01-03)

### Features

* klarna Checkout SDK added ([#851](#851)) ([3011a1c](3011a1c))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Closed Label will be automatically added when the PR will get merged to main
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Klarna Kustom Checkout (KCO) SDK
6 participants